Description Usage Arguments Details Value See Also Examples
The repair_docu
methods repair some sometimes
encountered, minor problems in Rd files generated by
roxygen2 (but not those related to S4 methods), and
run the checks implemented in check_keywords
and
check_examples
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | repair_docu(x, ...)
## S3 method for class 'character'
repair_docu(x, ignore = NULL,
drop.internal = FALSE, ...)
## S3 method for class 'Rd'
repair_docu(x, remove.dups = FALSE,
text.dups = FALSE,
infile = attr(attr(x, "srcref"), "srcfile")$filename,
...)
check_keywords(x, ...)
## S3 method for class 'NULL'
check_keywords(x, full = FALSE, ...)
## S3 method for class 'character'
check_keywords(x, ...)
## S3 method for class 'logical'
check_keywords(x, ...)
## S3 method for class 'Rd'
check_keywords(x, file = NULL,
list.only = FALSE, ...)
check_examples(x, ...)
## S3 method for class 'Rd'
check_examples(x, file = NULL, ...)
|
x |
For For For |
remove.dups |
Logical scalar indicating whether
(probably) duplicate links in the |
text.dups |
Logical scalar indicating whether duplicate words within text content should be noted. |
file |
Optional character scalar indicating the name
of the file from which the ‘Rd’ object was read.
Useful when creating messages describing a problem. See
|
infile |
Used like the |
full |
Logical scalar indicating whether the full content of the ‘KEYWORDS.db’ file should be returned, not just the list of keywords. |
drop.internal |
Logical scalar indicating whether Rd files whose only keyword is ‘internal’ should be deleted. |
list.only |
Logical scalar indicating whether the keywords should just be collected, not checked against the database. |
... |
Optional arguments passed to and from other methods, or between the methods. |
ignore |
|
check_keywords
checks keywords in Rd files for
their presence, for their occurrence within the list
given in the ‘KEYWORDS.db’ file that comes with
R, and for fitting to the docType
entry of the
‘Rd’ object. The ‘Rd’ method examines the
content of Rd files.
In addition to checking that the keywords used are listed
in the ‘KEYWORDS.db’ file, it is checked that
‘internal’ is not combined with other keywords,
and that docType
entries such as ‘class’,
‘data’ or ‘package’ are accompanied by the
appropriate keywords.
check_examples
does not run the examples,
if any, and check their results. It checks
presence/absence of examples in Rd files. They should not
be present if the list of ‘keywords’ contains
‘internal’. Otherwise they should be present
unless docType
is ‘class’ or
‘package’.
The ‘Rd’ method of repair_docu
returns an
object of class ‘Rd’, the character method a list
of such objects, invisibly. If drop.internal
is
TRUE
, it returns a logical vector indicating
whether it was attempted to remove the file.
check_keywords
returns a character vector. As a
side effect, problem messages are printed to
stderr
. See logfile
for how to send
these messages to a file.
check_examples
returns a logical scalar,
TRUE
if examples are either there and should be
there or are missing and should be missing, FALSE
otherwise. As a side effect, problem messages are printed
to stderr
. See logfile
for how to
send these messages to a file.
Other rd-functions: repair_S4_docu
,
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 'Rd' objects
summary(x <- repair_docu(xyplot.docu, remove.dups = TRUE, text.dups = TRUE))
stopifnot(identical(x, xyplot.docu)) # nothing to repair here
(x <- check_keywords(xyplot.docu))
stopifnot(identical(x, "hplot"))
(x <- check_examples(xyplot.docu))
stopifnot(x)
# Character data, or zero arguments
(x <- check_keywords())
stopifnot(length(x) > 1, is.character(x), is.null(names(x)))
(x <- check_keywords(c("aplot", "loess")))
stopifnot(length(x) == 2, is.character(x), names(x) == c("aplot", "loess"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.