rdoseq <- utils:::.getHelpFile(help("seq"))
iusage <- which(tools:::RdTags(rdoseq) == "\\usage")
# append a new line after the last usage line
rdoseq2 <- append_to_Rd_list(rdoseq, list(Rdo_newline()), iusage)
# then append a new usage statement, in this case for another function
rdoseq2 <- append_to_Rd_list(rdoseq2, list(Rdo_Rcode("sequence()")), iusage)
Rdo_show(rdoseq2)
# the two operations can be done in one step
rdoseq3 <- append_to_Rd_list(rdoseq, list(Rdo_newline(), Rdo_Rcode("sequence()")), iusage)
Rdo_show(rdoseq3)
# now run reprompt to update the doc.
# reports new argument "nvec" and updates the Rd object.
# notice that the usage statement of sequence() is corrected
# and an item for argument nvec is created.
reprompt(rdoseq3, filename=NA)
Run the code above in your browser using DataLab