get_rd | R Documentation |
The function is using function provided by utils package, to retrieve a R
documentation object. It retrieve documentation either directly form the
source .Rd file, or extract it using help
function. See
Arguments section to get to know more about when each mode is called.
get_rd(topic, package, file = NULL, macros = NULL)
topic |
usually, a name or character string specifying the topic for which help is sought. A character string (enclosed in explicit single or double quotes) is always taken as naming a topic. If the value of See ‘Details’ for what happens if this is omitted. |
package |
a name or character vector giving the packages to look
into for documentation, or |
file |
Alternatively, provide a |
macros |
Filename or environment from which to load additional macros, or a logical value. See the Details below. |
macros
and file
parameters are used directly by the
tools::parse_Rd
function. Please refer to details of this
function to get to know more about their usage. The rd2markdown
package adds an additional behavior to the original macros
. If it is
NA
then get_rd
will try to find macros directory
associated with passed file and pass it to tools::parse_Rd
.
# Retrieve documentation directly form the .Rd file
rd_file_example <- system.file("examples", "rd_file_sample.Rd", package = "rd2markdown")
rd2markdown::get_rd(file = rd_file_example)
# Retrieve documentation from an installed package
rd2markdown::get_rd(topic = "rnorm", package = "stats")
# Auto discover macros
rd2markdown::get_rd(file = rd_file_example, macros = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.