| repair_docu {pkgutils} | R Documentation | 
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.
  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,
# 'Rd' objects
summary(x <- repair_docu(xyplot.docu, remove.dups = TRUE, text.dups = TRUE))
##       Length Class  Mode     
##  [1,]   1    -none- list     
##  [2,]   1    -none- character
##  [3,]   1    -none- list     
##  [4,]   1    -none- character
##  [5,]   1    -none- list     
##  [6,]   1    -none- character
##  [7,]   1    -none- list     
##  [8,]   1    -none- character
##  [9,]   1    -none- list     
## [10,]   1    -none- character
## [11,]   1    -none- list     
## [12,]   1    -none- character
## [13,]   1    -none- list     
## [14,]   1    -none- character
## [15,]   1    -none- list     
## [16,]   1    -none- character
## [17,]   1    -none- list     
## [18,]   1    -none- character
## [19,]   1    -none- list     
## [20,]   1    -none- character
## [21,]   1    -none- list     
## [22,]   1    -none- character
## [23,]   1    -none- list     
## [24,]   1    -none- character
## [25,]   1    -none- list     
## [26,]   1    -none- character
## [27,]   1    -none- list     
## [28,]   1    -none- character
## [29,]   1    -none- list     
## [30,]   1    -none- character
## [31,]   1    -none- list     
## [32,]   1    -none- character
## [33,]   1    -none- list     
## [34,]   1    -none- character
## [35,]   1    -none- list     
## [36,]   1    -none- character
## [37,]  99    -none- list     
## [38,]   1    -none- character
## [39,]   1    -none- character
## [40,]  28    -none- list     
## [41,]   1    -none- character
## [42,]   1    -none- character
## [43,]   1    -none- character
## [44,]   1    -none- character
## [45,]   1    -none- character
## [46,]   1    -none- character
## [47,]   1    -none- character
## [48,]   1    -none- character
## [49,]   1    -none- character
## [50,]   1    -none- character
## [51,]   1    -none- character
## [52,]   1    -none- character
## [53,]   1    -none- character
## [54,]   1    -none- character
## [55,]   1    -none- character
## [56,]   1    -none- character
## [57,]   1    -none- character
## [58,] 128    -none- list     
## [59,]   1    -none- character
## [60,]   1    -none- character
## [61,]   1    -none- character
## [62,]  13    -none- list     
## [63,]   1    -none- character
## [64,]   1    -none- character
## [65,]  89    -none- list     
## [66,]   1    -none- character
## [67,]   1    -none- character
## [68,]  13    -none- list     
## [69,]   1    -none- character
## [70,]   1    -none- character
## [71,]   6    -none- list     
## [72,]   1    -none- character
## [73,]   1    -none- character
## [74,]  52    -none- list     
## [75,]   1    -none- character
## [76,]   1    -none- character
## [77,]   2    -none- list     
## [78,]   1    -none- character
## [79,]   1    -none- character
## [80,]  81    -none- list     
## [81,]   1    -none- character
## [82,]   1    -none- list     
## [83,]   1    -none- character
stopifnot(identical(x, xyplot.docu)) # nothing to repair here
(x <- check_keywords(xyplot.docu))
## [1] "hplot"
stopifnot(identical(x, "hplot"))
(x <- check_examples(xyplot.docu))
## [1] TRUE
stopifnot(x)
# Character data, or zero arguments
(x <- check_keywords())
##  [1] "IO"            "NA"            "algebra"       "aplot"        
##  [5] "arith"         "array"         "attribute"     "category"     
##  [9] "character"     "chron"         "classes"       "classif"      
## [13] "cluster"       "color"         "complex"       "connection"   
## [17] "data"          "database"      "datagen"       "datasets"     
## [21] "debugging"     "design"        "device"        "distribution" 
## [25] "documentation" "dplot"         "dynamic"       "environment"  
## [29] "error"         "file"          "graphs"        "hplot"        
## [33] "htest"         "interface"     "internal"      "iplot"        
## [37] "iteration"     "list"          "loess"         "logic"        
## [41] "manip"         "math"          "methods"       "misc"         
## [45] "models"        "multivariate"  "neural"        "nonlinear"    
## [49] "nonparametric" "optimize"      "package"       "print"        
## [53] "programming"   "regression"    "robust"        "smooth"       
## [57] "spatial"       "survey"        "survival"      "symbolmath"   
## [61] "sysdata"       "tree"          "ts"            "univar"       
## [65] "utilities"
stopifnot(length(x) > 1, is.character(x), is.null(names(x)))
(x <- check_keywords(c("aplot", "loess")))
##                                  aplot 
## "Add to Existing Plot / internal plot" 
##                                  loess 
##                        "Loess Objects"
stopifnot(length(x) == 2, is.character(x), names(x) == c("aplot", "loess"))