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

Global Option for NA symbol and locale #1673

Closed
retodomax opened this issue May 21, 2024 · 1 comment
Closed

Global Option for NA symbol and locale #1673

retodomax opened this issue May 21, 2024 · 1 comment
Assignees

Comments

@retodomax
Copy link
Contributor

Package gt has a few global options (see ?`gt-options`). For Example, the function gt() checks by default for a global option in the argument row_group.sep i.e.

gt(
  row_group.sep = getOption("gt.row_group.sep", " - ")
)

I think a similar approach would make sense for other arguments which a user usually wants to set globally (e.g. locale and NA value)

gt(
  locale = getOption("gt.locale", "NULL")
)
sub_missing(
  missing_text = getOption("gt.missing.text", "---")
)

For the NA symbol, it would be even better if the sub_missing() function would not have to be explicitly called.

A similar option also exists for the kable() function

options(knitr.kable.NA = '')

Or maybe there is there another way to achieve this without having to set the locale and NA value for each table individually?

@rich-iannone
Copy link
Member

Some global options do exist but I'm generally not in favor of global options because they reduce reproducibility. Because of that, I think these options cannot be made global.

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

No branches or pull requests

2 participants