Replace or modify parts of Rd objects
Replace or modify parts of Rd objects.
Rdo_modify(rdo, val, create = FALSE, replace = FALSE, top = TRUE) Rdo_replace_section(rdo, val, create = FALSE, replace = TRUE)
an Rd object.
an Rd fragment.
if TRUE, create a new section, see `Details'.
a logical, if TRUE
valreplaces the old content, otherwise
valis concatenated with it, see `Details'.
a logical, if TRUE examine also the "Rd_tag" of
rdo, see `Details'.
rdo is an Rd object (complete or a fragment) to be
val is an Rd fragment to use for modification.
val is appended to (if
replace is FALSE) or
replace is TRUE) the content of an element of
rdo which has the same "Rd_tag" as
top specifies whether to check the "Rd_tag" of
rdo itself, see below.
Here are the details.
top is TRUE and
val have the same
(non-NULL) "Rd_tag", then the action depends on
create is ignored in this case).
replace is TRUE,
val is returned. Otherwise
val are, effectively, concatenated. For example,
rdo may be the "arguments" section of an Rd object and
val may also be an "arguments" section containing new
Otherwise, an element with the "Rd_tag" of
val is searched in
tools:::RdTags(). If such elements are found,
the action again depends on
replaceis a character string, then the first element of
rdothat is a list whose only element is identical to the value of
replaceis replaced by
val. If such an element is not present and
valis inserted in
rdois not changed.
replaceis TRUE, the first element found is replaced with
valis appended to the first element found.
If no element with the "Rd_tag" of
val is found the action
create is TRUE, then
is inserted in
rdo, effectively creating a new section. If
create is FALSE, an error is thrown.
Rdo_replace_section is like
Rdo_modify with argument
top fixed to TRUE and the default for argument
set to TRUE. It hardly makes sense to call
replace = FALSE but a character value for it may be
handy in some cases, see the examples.