Package 'roxyglobals'

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-11-14 02:58:13 UTC
Source: https://github.com/anthonynorth/roxyglobals

Help Index


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)
}

Use roxyglobals

Description

Configures roxygen to use global_roclet(), adds roxyglobals to Suggests

Usage

use_roxyglobals()

Value

nothing

Examples

## Not run: 
use_roxyglobals()

## End(Not run)