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)

Arguments

...

Ignored. Arguments must be named

after, before

string; the name of the environment on the search path that library() calls should by default attach after or before.

value

The value (or quoted expression) the new argument should be.

Value

The original default value of pos, invisibly

Details

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