print_globals {checkhelper} | R Documentation |
Print no visible globals from check and separate by category
Description
Print no visible globals from check and separate by category
Usage
print_globals(globals, path = ".", ..., message = TRUE)
Arguments
globals |
A list as issued from |
path |
Path to a package tarball or a directory. |
... |
Other parameters for |
message |
Logical. Whether to return message with content (Default) or return as list |
Value
A message with no visible globals or a list with no visible globals
Examples
## Not run:
# This runs a check of the example package
tempdir <- tempdir()
# Create fake package
usethis::create_package(file.path(tempdir, "checkpackage"), open = FALSE)
# Create function no visible global variables and missing documented functions
cat("
#' Function
#' @importFrom dplyr filter
#' @export
my_fun <- function() {
data %>%
ggplot2::ggplot() +
aes(x, y, colour = new_col) +
geom_point()
}
", file = file.path(tempdir, "checkpackage", "R", "function.R"))
path <- file.path(tempdir, "checkpackage")
attachment::att_to_description(path = path)
globals <- get_no_visible(path)
print_globals(globals = globals)
## End(Not run)
[Package checkhelper version 0.1.1 Index]