Update functions that relied on 'flextable' and convert to 'gt'#429
Update functions that relied on 'flextable' and convert to 'gt'#429sbreitbart-NOAA wants to merge 21 commits intodevfrom
Conversation
… alt text/captions csv
…lextable-based pipeline with gt (for identifying table width, and splitting/rotating where needed). Next step: split super-long tables where necessary
… orientation and 1 table shown on landscape orientation
…shown, and instead state number of table vs total number of tables
…, and redesign to better work with gt tables vs flextables; update documentation and tests
…ce tab_options(table.width) is sufficient; add "tbl-pos: 't'" to table chunk options to anchor tables
…rpage" latex command
…ific columns in the table
Checklist
|
Code Metrics Report
Code coverage of files in pull request scope (67.6%)
Reported by octocov |
Schiano-NOAA
left a comment
There was a problem hiding this comment.
On initial review, the code looked good. It was really cool seeing one of the functions at 100% testing coverage. I'm not sure what, but something is going wrong in the code for splitting the tables. I tested this out on a table_landings that I exported which looked fine in the view, but when it was added to a report and rendered, it resulted in the table plus split tables containing all NA.
Here is what the table looks like straight from stockplotr::table_landings()
[break in rows because it was a long table]
and here is the issue in the rendered report:
The above table in the rendered report only displays the values up to 1917 while the data goes until 2024
the table continues with all NAs for an additional 3 pages.
Here is the workflow I used:
stockplotr::convert_output(file = "C:/Users/samantha.schiano/Documents/Stock Assessment Workflow/SS_output_examples/Sablefish/Results-2025/Report.sso", save_dir = file.path(getwd(), "conout.rda"))
load(file.path(getwd(),"conout.rda"))
stockplotr::table_landings(out_new, make_rda = TRUE)
create_template(model_results = file.path(getwd(), "conout.rda"))
|
I got a new error when running the code with your recent change I am not sure what could be wrong with my system. I think it's got to be something with the code, but I guess I will have to debug this issue if you can't replicate it :/ |
Which data did you use / can you add the code here? I'll try to reproduce your error. If I can't let's cowork on this next week |
|
@sbreitbart-NOAA it's happened with multiple examples. The most current one the code was then render to get this error I will upload my document I made to a github repo. Maybe see if you can pinpoint the error or render it? |
|
@Schiano-NOAA I noticed that my last commit missed adding in a few pipes, which broke the code. I've fixed that now and am able to produce reports with all kinds of tables (per width and length). Here's my code, if you want to try it. I understand if you'd rather wait to discuss this before trying it once more! |
|
Awesome! I tried it out with the fixes you pushed and I am still getting the NA tables. I made a repo if you want to try and fork it then render what I made. I will try the code you added above. If you are able to render/make it fine based on my example, then it must be my computer, but we will still need to figure out next week what is going on to advise users when this happens. Thanks for keeping at it! |
|
Ugh yeah still getting the same issue with your code too. We can go through the source code on my machine next Tuesday to see what is going on |
|
@Schiano-NOAA I forked your repo, downloaded the ft-to-gt branch, updated the |
What is the feature?
How have you implemented the solution?
Does the PR impact any other area of the project, maybe another repo?
These reports can be tagged. ✅