Closed lucy-schick closed 6 days ago
Solved this issue by moving the kableExtra::add_footnote
call to after kableExtra::kable_styling
call, in the print_tab_summary_bcfp
function. See code below. I'm not exactly sure why this works, but maybe the table needs to to fully styed before adding a footnote. Also want to mention that I tested changing the notation type to "alphabet'
and 'none
' in the original code and I got no errors, so the issue was irising when notation = 'symbol'
. And to solve this I had to change the order of calls mentioned above.
##this is in two places and should not be - see 0355-tables-reporting-html
print_tab_summary_bcfp <- function(site = my_site, font = 11, ...){
make_tab_summary_bcfp(site = site) %>%
kable(caption = paste0('Summary of fish habitat modelling for PSCIS crossing ', site, '.'), booktabs = T) %>%
kableExtra::kable_styling(c("condensed"), full_width = T, font_size = font) |>
kableExtra::add_footnote('Model data is preliminary and subject to adjustments.', notation = 'symbol')
}
Very nice!!
If you run into similar sorts of issues with local functions - test fpr functions that are equivalent and see if those run fine. If they do, we can likely do a find in files search and replace and replace the local function with fpr function. that saves us from doing a whole ton of doctoring of local functions that are already replicated elsewhere and likely much more up-to-date . Could definitely be more complex than that but probably worth testing at the beginning.
okay sounds good
There is an equivalent fpr function fpr_table_bcfp_html
which relies on fpr_table_bcfp
. I tested this function in the Skeena 2022 report and I get the same error as above, so I think the fpr function needs some edits, I will make an issue for this.
fpr_table_bcfp_html
and the local print_tab_summary_bcfp
functions only have a couple differences so I will update the local function with the fpr version, but keep the kableExtra call order as mentioned above to avoid errors.
Same issue with print_tab_summary
. Reordered and works fine now.
Issue I am running into when trying to build.
Issue is arising from
print_tab_summary_bcfp
function, something in thekableExtra(addfootnote())
call I think.