Rdpack (version 0.4-20)

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)

Arguments

rdo
an Rd object or a character string

Value

a string

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 <- help("Rdo_macro")
rdo <- utils:::.getHelpFile(h)

ut <- get_usage_text(rdo)

# in this case rdo describes other objects
# and their usage entries are returned, as well.
cat(ut,sep = "\n")

Run the code above in your browser using DataLab