parse_Rd
Parse an Rd File

Description

The function parses Rd document to special format, preparing Rd files for Rd processing functions.

Usage

parse_Rd(file, srcfile = NULL, encoding = "unknown", verbose = FALSE, 
    fragment = FALSE, warningCalls = TRUE, macros = file.path(R.home("share"), 
        "Rd", "macros", "system.Rd"), permissive = FALSE) 	

## S3 method for class 'Rd': print(x, deparse = FALSE, ...) ## S3 method for class 'Rd': as.character(x, deparse = FALSE, ...)

Arguments

file a character string or a connection object, can't be missing.
srcfile a "srcfile" object, includes source references.
encoding character string, indicates the encoding that input string will be converted to during the parsing.
verbose logical value, if TRUE, shows details during parsing.
fragment logical value, indicates whether the file is a completed Rd file or fragment. If TRUE, the small fragments of Rd files is accepted, so that such as \Sexpr can output Rd code which is then parsed.
warningCalls logical value, if TRUE, warning message will include the call.
macros a character string specifying the file name or an environment from which the additional macros will be loaded. it can be logical value, then default built-in macros will be used. If it is FALSE, the "macro" attribute won't be included in return value.
permissive a logical value to indicate if unrecognized macros should be converted into text without warning.
x object of class "Rd".
deparse logical value, if TRUE, deparse function will be carried out to recover escaped char.
... additional arguments to be passed in or from other functions.
Value
an object of class "Rd", composed with sections of Rd file with the expand "Rd_tag", encoding in "UTF-8". Each section consists of a list of text and markup macros, with the text stored as one-element character vectors and the markup macros as lists. Unless the argument "macros" is FALSE, the "macro" attribute will be contained.
print.Rd and as.character.Rd are generic methods of class "Rd" for printing and character transforming.
References
Murdoch, D. Parsing Rd files. R Developer Page. R Project.
See Also
Rd2HTML, checkRd
Examples
## Not run: 
library("tools")
infile<-file.path(R.home(), "src/library/tools/man/parse_Rd.Rd")
ret<-tools:::parse_Rd(infile)
ret<-tools:::parse_Rd(infile, warningCalls = TRUE, verbose = TRUE)
print(ret)
as.character(ret)

## End(Not run)
Package tools version 6.0.0-69
Package Index