From mtmorgan at fhcrc.org  Fri Sep 28 21:39:52 2012
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Fri, 28 Sep 2012 12:39:52 -0700
Subject: [Rd] S4method
In-Reply-To: <OFA3B703F8.D1968544-ON86257A87.0067672B-86257A87.00682F19@usgs.gov>
References: <CAP01uRn1EdG0cGyzoDPwmSaK2wiUWQ3mrOY3GrjMOT2qeSCXjQ@mail.gmail.com>	<CAErODj_0BLVxjTZ7tM6FKnJGhrwWOeMJ+ivQLV9srBb2JveKoQ@mail.gmail.com>
	<CAP01uRmxzLbuTbLJLEQnLkA6DB+AWhDb7qwthjpf7VuGUHrOGg@mail.gmail.com>
	<OFA3B703F8.D1968544-ON86257A87.0067672B-86257A87.00682F19@usgs.gov>
Message-ID: <5065FD08.8090305@fhcrc.org>

On 09/28/2012 11:57 AM, David L Lorenz wrote:
> I get an error when I try to use \S4method in a usage section in an Rd
> file for a function. I tried to duplicate exactly how stats4 documents its
> method functions, but I must be missing something. Here is the top part of
> the Rd file:
>
> \name{xyPlot-methods}
> \docType{methods}
> \alias{xyPlot-methods}
> \alias{xyPlot,numeric,numeric-method}
> \title{Methods for Function \code{xyPlot}}
> \description{
> Create a line or scatter plot.
> }
> \usage{
> \S4method{xyPlot}{numeric, numeric}(x, y,
> Plot = list(name = "", what = "lines", type = "solid", width = "standard",
>
>   symbol = "circle", filled = TRUE, size = 0.09, color = "black"),
> yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA),
> xaxis.log = FALSE, xaxis.range = c(NA, NA), ylabels = 7, xlabels = 7,
> xtitle = deparse(substitute(x)), ytitle = deparse(substitute(y)),
> caption = "", margin = c(NA, NA, NA, NA))
> }
>
>    The error I get is
>
> Bad \usage lines found in documentation object 'xyPlot-methods':
>    <unescaped bksl>S4method{xyPlot}{numeric, numeric}(x, y,

Hi David - R is being picky about spaces; use {numeric,numeric}. Martin

>    Plot = list(name = "", what = "lines", type = "solid", width =
> "standard",
>     symbol = "circle", filled = TRUE, size = 0.09, color = "black"),
>    yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA),
>    xaxis.log = FALSE, xaxis.range = c(NA, NA), ylabels = 7, xlabels = 7,
>    xtitle = deparse(substitute(x)), ytitle = deparse(substitute(y)),
>    caption = "", margin = c(NA, NA, NA, NA))
>
>    Here's my R info:
>
> R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
> Copyright (C) 2012 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: x86_64-pc-mingw32/x64 (64-bit)
>
>    The error is treated as a WARNING, so I can build and install the
> package and the documentation file looks fine when I ask for help on
> xyPlot-methods. What am I missing?
>    Thanks.
> Dave
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



[Rd] S4method
Martin Morgan