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.

saveRdExamples(Rd = NULL, package, dir = ".")

Arguments

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.

package

character(1). Package name.

dir

character(1). Directory path.

Value

Invisible character. File path(s).

Examples

saveRdExamples( Rd = c("do.call", "droplevels"), package = "base", dir = "example" )
#> Saved 2 Rd examples from base to example.
## Clean up. unlink("example", recursive = TRUE)