# [R] R check passes code and docs that don't match

Ross Boylan ross at biostat.ucsf.edu
Fri Nov 5 20:16:22 CET 2004

I have code and documentation that don't match, but R CMD check didn't
flag it.

in mspath.R
mspath <- function(formula,   # formula with  observed Markov states
~  observation times (required)
qmatrix,    # matrix of 1s and 0s with indices of
allowed transitions (diagonal is ignored) (required)
misc = FALSE,
ematrix = NULL,    # matrix of 1s and 0s with indices of
allowed misclassfications (diagonal is ignored) (required)
inits,      # initial values of optimisation or fixed
values (required)
subject = NULL, # optional, defaults to all the same if
not given
covariates = NULL, # formula specifying covariates on
transition rates.
constraint = NULL, # which intensities have covariates
on them (as in Marshall et al.)
misccovariates = NULL, # formula specifying covariates
on misclassification probs
miscconstraint = NULL, # which misc probs have
covariates on them
qconstraint = NULL, # constraints on equality of
baseline intensities
econstraint = NULL, # constraints on equality of
baseline misc probs
covmatch = "previous",   # take the covariate value from
the previous or next observation
initprobs = NULL,  # initial state occupancy
probabilities
data=list(),       # optional data frame in which to
interpret variable names
fromto = FALSE,
fromstate, #
tostate,   #  data required if fromto is TRUE
timelag,   #
death = FALSE,  # 'death' states, ie, entry time known
exactly, but unknown transient state at previous instant
tunit = 1.0, # no longer used
exacttimes = FALSE,
fixedpars = NULL, # specify which parameters to fix
stepnumerator = 1,  # maximum step size in discrete
approximation
stepdenominator = 1,  # rational number; use integers
do.what = 1, # 1 for likelihood, 0 for counts
... # options to optim
)

in mspath.Rd
\usage{
mspath ( formula, qmatrix, misc = FALSE, ematrix, inits, subject,
covariates = NULL, constraint = NULL, misccovariates = NULL,
miscconstraint = NULL, qconstraint=NULL, econstraint=NULL,
covmatch = "previous", initprobs = NULL,
data = list(), fromto = FALSE, fromstate, tostate, timelag,
death = FALSE, tunit = 1.0, exacttimes = FALSE,
fixedpars = NULL, stepsize=1.0... )
}
with corresponding \item's in the \arguments list.

Among the differences (see the end of the argument lists)
In code by not Rd: stepnumerator, stepdenominator, do.what
In Rd but not code: stepsize

Yet R CMD check says
** help
>>> Building/Updating help pages for package 'mspath'
Formats: text html latex example
mspath                            text    html    latex
print.mspath plot.mspath summary.mspath qmatrix.mspath pmatrix.mspath
sojourn.mspath
* DONE (mspath)

* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking package dependencies ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for syntax errors ... OK
* checking R files for library.dynam ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking Rd files ... OK
* checking for missing documentation entries ... WARNING
Undocumented code objects:
MatrixExp absorbing.mspath coef.mspath crudeinits.mspath deltamethod
ematrix.mspath expit expitsum expsum hazard.mspath lik.mspath logit
mspath.check.consistency mspath.check.ematrix mspath.check.model
mspath.check.qmatrix mspath.check.state mspath.check.times
mspath.form.output mspath.process.covs mspath.results
observed.mspath odds.mspath plot.mspath pmatrix.mspath
pmatrix.piecewise.mspath prevalence.mspath print.mspath
print.summary.mspath qematrix.diagse.formstr qematrix.diagse.mspath
qematrix.mspath qmatrix.mspath qratio.mspath qratio.se.mspath
sojourn.mspath statetable.mspath summary.mspath totlos.mspath
transient.mspath viterbi.mspath
Undocumented data sets:
e2 gold q2
All user-level objects in a package should have documentation entries.
See chapter 'Writing R documentation files' in manual 'Writing R
Extensions'.
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK

Have I misunderstood how this is suppsed to work?  Have the previous
errors confused or voided the code/documentation test?  Is it a bug?

Using R 2.0.0-3 on Debian.
--
Ross Boylan                                      wk:  (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4          ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics           fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840                     hm:  (415) 550-1062