Path related functions
mod_search_path
returns the character vector of paths where module
code can be located and will be found by box.
mod_search_path(caller) calling_mod_path(caller) split_path(path) merge_path(components)
caller |
the environment from which |
path |
the path to split |
components |
character string vector of path components to merge |
calling_mod_path
the path of the source module that is calling
box::use
, or the script’s path if the calling code is not a module.
split_path
returns a character vector of path components that
logically represent path
.
merge_path
returns a single character string that is
logically equivalent to the path
passed to split_path
.
logically represent path
.
The search paths are ordered from highest to lowest priority. The current module’s path always has the lowest priority.
There are two ways of modifying the module search path: by default,
getOption('box.path')
specifies the search path as a character vector.
Users can override its value by separately setting the environment variable
R_BOX_PATH to one or more paths, separated by the platform’s path
separator (“:” on UNIX-like systems, “;” on Windows).
merge_path
is the inverse function to split_path
.
However, this does not mean that its result will be identical to the
original path. Instead, it is only guaranteed that it will refer to the same
logical path given the same working directory.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.