-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop shared functions for making tables #78
Comments
Thank you for starting this discussion @iantaylor-NOAA. Currently, |
I think it would be great to store these in {sa4ss}. Then we could load the simple model from {r4ss} as a default for testing and for examples with the template. |
I started working on this in https://github.com/pfmc-assessments/sa4ss/tree/table_functions_78 . So far it's just the table of parameters, modified slightly from the lingcod version to fill in the blank cells based on guidance in #87. Based on input from @kellijohnson-NOAA about long tables split across pages causing problems for accessibility, I added the a wrapper function
It's on the user to figure out how many tables get produced and add text like Here's the top of the first table (useful to create this early in the process to see that there are some unnecessary priors on fixed parameters): @kellijohnson-NOAA, I don't know how quickly I'll be able to add more functions. Do you want this branch to stay separate until we have lots of table functions in it or should I create pull requests along the way as useful pieces get added? |
@iantaylor-NOAA this is great stuff, 🙏 thank you for working on this. I would like to merge it in next week when I am back from leave rather than waiting for more tables. Really quick, I see two things that we might want to change.
|
- Develop shared functions for making tables #78
Thanks for the input @kellijohnson-NOAA (though better to truly be on leave next time). I don't know why The resulting tables looks like this, which seems very readable to my eyes at least: |
As I've been adding tables for the petrale report, I've been adding to a checklist at the top of this issue of which table-making functions might be useful to re-use either from lingcod or those I've modified for petrale. For example, I just modified the The function is in
|
Ive updated @iantaylor-NOAA function here and here to allow output as a data.frame for instances where table manipulation is helpful and we dont have to edit tex tables! |
I simplified the lingcod decision table function and added it to the petrale repo in pfmc-assessments/petrale@d9b3dc1 along with the script to call it and the entry in the exec summary. The result is pasted below. I'm sure the code could be improved in many ways, but this should work for any set of 9 models populating a 3x3 decision table. It should work with just 1 or 2 catch streams as well, but is would break if you don't have 3 states of nature. |
Problem
U.S. West Coast groundfish assessment reports all use the same Terms of Reference which require the same tables. However, there have not been any shared functions developed to create most of the tables. Meeting Section 508 accessibility requirements will be easier with some changes to our tables and these changes will be easier if we share the effort.
Proposal
Write some new generalized functions for making standard tables. There are a bunch of functions that @kellijohnson-NOAA wrote for the 2021 lingcod assessments in https://github.com/pfmc-assessments/lingcod/tree/main/R that could be a starting place (just look for files with the name
R/table_*
). The other 2021 assessment repositories also have table-making code. Another useful reference is this spreadsheet of tables created by @chantelwetzel-noaa https://docs.google.com/spreadsheets/d/1NSFVKXfOLz0xQ_q7HsvxUmWY0778Os8O1kOwqf4kCAw/, which was the origin of Appendix I in our Terms of Reference.I don't know if these functions would be better added to {sa4ss} or a separate repository, and we don't need to have functions for 100% of the tables, but I think some shared functions would save a lot of time and angst and result in better and more consistent assessments.
I'm assigning myself and @chantelwetzel-noaa who just volunteered to look at the exec summary table functions (which is an example of shared functions that we are already using). @kellijohnson-NOAA, please comment on where you think stuff like this should go and if you have time or interest in helping with the code, that's welcome too.
Note that there's an r4ss issue related to this need as well, r4ss/r4ss#8, but it's been in place since 2014 without much progress, and the Rmarkdown/LaTeX-needs of U.S. west coast groundfish assessments make me think that something the pfmc-assessments organization is the better place to house these functions.
List of functions that could be added [edited at various times to add more detail and additional functions]
table_pars()
in petrale repo: https://github.com/pfmc-assessments/petrale/blob/main/R/table_pars.Rtable_parcounts()
function developed for petrale could be added to r4ss instead of sa4ss: https://github.com/pfmc-assessments/petrale/blob/main/R/table_parcounts.RThe text was updated successfully, but these errors were encountered: