pander icon indicating copy to clipboard operation
pander copied to clipboard

Export keys.as.row.names to panderOptions

Open connorp opened this issue 3 years ago • 1 comments

I call pander implicitly in my Rmarkdown documents by setting df_print: !expr pander::pander in my YAML header. This mostly works well, as I just set options to modify pander's behavior using panderOptions. However, not every option is available. In particular, keys.as.row.names is not available to set via panderOptions. Could that be added as a globally settable option?

connorp avatar Feb 22 '22 23:02 connorp

I'd be open to a PR on this, but my concern is that there are many other options in the S3 methods that are not available via panderOptions, so it would be quite a lot of work to support all, and/or decide which params to extract to panderOptions.

That approach could also use a refactor .. it was written almost 10 yrs ago :sweat_smile:
Today I would probably do that in another way.

Anyway, to be more constructive, what about a wrapper helper function for your exact use case and call that in df_print?

pander2 <- function(x, ...) pander::pander(x, keys.as.row.names = FALSE, ...)

daroczig avatar Mar 17 '22 22:03 daroczig