Learn R Programming

Rdpack (version 0.4-4)

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

Details

If rdo is a string, it is parsed to obtain an Rd object. The content of section "" is extracted and converted to string. a string [object Object] todo: get_usage_text can be generalised to any Rd section but it is better to use a different approach since print.Rd() does not take care for some details (escaping %, for example). Also, the functions that use this one assume that it returns Rcode, which may not be the case if the usage section contains Rd comments. # 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 = "")Rdusage