ddotta / tablexlsx

R package to export data frames from R to xlsx workbook
https://ddotta.github.io/tablexlsx/
Other
16 stars 1 forks source link

Accept a character vector for `title` argument when object is a single `data.frame` #19

Closed JulienBlasco closed 5 months ago

JulienBlasco commented 7 months ago

The following code produces an error

toxlsx(iris, path=tempdir(), title = "Ma super table")
# Erreur : title must be of class list

Desired result

This should produce an Excel with "Ma super table" as a title in cell A1.

More generally, I think toxlsx should accept length 1 character vectors as arguments for tosheet, footnote1, footnote2, footnote3 when object is a single data.frame object, and not a list.

JulienBlasco commented 7 months ago

And after all, why not use character vectors all the way? If the first argument is a list, you can provide a character vector of same length to tosheet, footnote1, etc.