repair_S4_docu: Repair S4 documentation in Rd files

Description Usage Arguments Details Value See Also Examples

View source: R/rd.R

Description

Repair S4 documentation in Rd files by adding docType, usage, and alias entries.

Usage

1
2
3
4
5
  repair_S4_docu(x, ...)

  ## S3 method for class 'character'
 repair_S4_docu(x, ...,
    ignore = NULL)

Arguments

x

Character vector of names of input files, or names of R package directories. The latter will be expanded as appropriate. x is passed to pkg_files with the ‘installed’ argument set to FALSE. See there for further details.

...

Optional arguments, currently passed as args arguments to run_ruby. See there for details. The sole exception is an sargs argument, which is a character vector of options passed to the Ruby script. See below.

ignore

NULL or character vector with names of R code files to ignore. Passed to pkg_files, see there for details of how names are matched.

Details

This reparation process is currently implemented in a Ruby script that comes with the package. It is automatically found in the installation directory but fails if a suitable version of Ruby, i.e. ≥ 1.9.0, is unavailable. See run_ruby for further details.

This function is intended for augmenting Rd documentation generated by roxygen2, as long as it does not fully support S4. In addition to the generation of missing documentation entries, repair_S4_docu can also recognise S4 methods generated within a loop provided a specific annotation is used. An example is given below.

Another annotation can be used for redirecting the generated entries from one Rd file to another one. The file extension and the directory path would be added automatically. See the examples.

Value

Currently the return value of the call to run_ruby.

See Also

Other rd-functions: check_examples, check_keywords, repair_docu,

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
## this is an example for the redirection of Rd file names:
#= dim length
## i.e., text that would be sent to 'dim.Rd' would now instead be written
## to 'length.Rd'

## here is an example for automatically generated S4 methods from the opm
## package:
## Not run: 
  lapply(c(
    #+
    wells,
    plate_type
    #-
  ), FUN = function(func_) {
    setMethod(func_, OPMS, function(object, ...) {
      func_(plates(object)[[1L]], ...)
    }, sealed = SEALED)
  })

## End(Not run)
## method names between '#+' and '#-' were collected and their usage
## generated from the subsequent setMethod() call invoking a 'func_'
## variable.

## See also the 'docu.R' script provided with the pkgutils package, option
## '--s4methods'.

pkgutils documentation built on May 2, 2019, 5:49 p.m.