From ripley at stats.ox.ac.uk  Wed Oct  5 18:57:21 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 5 Oct 2005 17:57:21 +0100 (BST)
Subject: [Rd] how do I write Rd file for this?
In-Reply-To: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED4D1@usctmx1106.merck.com>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED4D1@usctmx1106.merck.com>
Message-ID: <Pine.LNX.4.61.0510051750490.23721@gannet.stats>

On Wed, 5 Oct 2005, Liaw, Andy wrote:

> Dear R-devel,
>
> I'm working on Prof. Loader's new version of locfit to try to get it
> pass R CMD check.  I'm almost there, but I have a problem with some Rd
> files that I hope some one can help me resolve.  Here's an example:
>
> In the package there's a function called locfit.censor().  This function
> can be used in a few different ways:
>
> locfit.censor(x, y, cens, ...)
> locfit.censor(formula, ...)

I don't think so (you cannot give named arguments like that?).  What does 
args(locfit.censor) give?

Do you mean that x can be a vector or a formula, and y and cens are 
ignored if x is a formula?  If so that is what you need to say.  E.g.

\usage{
locfit.censor(x, y, cens, \dots)
}
\arguments{
   \item{x}{a vector or a formula ...}
   \item{y, cens}{.... Ignored if \code{x} is a formula.}
   \item{\dots}{....}
}

> locfit(formula, ..., lfproc=locfit.censor)

That's calling another function, locfit,  which presumably you have 
documented elsewhere.

BTW, \synopsis is likely to be deprecated for 2.3.0, so you don't want to 
start using it for new help files now.


> What I did in locfit.censor.Rd is have something like:
>
> \synopsis{
> locfit.censor(x, y, cens, ..., iter=3, km=FALSE)
> }
> \usage{
> locfit(formula, cens=cens, lfproc=locfit.censor)
> locfit.censor(formula, cens, ..., iter=3, km=FALSE)
> }
>
> However, R CMD check gives me:
>
> Undocumented arguments in documentation object 'locfit.censor'
>  formula lfproc
> Documented arguments not in \usage in documentation object
> 'locfit.censor':
>  x y
> Objects in \usage without \alias in documentation object
> 'locfit.censor':
>  locfit
>
> Can some one tell me what would be the preferred way of fixing this?

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] how do I write Rd file for this?
Prof Brian Ripley