Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dev_example

Run a examples for an in-development function.


Description

dev_example is a replacement for example. run_example is a low-level function that takes a path to an Rd file.

Usage

dev_example(topic, quiet = FALSE)

run_example(
  path,
  run_donttest = FALSE,
  run_dontrun = FALSE,
  env = new.env(parent = globalenv()),
  quiet = FALSE,
  macros = NULL,
  run,
  test
)

Arguments

topic

Name or topic (or name of Rd) file to run examples for

quiet

If TRUE, does not echo code to console.

path

Path to .Rd file

run_donttest

if TRUE, do run \donttest sections in the Rd files. out.

run_dontrun

if TRUE, do run \dontrun sections in the Rd files.

env

Environment in which code will be run.

macros

Custom macros to use to parse the .Rd file. See the macros argument of tools::parse_Rd(). If NULL, then the tools::Rd2ex() (and tools::parse_Rd()) default is used.

run, test

Deprecated, see run_dontrun and run_donttest above.

Examples

## Not run: 
# Runs installed example:
library("ggplot2")
example("ggplot")

# Runs develoment example:
dev_example("ggplot")

## End(Not run)

pkgload

Simulate Package Installation and Attach

v1.2.1
GPL-3
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], Winston Chang [aut], RStudio [cph], R Core team [ctb] (Some namespace and vignette code extracted from base R)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.