/
parse_Rd.Rd
62 lines (58 loc) · 1.92 KB
/
parse_Rd.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% File src/library/tools/man/parse_Rd.Rd
% Part of the R package, http://www.R-project.org
% Copyright 2008 R Core Development Team
% Distributed under GPL 2 or later
\name{parse_Rd}
\alias{parse_Rd}
\title{ Parse an Rd file }
\description{
This function reads an R documentation (Rd) file and parses it, for
processing by other functions.
It is \bold{experimental}.
}
\usage{
parse_Rd(file, srcfile = NULL, encoding = "unknown", verbose = FALSE)
}
\arguments{
\item{file}{A filename or text-mode connection. At present filenames
work best.}
\item{srcfile}{\code{NULL}, or a \code{"srcfile"} object. See the
\sQuote{Details} section.}
\item{encoding}{Encoding to be assumed for input strings.}
\item{verbose}{Logical indicating whether detailed parsing
information should be printed.}
}
\details{
This experimental function parses Rd files according to the
specification given in
\url{http://developer.r-project.org/parseRd.pdf}. At the current
writing, this is not identical to the rules used by other tools: it
is somewhat stricter.
}
\value{
An object of class \code{"Rd"}. The internal format of this object is
subject to change.
At present files which are marked as Latin-1 or UTF-8 or where
\code{encoding} has one of those values result in text marked in the
encoding. In a non-UTF-8 MBCS locale the result will be marked as
UTF-8. In all other cases files are assumed to be in the native encoding.
}
\section{Warning}{
These functions are still experimental. Names, interfaces and values
might change in future versions.
}
\references{ \url{http://developer.r-project.org/parseRd.pdf} }
\author{ Duncan Murdoch }
\seealso{
\code{\link{Rd2HTML}}.
\code{\link{Rd_parse}}, the function used for parsing
Rd files by \command{R CMD check}.
}
\examples{
baseRd <- Rd_db("base")
con <- textConnection(baseRd[[1]], "rt")
parse_Rd(con)
close(con)
}
\keyword{utilities}
\keyword{documentation}