emm_example: Run or list additional examples

View source: R/emm-example.R

emm_exampleR Documentation

Run or list additional examples

Description

This function exists so as to provide cleaner-looking examples in help files when it must be run conditionally on another package. Typically we want to run the code (run = TRUE is the default), or otherwise just list it on the console (list = TRUE).

Usage

emm_example(name, run = !list, list = FALSE, ...)

Arguments

name

Character name of file to run. We look for a file with this name (with ".R" appended) in the system files provided with emmeans.

run

Logical choosing whether or not to run the example code

list

Logical choosing whether or not to list the example code

...

Used only by the developer

Examples

# List an example
emm_example("qdrg-biglm", list = TRUE)

# Run an example
if (require(biglm))
    emm_example("qdrg-biglm")


emmeans documentation built on Oct. 29, 2022, 1:09 a.m.