Concatenate Rd objects or pieces
Parse usage text
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
Parse the name section of an Rd object
Convert an Rd object to Rd file format
Generates a shell of documentation for an installed package
Combine Rd fragments
Replace or modify parts of Rd objects
Simple modification of Rd objects
Add content to the element of an Rd object or fragment at a given
position
Update aliases for methods in Rd objects
Work with bibtex references in Rd documentation
Locate the sections in Rd objects
Find leaves of an Rd object using a predicate
Remove srcref attributes from Rd objects
Insert a new element in an Rd object
Find or remove empty sections in Rd objects
Replace a section in an Rd file
Inspect and update an Rd object or file
Format Rd fragments as macros (todo: a baffling title!)
Parse a piece of Rd source text
Tensor comparison and asymmetric comparison between two vectors
~~ Dummy title ~~
Internal functions used by reprompt
Give the key associated with a bibentry element
Apply a function over an Rd object
Find the position of an "Rd_tag"
Inspect the argument section of an Rd object
Find positions of elements in an Rd object
Usage text for a function, S3 method or S4 method
Get all references from a Bibtex file
Rdo_locate_predefined_section
Locate the position of a predefined section
Check if an Rd fragment represents a newline character
Set the Rd_tag of an object
[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.
Another set of functions is for management of bibliographic
references.
The main functions provided by this package are
reprompt
, promptPackageSexpr
, and
rebib
.
reprompt
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 of all objects described in
the Rd object or file, and writes the updated Rd file in the current
working directory, see reprompt
for details.
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.
rebib
updates the bibliographic references in an Rd
file. Rdpack uses a simple scheme for inclusion of
bibliographic references. The key for each reference is in a TeX comment
line, as in:
\references{
...
% bibentry: key1
% bibentry: key2
...
}
rebib
puts each reference after the line containing its
key. It does nothing if the reference has been put by a previous call
of rebib
. If the Bibtex entry for some references changes, it
may be necessary to update them in the Rd file, as well. Call
rebib
with force = TRUE
to get this effect. There is
also a facility to include all references from the Bibtex file, see
the documentation of rebib
for details.
The Bibtex source for the references is by default a file
"REFERENCES.bib" located in the root of the package installation
folder.
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],[object Object],[object Object],[object Object] Collect aliases in an Rd object
Get the text of the usage section of Rd documentation
Give the formal arguments of an S4 method
Insert content in an Rd fragment
Update the documentation of a topic
Give information about Rd elements
Escape backslashes and percent in Rd code
Compare usage entries for a function
Inspect the slots of an S4 class
Parse Rd source text as the contents of a section
Parse expressions residing in character vectors
Format the usage text of functions
Inspect signatures of S4 methods
Convert an Rd object to text and show it
Append an item for a new argument to an Rd object
Convert a character vector to Rd piece
Inspect the usage section in an Rd object
Convert f_usage objects to text appropriate for usage sections in
Rd files
Manipulate a number of Rd files
Insert a new element in an Rd object possibly surrounding it with new
lines
Reparse an Rd object
Parse formal arguments of functions