get_notes: List notes from check and identify global variables

View source: R/ch_list_globals.R

get_notesR Documentation

List notes from check and identify global variables

Description

List notes from check and identify global variables

Usage

get_notes(path = ".", checks, ...)

Arguments

path

Path to a package tarball or a directory.

checks

Output of rcmdcheck if already computed

...

Other parameters for rcmdcheck

Value

A tibble with notes and information about the global variables

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 %>%
filter(col == 3) %>%
mutate(new_col = 1) %>%
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)
get_notes(path)

## End(Not run)

ThinkR-open/checkhelper documentation built on Jan. 26, 2024, 4:16 p.m.