Check R code for possible problems.
checkUsage(fun, name = "", report = cat, all = FALSE,
suppressLocal = FALSE, suppressParamAssigns = !all,
suppressParamUnused = !all, suppressFundefMismatch = FALSE,
suppressLocalUnused = FALSE, suppressNoLocalFun = !all,
skipWith = FALSE, suppressUndefined = dfltSuppressUndefined,
suppressPartialMatchArgs = TRUE)
checkUsageEnv(env, ...)
checkUsagePackage(pack, ...)
closure.
character; name of closure.
environment containing closures to check.
character naming package to check.
options to be passed to checkUsage
.
function to use to report possible problems.
logical; report all possible problems if TRUE.
suppress all local variable warnings.
suppress warnings about assignments to formal parameters.
suppress warnings about unused formal parameters.
suppress warnings about multiple local function definitions with different formal argument lists
suppress warnings about unused local variables
suppress warnings about using local variables as functions with no apparent local function definition
logical; if true, do not examine code portion of
with
or within
expressions.
suppress warnings about undefined global functions and variables.
suppress warnings about partial argument matching
Luke Tierney
checkUsage
checks a single R closure. Options control which
possible problems to report. The default settings are moderately
verbose. A first pass might use suppressLocal=TRUE
to
suppress all information related to local variable usage.
The suppressXYZ
values can either be scalar logicals or
character vectors; then they are character vectors they only
suppress problem reports for the variables with names in the vector.
checkUsageEnv
and checkUsagePackage
are convenience
functions that apply checkUsage
to all closures in an
environment or a package. checkUsagePackage
requires that the
package be loaded. If the package has a name space then the internal
name space frame is checked.
checkUsage(checkUsage)
checkUsagePackage("codetools",all=TRUE)
if (FALSE) checkUsagePackage("base",suppressLocal=TRUE)
Run the code above in your browser using DataLab