Skip to contents

Parse the documentation for a function and save the working examples to an R script. Note that the f argument is parameterized and can handle multiple requests in a single call.

Usage

saveRdExamples(package, rd = NULL, dir = getwd())

Arguments

package

character(1). Package name.

rd

character or NULL. R documentation name(s) from which to parse and save the working examples. If NULL, all documentation files containing examples will be saved.

dir

character(1). Directory path.

Value

Invisible character. File path(s).

Note

Updated 2022-05-31.

Examples

## > dir <- file.path(tempdir(), "testdata")
## > out <- saveRdExamples(
## >     rd = c("do.call", "droplevels"),
## >     package = "base",
## >     dir = dir
## > )
## > print(out)
## > unlink(dir, recursive = TRUE)