[R] trellis plot

Deepayan Sarkar deepayansarkar at yahoo.com
Thu Nov 29 16:42:07 CET 2001



For this particular problem, you can use :


xyplot(series ~ time, data=etable,
       groups = gr,
       panel = "panel.superpose",
       type = c("p", "smooth"),
       span=.15)

A similar example can be found in example(xyplot)
(the second example). Note, however, that this is NOT
S-compatible.

`type' is an argument accepted by panel.xyplot and
panel.superpose, and can be passed as extra arguments
to xyplot, as can be `span'.

Hope that helps.

--- Brad Buchsbaum <bbuchsba at uci.edu> wrote:
> Hi,
> 
> I'd like to plot 4 groups of data using xyplot and
> panel.superpose so
> that the points are overlayed on a single plot.  For
> each group of data
> I'd also like a loess smoothed function (using
> panel.loess).  I have
> tried the following:
> 
> xyplot(series ~ time | gr, data=etable,
>          panel = function(x,y, ...) {
>            panel.superpose(x,y, ...)
>            panel.loess(x,y,span=.15)
> 
>            }
> )
> 
> However, this gives me only a single loess curve
> (collapsed across
> groups) whereas I would like one curve for each
> group (just as I get one
> color for each set of points from the
> panel.superpose).
> 
> Is there a way to accomplish this?
> 
> 
> thanks,
> 
> Brad Buchsbaum
> 
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read
> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To:
> r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

__________________________________________________



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list