Default undesirable functions and operatorsSource:
Lists of function names and operators for
There is a list for the default elements and another that contains all available elements.
modify_defaults() to produce a custom list.
all_undesirable_functions default_undesirable_functions all_undesirable_operators default_undesirable_operators
The following functions are sometimes regarded as undesirable:
attach()modifies the global search path. Use roxygen2's @importFrom statement in packages, or
browser()pauses execution when run and is likely a leftover from debugging. It should be removed.
debug()traps a function and causes execution to pause when that function is run. It should be removed.
debugonce()is only useful for interactive debugging. It should be removed.
detach()modifies the global search path. Detaching environments from the search path is rarely necessary in production code.
library()modifies the global search path. Use roxygen2's @importFrom statement in packages, or
source()loads code into the global environment unless
local = TRUEis used, which can cause unexpected behaviour.
trace()traps a function and causes execution of arbitrary code when that function is run. It should be removed.
The following operators are sometimes regarded as undesirable:
:::accesses non-exported functions inside packages. Code relying on these is likely to break in future versions of the package because the functions are not part of the public interface and may be changed or removed by the maintainers without notice. Use public functions via
->>assign outside the current environment in a way that can be hard to reason about. Prefer fully-encapsulated functions wherever possible, or, if necessary, assign to a specific environment with
assign(). Recall that you can create an environment at the desired scope with