Rdpack (version 2.6)

get_usage_text: Get the text of the usage section of Rd documentation

Description

Get the text of the usage section of Rd documentation.

Usage

get_usage_text(rdo)

Value

a string

Arguments

rdo

an Rd object or a character string

Author

Georgi N. Boshnakov

Details

If rdo is a string, it is parsed to obtain an Rd object.

The content of section "\usage" is extracted and converted to string.

Examples

Run this code
## get the Rd object documenting Rdo_macro
#h <- utils::help("Rdo_macro", lib.loc = .libPaths())
#rdo <- utils:::.getHelpFile(h)
rdo <- Rdo_fetch("Rdo_macro", "Rdpack")
# extract the usage section and print it:
ut <- get_usage_text(rdo)
cat(ut, sep = "\n")

Run the code above in your browser using DataLab