File: parse_Rdtext.Rd

package info (click to toggle)
r-cran-rdpack 2.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,156 kB
  • sloc: sh: 13; makefile: 4
file content (74 lines) | stat: -rw-r--r-- 1,943 bytes parent folder | download | duplicates (4)
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
63
64
65
66
67
68
69
70
71
72
73
74
\name{parse_Rdtext}

\alias{parse_Rdtext}

%- Also NEED an '\alias' for EACH other topic documented here.

\title{
  Parse Rd source text as the contents of a section
}

\description{
  Parse Rd source text as the contents of a given section.
}

\usage{
parse_Rdtext(text, section = NA)
}

%- maybe also 'usage' for other objects documented here.

\arguments{
  \item{text}{Rd source text, a character vector.}
  \item{section}{the section name, a string.}
}

\details{

  If \code{section} is given, then \code{parse_Rdtext} parses
  \code{text} as appropriate for the content of section \code{section}.
  This is achieved by inserting \code{text} as an argument to the TeX
  macro \code{section}. For example, if \code{section} is
  "\verb{\usage}", then a line "\verb{\usage\{}" is inserted at the
  begiinning of \code{text} and a closing "\verb{\}}" at its end.

  If \code{section} is NA then \code{parse_Rdtext} parses it without
  preprocessing. In this case \code{text} itself will normally be
  a complete section fragment.
}

\value{
  an Rd fragment
}



\author{Georgi N. Boshnakov}

\note{
   The text is saved to a temporary file and parsed using
   \code{parse_Rd}. This is done for at least two reasons. Firstly,
   \code{parse_Rd} works most reliably (at the time of writing this)
   from a file. Secondly, the saved file may be slightly different
   (escaped backslashes being the primary example).
   It would be a nightmare to ensure that all concerned functions know
   if some Rd text is read from a file or not.

   The (currently internal) function \code{.parse_Rdlines} takes a
   character vector, writes it to a file (using \code{cat}) and calls
   \code{parse_Rd} to parse it.
}


%% ~Make other sections like Warning with \section{Warning }{....} ~


\seealso{
 \code{\link{parse_Rdpiece}}
}

% Add one or more standard keywords, see file 'KEYWORDS' in the

% R documentation directory.

\keyword{RdoProgramming}