Cast an S3-object of class "checkglobalsg" to a matrix.
Usage
# S3 method for class 'checkglobalsg'
as.matrix(x, pattern, ...)Arguments
- x
object inheriting from class
"checkglobalsg".- pattern
an optional regular expression. Only names matching
patternare returned.glob2rxcan be used to convert wildcard patterns to regular expressions.- ...
additional arguments to configure the output:
all.names, a logical value. IfTRUE, all object names are returned. IfFALSE, names which begin with a . are omitted. Defaults toTRUE.sorted, a logical value indicating if the function/variable names should be sorted alphabetically. Defaults toTRUE.
Value
a matrix similar in format to as.matrix.checkglobals.
Examples
## R-package from folder
chk <- checkglobals(
pkg = system.file(
"unit_tests", "pkg", "testpkg",
package = "checkglobals"
)
)
as.matrix(chk$globals)
#> name package type
#> [1,] "%>%" NA "global"
#> [2,] "fAttach2" NA "global"
#> [3,] "fLoad2" NA "global"
#> [4,] "g" NA "global"