[R] unusual name in .Rd file: documenting an infix function
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Mar 5 18:12:28 CET 2004
LaTeX has nothing to do with it: this is Rd format, and you need to read
its description.
Your Rd file has no \alias for your operator. \name is not an alias, and
\name must not contain % or &. Look for example at the file outer.Rd:
you should escape % in \alias and \usage (and I suspect & only in \alias).
On Fri, 5 Mar 2004, Christian Hoffmann wrote:
> Hi
>
> I am having difficulties documenting an infix function:
>
> paste.infix.r
> "%&%" <- function(x,y) { paste(x,y,sep="") }
>
> paste.infix.Rd
> \name{pasteInfix}
>
> # I wanted to write \name{"\%\&\%"} or some variation of it, but &, %
> not allowed in LaTeX, see Guide.
>
> \alias{pasteInfix}
> \title{Paste(infix)}
> \description{
> Paste as infix
> }
> \usage{
> a %&% b # or \%&\%
>
> # this results in:
> * checking Rd files ... OK
> * checking for missing documentation entries ... WARNING
> Undocumented code objects:
> %&%
> All user-level objects in a package should have documentation entries.
> See chapter 'Writing R documentation files' in manual 'Writing R
> Extensions'.
>
> * checking Rd \usage sections ... WARNING
> Objects in \usage without \alias in documentation object 'pasteInfix':
> %&%
> }
> \arguments{
> \item{a}{character (1-dim)}
> \item{b}{character (1-dim)}
> }
> \value{
> The concatenation of \code{a} and \code{b}, same as \code{ paste(a, b,
> sep="") }
> }
> \examples{
> "I am" \%&\% " hungry" # [1] "I am hungry"
> }
> \author{Christian W. Hoffmann, \email{christian.hoffmann at wsl.ch}}
> \keyword{misc}
> \keyword{documentation}
>
>
> Does there exist a solution to this problem?
> Christian
>
--
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
More information about the R-help
mailing list