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).

Note

Updated 2020-04-12.

Examples

saveRdExamples( Rd = c("do.call", "droplevels"), package = "base", dir = "example" )
#> Warning: The `path` argument of `write_lines()` is deprecated as of readr 1.4.0. #> Please use the `file` argument instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> Saved 2 Rd examples from base to 'example'.
## Clean up. unlink("example", recursive = TRUE)