Skip to contents

This function creates R files in the inst/examples/ to be reused in tests, #' @examples and more. When reused for tests, only last return of an example file will be tested. You may therefore need a lot of relatively small example files. The suggested convention is to sort them in folders named by file_name function name and test name.

Usage

use_ex_file(..., open = rlang::is_interactive())

Arguments

...

character vectors, if any values are NA, the result will also be NA. The paths follow the recycling rules used in the tibble package, namely that only length 1 arguments are recycled.

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

See also

Other example helpers: source_pef()