global_roclet {roxyglobals} | R Documentation |
Roclet: global
Description
This roclet automates utils::globalVariables()
declaration from @global
and @autoglobal roxygen tags.
Package authors will not typically need to invoke global_roclet()
directly.
Global roclet instances are created by roxygen2
during roxygen2::roxygenise()
(or devtools::document()
).
Usage
global_roclet()
Value
A roxygen2::roclet()
instance for declaring utils::globalVariables()
during roxygen2::roxygenise()
Examples
#' @autoglobal
foo <- function(x) {
# bar isn't declared -> add to utils::globalVariables()
subset(x, bar == 4)
}
#' @global bar
foo <- function(x) {
# bar is explicitly defined as a global -> add to utils::globalVariables()
subset(x, bar == 4)
}
[Package roxyglobals version 1.0.0 Index]