codoc                  package:base                  R Documentation

_C_h_e_c_k _C_o_d_e/_D_o_c_u_m_e_n_t_a_t_i_o_n _C_o_n_s_i_s_t_e_n_c_y

_D_e_s_c_r_i_p_t_i_o_n:

     Find inconsistencies between actual and documented usage of R
     function objects in a package, by comparing names and optionally
     also corresponding positions and default values of the arguments
     of the functions.

_U_s_a_g_e:

     codoc(dir, use.values = FALSE, use.positions = TRUE,
           ignore.generic.functions = FALSE,
           keep.tempfiles = FALSE,
           verbose = getOption("verbose"))

_A_r_g_u_m_e_n_t_s:

     dir: a character string specifying the path to a package's root
          source directory.  This must contain the subdirectories `man'
          with R documentation sources (in Rd format) and `R' with R
          code.

use.positions: a logical indicating whether to use the positions of
          function arguments when comparing.

use.values: a logical indicating whether to use function default values
          when comparing code and docs.

ignore.generic.functions: if `TRUE', functions the body of which
          contains `"UseMethod"' are ignored.

keep.tempfiles: if `TRUE', keep temporary code and docs files used for
          comparison.  This is useful for debugging.

 verbose: a logical.  If `TRUE', additional diagnostics are printed.

_D_e_t_a_i_l_s:

     The purpose of this function is to check whether the documented
     usage of function objects agrees with their formal arguments as
     defined in the R code.  This is not always straightforward, in
     particular as the usage information for methods to generic
     functions typically employs the name of the generic rather than
     the method.

     The following algorithm is used.  The R code of the package is
     sourced in a new environment.  Then, the usage sections of the Rd
     files are extracted and manipulated in order to give function
     stubs corresponding to the indicated usage, which are then sourced
     in another new environment.  For interpreted functions in both the
     code and docs environment, the formals are compared according to
     the values of the arguments `use.positions' and `use.values'.

     Currently, synopsis sections are used, but multiple usage examples
     (such as in `abline') are not combined when building the stubs.

_V_a_l_u_e:

     A list the names of which are the names of the functions where an
     inconsistency was found.  The elements of the list are lists of
     length 2 with elements `code' and `docs', giving the corresponding
     arguments obtained from the function's code and documented usage.

_S_e_e _A_l_s_o:

     `undoc'

