globalVariables
Declarations Used in Checking a Package
Description
Declares variables to be treated as global in checking a package.
Usage
globalVariables(names, package, add = TRUE)
suppressForeignCheck(names, package, add = TRUE)
Arguments
names |
a vector of character strings. The names of objects in the global variables list.
|
package |
a character string or an environment object. Indicates the namespace to which to assign the objects.
|
add |
a logical value. If TRUE (the default), then get the current object in package,
and assign it to package, together with names. Do not repeat the objects' names.
|
Details
If names is not missing, the namespace of package must not be locked.
If package is missing, then
treat the top-level environment of parent environment of current function as package.
Value
returns a vector of character strings and displays the names of objects.
See Also
Examples
## Not run:
x.gl <- 1
y.gl <- 2
utils::globalVariables(c("x.gl", "y.gl"))
# add value of y.gl to global
utils::globalVariables(c(y.gl))
utils::globalVariables(c("x.gl", "y.gl"), package = "base")
utils::globalVariables(y.gl, package = "base")
utils::globalVariables(y.gl, package = "base", add = FALSE)
## End(Not run)