davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
565 stars 82 forks source link

unknown export from flextable: `flextable_to_rmd()` with @importFrom #614

Closed TimBMK closed 8 months ago

TimBMK commented 8 months ago

This is probably just a minor issue, but when importing flextable_to_rmd() in function documentations with devtools/roxygen2, such as #' @importFrom flextable flextable_to_rmd()

Calling devtools::document() gives the following problem: @importFrom Excluding unknown export from flextable: flextable_to_rmd().

I'm not sure what's causing this, and in most cases it should not be a problem, but may make it harder to use this particular function in packages down the road.

I'm running flextable v0.9.5 on R 4.2.2 under Ubuntu 20.04.5 LTS

davidgohel commented 8 months ago

Hi Sorry, it should have been written, don't import flextable_to_rmd (and not flextable_to_rmd()) in your package but prefer posit recommendation: https://ardata-fr.github.io/flextable-book/rendering.html#looping-in-r-mardown-documents

I will add a note to flextable_to_rmd and deprecate it if I am not able to substitute its code with something compliant with posit recommendation

davidgohel commented 8 months ago

flextable_to_rmd() is now using knit_child() for safer usage from for loops or if statements now. It's safier and therefore will not be deprecated :)

TimBMK commented 8 months ago

Awesome! Will check downstream compability, but it looks like this is gonna save me from changing the code in my own packages/functions, haha. Thanks for the update and the great package!

github-actions[bot] commented 2 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.