Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple panderOptions #333

Open
ymer opened this issue Dec 4, 2018 · 2 comments
Open

Multiple panderOptions #333

ymer opened this issue Dec 4, 2018 · 2 comments

Comments

@ymer
Copy link

ymer commented Dec 4, 2018

Is there a way to set multiple pander options in the same command? I feel it clutters the code to have 3+ lines of panderOptions commands.

@dcomtois
Copy link
Contributor

In summarytools, made the transition from the method used in pander to the one you suggest. If anyone wants to work on it, I think this would be a good basis. Note that it supports the "legacy" way of settings options, too.

https://github.com/dcomtois/summarytools/blob/dev-current/R/st_options.R

@daroczig
Copy link
Member

Sorry for the late reply, did not really have time to work on pander recently -- but planning to spend more time on this in 2019 and probably release v1.0 with quite some refactoring and cleaning up these legacy issues (with potentially with some minor breaking changes as well). Until then, you could try something like

multiPanderOptions <- function(...) {
    options <- list(...)
    for (i in seq_along(options)) {
        panderOptions(names(options)[i], options[[i]])
    }
}
multiPanderOptions(digits = 5, decimal.mark = ',', 5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants