rd2list
is a package for extracting R documentation into a structured,
human-readable list. Use this package if you’ve ever wanted to get the
help text for a function as a string.
get_doc()
- get a structured, human-readable list of the
documentation for a function.get_rd_doc()
- fetch the Rd object for a function from an
installed package.rd2list()
- parse an Rd object into a structured, human-readable
list.You can install from github with:
remotes::install_github("coolbutuseless/rd2list")
doc <- rd2list::get_doc(function_name = 'geom_path', package = 'ggplot2')
doc$title
#> [1] "Connect observations"
doc$description
#> `geom_path()` connects the observations in the order in which they
#> appear in the data. `geom_line()` connects them in order of the
#> variable on the x axis. `geom_step()` creates a stairstep plot,
#> highlighting exactly when changes occur. The `group` aesthetic
#> determines which cases are connected together.
doc$arguments$linejoin
#> [1] "Line join style (round, mitre, bevel)."
doc$alias
#> [1] "geom_path" "geom_line" "geom_step"
The raw Rd documentation object can be fetched using get_rd_doc()
.
rd2list::get_rd_doc(function_name = 'diag', package_name = 'base')
$title
$title[[1]]
[1] "Matrix Diagonals"
attr(,"Rd_tag")
[1] "TEXT"
attr(,"Rd_tag")
[1] "\\title"
$name
$name[[1]]
[1] "diag"
attr(,"Rd_tag")
[1] "VERB"
attr(,"Rd_tag")
[1] "\\name"
$alias
$alias[[1]]
[1] "diag"
attr(,"Rd_tag")
[1] "VERB"
attr(,"Rd_tag")
[1] "\\alias"
[... output trimmed]
Rd
format.fgui::parseHelp()
used to
work, but has been disabled by author.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.