# the following creates Rd object rdo
dummyfun <- function(x) x
fn <- tempfile("dummyfun", fileext=".Rd")
reprompt(dummyfun, filename=fn)
rdo <- parse_Rd(fn)
dottext <- "further arguments to be passed on."
# rdo2 <- Rdo_append_argument(rdo, "\dots", dottext, create = TRUE)
rdo2 <- Rdo_append_argument(rdo, "\dots", dottext, create = TRUE)
rdo2 <- Rdo_append_argument(rdo2, "z", "a numeric vector")
Rdo_show(reprompt(rdo2))
# todo: Rdo_show(rdob) for some reason does not show the arguments.
# investigate! Rdo_show uses Rd2txt. Is it possible that the
# latter needs srcref's in the Rd object? They are only refreshed
# Rd_parse is called.
unlink(fn)
Run the code above in your browser using DataCamp Workspace