permit_mutation | R Documentation |
devutils
will invariably inject some objects into the package namespace.
However, the extent to which this happens may be undesirable. Unless new
privileges are granted, devutils
will aim to minimally affect your
namespace.
permit_mutation(which = c("all", "some", "none"), env = parent.frame())
Each level of permissioning grants additional permissions to modify your package namespace. From least to most extensive, permissions are granted as one of
Minimalist permissions, and the default behavior.
Creates a .devutils
environment in your package namespace
wherein settings and data are stored
Moderate permissions, modifying your namespace, but only as a side effect
of direct use of devutils
functions.
using suggested
creates an object of the package's name in the
package environment, which can be used with $
or [[
indexing
Full permissions, additionally masking some base functions in your package namespace.
Masks base ::
and :::
to automatically handle suggested
packages, throwing errors when unavailable suggested package functions
are called
## Not run: permit_mutation("some") utils <- suggested("utils") utils$head(1:10) permit_mutation("all") suggested("utils") utils::head(1:10) permit_mutation("all") suggested("not.a.real.package") not.a.real.package::head(1:10) # Error: This feature is unavailable because package 'not.a.real.package' # is not installed. ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.