Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auto set options in own package

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)
like image 537
ckluss Avatar asked May 23 '15 10:05

ckluss


1 Answers

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.

like image 181
Dirk Eddelbuettel Avatar answered Oct 10 '22 10:10

Dirk Eddelbuettel