Remove srcref attributes from Rd objects
Internal Rdpack Functions
Convert f_usage objects to text appropriate for usage sections in
Rd files
Collect aliases in an Rd object
Apply a function over an Rd object
Find positions of elements in an Rd object
Inspect the slots of an S4 class
Convert a character vector to Rd piece
Give the formal arguments of an S4 method
Parse a piece of Rd source text
Inspect the usage section in an Rd object
Tensor comparison and asymmetric comparison between two vectors
Find the position of an "Rd_tag"
Find or remove empty sections in Rd objects
Insert a new element in an Rd object
Replace or modify parts of Rd objects
Find leaves of an Rd object using a predicate
Format the usage text of functions
Parse the name section of an Rd object
Concatenate Rd objects or pieces
Some functions initially in package gbRd
Insert a new element in an Rd object possibly surrounding it with new
lines
Locate the sections in Rd objects
Get the text of the usage section of Rd documentation
Usage text for a function or S3 method
Convert an Rd object to text and show it
Convert an Rd object to Rd file format
Inspect and update an Rd object or file
Check if an Rd fragment represents a newline character
Generates a shell of documentation for an installed package
Append an item for a new argument to an Rd object
Add content to the element of an Rd object or fragment at a given
position
Update the documentation of a topic
Inspect the argument section of an Rd object
Manipulate a number of Rd files
Internal functions used by reprompt
~~ Dummy title ~~
Format Rd fragments as macros (todo: a baffling title!)
Set the Rd_tag of an object
Inspect signatures of S4 methods
Reparse an Rd object
Produce the textual form of the signatures of available methods for
an S4 generic function
Tables of predefined sections and types of pieces of Rd objects
Combine Rd fragments
[stage=build,results=hide]{require(Rdpack)}
[stage=build,results=hide]{pd <- packageDescription("Rdpack")}
[stage=build,results=hide]{lb <- library(help="Rdpack", character.only=TRUE)}
[stage=build]{pd$Title}
[stage=build]{pd$Description}
ll {
Package: [stage=build]{pd$Package}
Type: [stage=build]{pd$Type}
Version: [stage=build]{pd$Version}
Date: [stage=build]{pd$Date}
License: [stage=build]{pd$License}
LazyLoad: [stage=build]{pd$LazyLoad}
Built: [stage=build]{pd$Built}
Index:
[stage=build,results=rd]{paste("\\preformatted{", paste(if(!is.null(lb$info[[2]])) lb$info[[2]] else "No entries",collapse="\n"), "}", sep="")}
Package Rdpack
may be help authors of Rpackages to keep their
documentation up to date during development. Although base R and
package methods
have functions for creation of skeleton
documentation, if a function gets a new argument or a generic gets a
new method, then updating existing documentation is somewhat
inconvenient. This package provides functions that update parts of the
Rd documentation that can be dealt with automatically and leave manual
changes untouched. For example, usage sections for functions are
updated and if there are undescribed arguments, additional items are
put in the `arguments' section.
The main function provided by this package is
reprompt
. It produces a skeleton documentation for the
requested object, similarly to functions like prompt
,
promptMethods
, and promptClass
. Unlike those functions,
reprompt
updates existing documentation (installed or in
an Rd object or file) and produces a skeleton from scratch as a last
resort only. If the documentation object describes more than one
function, all descriptions are updated. Basically,
reprompt
updates things that are generated
automatically, leaving manual editing untouched.
The typical use of reprompt
is with one argument, as in
reprompt(infile = "./Rdpack/man/reprompt.Rd")
reprompt(reprompt)
reprompt("reprompt")
reprompt
updates the documentation and writes the updated
Rd file in the current working directory, see reprompt
for details.
The function promptPackageSexpr
creates a skeleton for a
package overview in file name-package.Rd . Then the file can be
edited as needed. This function needs to be called only once for a
package since automatic generation of information in
name-package.Rd is achieved with Sexpr's at build time, not
with verbatim strings as promptPackage
does.
For example, the source of this help page is file
`Rdpack-package.Rd'. It was initially produced using
promptPackageSexpr("Rdpack")
The factual information at the beginning of this help topic (the index
above, the version and other stuff that can be determined
automatically) is kept automatically up to date.
Note that there are other, more sophisticated, approaches to keeping
documentation and code in synchron, for example package roxygen
(todo: give references here).
It can hardly get simpler than using a single function with one
argument (the doc file or the object to be updated) to update all
sorts of Rd documentation files. Some may find that this is all they
need and not bother with the rest of this documentation.
Other functions that may be useful are Rdo2Rdf
, Rdapply
and Rd_combo
. Here is also brrief information about some more
technical functions that may be helpful in certain circumstances.
c_Rd
concatenates Rd pieces, character strings and lists
to create a larger Rd piece or a complete Rd object.
list_Rd
is similar to c_Rd
but provides
additional features for convenient assembling of Rd objects.
parse_Rdpiece
is technical function for parsing pieces
of Rd source text but it has an argument to return formatted help text
which may be useful when one wishes to show it to the user.
Rdo_set_section
can be used to set a section, such as
"[object Object]".
The remaining functions in the package are for programming with Rd
objects (and probably many of them should not be exported).
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] Parse Rd source text as the contents of a section
Simple modification of Rd objects
Parse expressions residing in character vectors
Dummy title
Compare usage entries for a function
Parse usage text
Parse formal arguments of functions
Replace a section in an Rd file
Update aliases for methods in Rd objects
Escape backslashes and percent in Rd code