flapper_opts: Global example controls

flapper_optsR Documentation

Global example controls

Description

These variables provide convenient switches for turning examples on/off during package testing. They can be overridden by the user.

Usage

flapper_run_parallel

flapper_run_slow

Format

An object of class logical of length 1.

An object of class logical of length 1.

Details

A set of logical variables:

  • flapper_run_parallel is a logical variable that defines whether or not to run selected parallel examples.

  • flapper_run_slow is logical variable that defines whether or not to run selected ‘slow’ examples.

Author(s)

Edward Lavender

Examples

#### Example (1): flapper_run_parallel
## Illustration of intended usage for a parallelised function
if (flapper_run_parallel) {
  cl_lapply(1:10,
    function(x) x + 1,
    cl = parallel::makeCluster(2L)
  )
}

#### Example (2): flapper_run_slow
## Illustration of intended usage for a slow function
if (flapper_run_slow) {
  pf_args <- dat_dcpf_histories$args
  pf_args$n <- 100
  pf_args$calc_distance <- "lcp"
  pf_args$seed <- 1
  out_pf <- do.call(pf, pf_args)
}


edwardlavender/flapper documentation built on Jan. 22, 2025, 2:44 p.m.