davidgohel / flextable

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

as_flextable not working on tabular objects and R < 4.1 #544

Closed RobertAdrien closed 1 year ago

RobertAdrien commented 1 year ago

Using as_flextable on a tabular object results in the following error:

Error in FUN(newX[, i], …) : unused argument (simplify = FALSE)

See simple example from the documentation, which produces this error on my Linux setup:

if (require("tables")) {
tab <- tabular(
    (mean + mean) * (Sepal.Length + Sepal.Width) ~ 1,
    data = iris
 )
as_flextable(tab)
}
davidgohel commented 1 year ago

please provide sessionInfo()results as explained in the guidelines


When submitting a new issue:

RobertAdrien commented 1 year ago

Sorry, here is the result of sessionInfo() 232C00B3-324B-4B57-B1BB-CAFC24594ADF

davidgohel commented 1 year ago

The issue/bug is because we use apply(simplify = FALSE) and simplify = FALSE appeared in R-4.1. A quick workaround would be to use a version of R >=4.1. We will try to fix

davidgohel commented 1 year ago

thanks, it should be fixed

github-actions[bot] commented 11 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.