it is probably bad style
but can I modify options on package loading? E.g. my package should set the following options
options(java.parameters = "-Xmx8000m")
options(dplyr.width = Inf)
lattice.options(default.args = list(as.table = TRUE))
lattice.options(skip.boundary.labels = 0)
Yes, of course you can -- use the .onAttach()
function for that. You then may want to make sure you document this, though, and maybe restore it when the package unloads.
Whether you should is not so clear. As an alternative (which may be more common) you can also set personal preferences in ~/.Rprofile
or the site-wide Rprofile.site
. I often do that for myself and colleagues for things like remote server settings.
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