1\name{Rdo_append_argument}
2\alias{Rdo_append_argument}
3\title{
4  Append an item for a new argument to an Rd object
5}
6\description{
7  Append an item for a new argument to an Rd object.
8}
9\usage{
10Rdo_append_argument(rdo, argname, description = NA, indent = "  ", create = FALSE)
11}
12\arguments{
13  \item{rdo}{an Rd object.}
14  \item{argname}{name of the argument, a character vector.}
15  \item{description}{description of the argument, a character vector.}
16  \item{indent}{a string, typically whitespace.}
17  \item{create}{not used (todo: remove?)}
18}
19\details{
20  Appends one or more items to the section describing arguments of
21  functions in an Rd object. The section is created if not present.
22
23  If \code{description} is missing or NA, a "todo" text is inserted.
24
25  The inserted text is indented using the string \code{indent}.
26
27  The lengths of \code{argname} and \code{description} should normally
28  be equal but if \code{description} is of length one, it is repeated to
29  achieve this when needed.
30}
31\value{
32  an Rd object
33}
34\author{Georgi N. Boshnakov}
35\examples{
36## the following creates Rd object rdo
37dummyfun <- function(x) x
38fn <- tempfile("dummyfun", fileext = ".Rd")
39reprompt(dummyfun, filename = fn)
40rdo <- tools::parse_Rd(fn)
41
42## add documentation for arguments
43## that are not in the signature of 'dummyfun()'
44dottext <- "further arguments to be passed on."
45dots <- paste0("\\\\", "dots")
46rdo2 <- Rdo_append_argument(rdo, dots, dottext, create = TRUE)
47rdo2 <- Rdo_append_argument(rdo2, "z", "a numeric vector")
48
49## reprompt() warns to remove documentation for non-existing arguments:
50Rdo_show(reprompt(rdo2, filename = fn))
51
52unlink(fn)
53}
54\keyword{RdoBuild}
55%\keyword{RdoElements}
56
57