as.data.frame.checkglobals {checkglobals}R Documentation

Cast to data.frame

Description

Cast an S3-object of class "checkglobals" to a data.frame.

Usage

## S3 method for class 'checkglobals'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  pattern,
  which = c("global", "import"),
  ...
)

Arguments

x

object inheriting from class "checkglobals".

row.names

currently not used, included for compatibility with as.data.frame generic.

optional

currently not used, included for compatibility with as.data.frame generic.

pattern

an optional regular expression. Only names matching pattern are returned. glob2rx can be used to convert wildcard patterns to regular expressions.

which

a character vector, either "global" to print all unrecognized global variables, "import" to print all detected imported functions and variables, or both (default).

...

additional arguments to configure the output:

  • all.names, a logical value. If TRUE, all object names are returned. If FALSE, names which begin with a ‘⁠.⁠’ are omitted. Defaults to TRUE.

  • sorted, a logical value indicating if the function/variable names should be sorted alphabetically. Defaults to TRUE.

Value

a data.frame with three character columns:

See Also

as.data.frame

Examples

## R-package from folder
chk <- checkglobals(
  pkg = system.file(
    "unit_tests", "pkg", "testpkg",
    package = "checkglobals"
  )
)
as.data.frame(chk)

## include only selected imports
as.data.frame(chk, pattern = "coef", which = "import")

[Package checkglobals version 0.1.0 Index]