EVOLUTION-MANAGER
Edit File: QC.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: QC Checks for R Code and/or Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for QC {tools}"><tr><td>QC {tools}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>QC Checks for R Code and/or Documentation</h2> <h3>Description</h3> <p>Functions for performing various quality control (QC) checks on R code and documentation, notably on R packages. </p> <h3>Usage</h3> <pre> checkDocFiles(package, dir, lib.loc = NULL) checkDocStyle(package, dir, lib.loc = NULL) checkReplaceFuns(package, dir, lib.loc = NULL) checkS3methods(package, dir, lib.loc = NULL) langElts nonS3methods(package) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>package</code></td> <td> <p>a character string naming an installed package.</p> </td></tr> <tr valign="top"><td><code>dir</code></td> <td> <p>a character string specifying the path to a package's root source directory. This should contain the subdirectories ‘<span class="file">R</span>’ (for R code) and ‘<span class="file">man</span>’ with <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> documentation sources (in Rd format). Only used if <code>package</code> is not given.</p> </td></tr> <tr valign="top"><td><code>lib.loc</code></td> <td> <p>a character vector of directory names of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> libraries, or <code>NULL</code>. The default value of <code>NULL</code> corresponds to all libraries currently known. The specified library trees are used to search for <code>package</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>checkDocFiles</code> checks, for all Rd files in a package, whether all arguments shown in the usage sections of the Rd file are documented in its arguments section. It also reports duplicated entries in the arguments section, and ‘over-documented’ arguments which are given in the arguments section but not in the usage. Note that the match is for the usage section and not a possibly existing synopsis section, as the usage is what gets displayed. </p> <p><code>checkDocStyle</code> investigates how (S3) methods are shown in the usages of the Rd files in a package. It reports the methods shown by their full name rather than using the Rd <code style="white-space: pre;">\method</code> markup for indicating S3 methods. Earlier versions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> also reported about methods shown along with their generic, which typically caused problems for the documentation of the primary argument in the generic and its methods. With <code style="white-space: pre;">\method</code> now being expanded in a way that class information is preserved, joint documentation is no longer necessarily a problem. (The corresponding information is still contained in the object returned by <code>checkDocStyle</code>.) </p> <p><code>checkReplaceFuns</code> checks whether replacement functions or S3/S4 replacement methods in the package R code have their final argument named <code>value</code>. </p> <p><code>checkS3methods</code> checks whether all S3 methods defined in the package R code have all arguments of the corresponding generic, with positional arguments of the generics in the same positions for the method. As an exception, the first argument of a formula method <em>may</em> be called <code>formula</code> even if this is not the name used by the generic. The rules when <code>...</code> is involved are subtle: see the source code. Functions recognized as S3 generics are those with a call to <code>UseMethod</code> in their body, internal S3 generics (see <a href="../../base/html/InternalMethods.html">InternalMethods</a>), and S3 group generics (see <code><a href="../../base/html/groupGeneric.html">Math</a></code>). Possible dispatch under a different name is not taken into account. The generics are sought first in the given package, then in the <span class="pkg">base</span> package and (currently) the packages <span class="pkg">graphics</span>, <span class="pkg">stats</span>, and <span class="pkg">utils</span> added in R 1.9.0 by splitting the former <span class="pkg">base</span>, and, if an installed package is tested, also in the loaded namespaces/packages listed in the package's ‘<span class="file">DESCRIPTION</span>’ Depends field. </p> <p><code>nonS3methods(package)</code> returns a <code><a href="../../base/html/character.html">character</a></code> vector with the names of the functions in <code>package</code> which ‘look’ like S3 methods, but are not. Using <code>package = NULL</code> returns all known examples. </p> <p><code>langElts</code> is a character vector of names of “language elements” of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. These are implemented as “very primitive” functions (no argument list; <code><a href="../../base/html/print.html">print</a>()</code>ing as <code>.Primitive("<name>")</code>). </p> <p>If using an installed package, the checks needing access to all <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects of the package will load the package (unless it is the <span class="pkg">base</span> package), after possibly detaching an already loaded version of the package. </p> <h3>Value</h3> <p>The functions return objects of class the same as the respective function names containing the information about problems detected. There are <code>print</code> methods for nicely displaying the information contained in such objects. </p> <hr /><div style="text-align: center;">[Package <em>tools</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>