Title: | 'Roxygen2' Global Variable Declarations |
---|---|
Description: | Generate utils::globalVariables() from 'roxygen2' @global and @autoglobal tags. |
Authors: | Anthony North [aut, cre, cph],
Miles McBain [ctb] |
Maintainer: | Anthony North <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-08-16 02:50:17 UTC |
Source: | https://github.com/anthonynorth/roxyglobals |
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()
).
global_roclet()
global_roclet()
A roxygen2::roclet()
instance for declaring utils::globalVariables()
during roxygen2::roxygenise()
#' @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) }
#' @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) }
Configures roxygen to use global_roclet()
, adds roxyglobals to Suggests
use_roxyglobals()
use_roxyglobals()
nothing
## Not run: use_roxyglobals() ## End(Not run)
## Not run: use_roxyglobals() ## End(Not run)