Package {runExamplesWrapper}


Version: 2.0
Date: 2026-08-27
Title: Wrapper for 'run_example()'
Maintainer: Barry Zeeberg <barryz2013@gmail.com>
Author: Barry Zeeberg [aut, cre]
Depends: R (≥ 4.2.0)
Imports: tools, cli
Description: Captures errors or missing examples encountered when iteratively running 'run_examplez()', and archives them.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
Encoding: UTF-8
VignetteBuilder: knitr
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-08-27 21:03:16 UTC; barryzeeberg
Repository: CRAN
Date/Publication: 2026-08-28 07:00:27 UTC
Config/roxygen2/version: 8.1.0

runExamplesWrapper

Description

driver to automate iterating run_examplez() and retrieve the test results for each example

Usage

runExamplesWrapper(dir, quiet = TRUE, run_donttest = TRUE, run_dontrun = TRUE)

Arguments

dir

character string containing the full path name of the package directory

quiet

parameter to be passed to run_examplez()

run_donttest

parameter to be passed to run_examplez()

run_dontrun

parameter to be passed to run_examplez()

Value

returns a character vector specifying each function example as either "GOOD", "BAD", or "MIA"

Examples

## Not run: 
# use your own package directory
runExamplesWrapper(getwd())

## End(Not run)


run_examplez

Description

run an example retrieved from a man .Rd file

Usage

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

Arguments

path

character string containing the full path name of the package directory

run_donttest

if TRUE, do run donttest sections in the Rd files

run_dontrun

if TRUE, do run dontrun sections in the Rd files

env

Environment in which code will be run.

quiet

If TRUE, does not echo code to console

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

Deprecated, see run_dontrun and run_donttest above.

test

Deprecated, see run_dontrun and run_donttest above.

Details

my own version of pkgload::run_example() to improve the return value

Value

returns a character vector whose names are the man .Rd files and whose values are c("GOOD", "BAD", "MIA")

Examples

## Not run: 
# use your own package directory
x<-tryCatch(run_examplez(sprintf("%s/man/%s",getwd(),"compareProbs.Rd")),error = function(e) {
    # What to do if an error happens
    message("An error occurred, but we caught it!")
    return("BAD") })

## End(Not run)