From the vignette of tibble, I read that some changes can be made in global options through options
to control the appearance of printing. However, I failed to find any manual for this options with in R. I even cannot known what fields can be added to global options for a package. So the question is:
For a package, can we get a list of fields (like tibble.print_max
, tibble.print_min
for tibble
and BioC_mirror
for utils
) that can be set through options
with in R before knowing them?
Global option function such as options() and par() provides a way to control global settings. Here the GlobalOptions package provides a more general and controlable way to generate such functions, which can: validate the values (e.g. class, length and self-defined validations);
The options() function in R is used to set and examine different global options that affects the way in which R determines and returns its results.
Given the lack of required practice (e.g., on CRAN) for how to handle options in external (or even internal, as far as I can tell) packages, perhaps the most general approach is like this:
Find the package on the CRAN mirror on GitHub. For example, here's tibble
.
Search for "option" within the repository to find all references to "option" in the package's code.
Search through this. It takes a bit of a keen eye to know what to look for, but this is how I learned that all of tibble
's options are listed on the main package help page (?"tibble-package"
), because I found these lines with the search.
Step 3 can be automated better if you clone the repo to your machine and use command line tools, e.g.
cd package_dir
grep option R/*
(this is quite similar to the above, but enables the full flexibility of grep
)
Just for additional confirmation, this approach led me to the right place for data.table
and xtable
as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With