base::library()
R/set_library_default_pos.R
set_library_default_pos.Rd
This function is documented but not exported. Reach in with
envir:::set_library_default_pos()
to use it.
set_library_default_pos(..., after = NULL, before = NULL, value = NULL)
Ignored. Arguments must be named
string; the name of the environment on the search path that library() calls should by default attach after or before.
The value (or quoted expression) the new argument should be.
The original default value of pos
, invisibly
This is primarily a way to "pin" a particular environment on the
search path. For example, say you have a "project_utils" environment where
you've defined a variety of useful functions. To prevent future library()
calls from masking any objects in your attached "project_utils"
environment, you can modify the default pos
argument to library.
attach_source("project_utils.R", name = "project_utils)
set_library_default_pos(after = "project_utils")
library(foo) # now foo will attach after the "project_utils" environment