parse_Rd {tools} | R Documentation |
This function reads an R documentation (Rd) file and parses it, for processing by other functions.
parse_Rd(file, srcfile = NULL, encoding = "unknown", verbose = FALSE, fragment = FALSE, warningCalls = TRUE) ## S3 method for class 'Rd': print(x, deparse = FALSE, ...) ## S3 method for class 'Rd': as.character(x, deparse = FALSE, ...)
file |
A filename or text-mode connection. At present filenames work best. |
srcfile |
NULL , or a "srcfile" object. See the
‘Details’ section. |
encoding |
Encoding to be assumed for input strings. |
verbose |
Logical indicating whether detailed parsing information should be printed. |
fragment |
Logical indicating whether file represents a complete Rd file, or a fragment. |
warningCalls |
Logical: should parser warnings include the call? |
x |
An object of class Rd. |
deparse |
If TRUE , attempt to reinstate the escape characters
so that the resulting characters will parse to the same object. |
... |
Further arguments to be passed to or from other methods. |
This function parses ‘Rd’ files according to the specification given in http://developer.r-project.org/parseRd.pdf. This is not identical to the rules used before version 2.10.x: it is somewhat stricter.
As from R 2.10.0, parse_Rd
generates a warning for each parse
error and attempts to continue parsing. In order to continue, it is
generally necessary to drop some parts of the file, so such warnings
should not be ignored.
parse_Rd
returns an object of class "Rd"
. The
internal format of this object is subject to change. The
as.character()
and print()
methods defined for the
class return character vectors and print them, respectively.
Files without a marked encoding are by default assumed to be in the
native encoding. An alternate default can be set using the
encoding
argument. All text in files is translated to the
UTF-8 encoding in the parsed object.
Duncan Murdoch
http://developer.r-project.org/parseRd.pdf
Rd2HTML
for the converters that use the output of
parse_Rd()
.