Skip to contents

Flags a write from an example, vignette or demo whose destination is a literal path, so it lands in the user's filespace rather than in tempdir(). A destination the caller supplies is permission and is not flagged.

Usage

lab_example_writes(path = ".", verbose = TRUE)

Arguments

path

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

verbose

Logical. Print diagnostic output. Default: TRUE.

Value

checktor_check_result() with passed, issues, message.

Source

The CRAN Cookbook covers this under Writing Files and Directories to the Home Filespace, and the rejection reads "Please ensure that your functions do not write by default or in your examples/vignettes/tests in the user's home filespace". See vignette("check-sources", package = "checktor") for how every check maps to its source.

See also

checktor(), lab_file_operations() for the same rule in R/.

Examples

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