modifySearchPath: Modify package order in search path

.modifySearchPathR Documentation

Modify package order in search path

Description

Intended for internal use only. It modifies the search path (i.e., search()) such that the packages required by the current module are placed first in the search path. Note, several "core" packages are not touched; or more specifically, they will remain in the search path, but may move down if packages are rearranged. The current set of these core packages used by SpaDES can be found here: SpaDES.core:::.corePackages

Usage

.modifySearchPath(
  pkgs,
  removeOthers = FALSE,
  skipNamespacing = !getOption("spades.switchPkgNamespaces")
)

Arguments

pkgs

The packages that are to be placed at the beginning of the search path,

removeOthers

Logical. If TRUE, then only the packages in c(pkgs, SpaDES.core:::.corePackages) will remain in the search path, i.e., all others will be removed.

skipNamespacing

Logical. If FALSE, then the running of an event in a module will not trigger a rearrangement of the search() path. This will generally speed up module simulations, but may create name conflicts between packages.

Value

Nothing. This is used for its side effects, which are "severe".

Author(s)

Eliot McIntire


PredictiveEcology/SpaDES.core documentation built on April 17, 2024, 8:27 a.m.