before running the expression we check what namespaces are loaded and what variables are created, anything other than this is removed/unloaded at the end of the call.
options =, is like options(), but we might check with some heuristics for base R or common packages
env = for env variables, though usually better set in .renviron, we need it because if we want the global .renviron we can't use the local one
... : object definitions, these are moved to a .Rprofile env on the search path, that we manage to put after default packages with attach(). args of the shape pkg::fun are changed into active bindings so nothing breaks at startup
everything is wrapped in a tryCatch() so this can't fail, the session always starts, if something goes wrong we undo what's been done and display a message saying RProfile wasn't used
we unload the package on.exit, so cleanrprofile::cleanrprofile is not even seen in the session
before running the expression we check what namespaces are loaded and what variables are created, anything other than this is removed/unloaded at the end of the call.
options =, is like options(), but we might check with some heuristics for base R or common packages
env = for env variables, though usually better set in .renviron, we need it because if we want the global .renviron we can't use the local one
... : object definitions, these are moved to a .Rprofile env on the search path, that we manage to put after default packages with attach(). args of the shape
pkg::fun
are changed into active bindings so nothing breaks at startupeverything is wrapped in a tryCatch() so this can't fail, the session always starts, if something goes wrong we undo what's been done and display a message saying RProfile wasn't used
we unload the package on.exit, so
cleanrprofile::cleanrprofile
is not even seen in the session