Skip to contents

Flags library() / require() in package code, which alters the user's search path. Code destined for a parallel worker is exempt, since a daemon starts with an empty search path.

Usage

lab_library_in_pkg(path, verbose = TRUE, parsed = NULL)

Arguments

path

Character. Path to the package directory. Default: ".".

verbose

Logical. Print diagnostic output. Default: TRUE.

parsed

Optional pre-parsed source, as returned internally by the orchestrator. Defaults to parsing path afresh.

Value

checktor_check_result() with passed, issues, message.

Source

Writing R Extensions, under "Package Dependencies", asks package code to reach its dependencies through Imports and :: rather than attaching them with library(). See vignette("check-sources", package = "checktor") for how every check maps to its source.

See also

checktor(), which runs this and every other check.

Examples

pkg <- example_diagnose_scenario("code_examples/tf_usage_bad.R",
                                 show_content = FALSE)
lab_library_in_pkg(pkg, verbose = FALSE)$passed
#> [1] TRUE