I'm trying to do a trellis xyplot of the form y~x|z with different plotting
symbols for the levels across a 4th variable. In addition, I would like to
superimpose a smooth in each panel for each level of the 4th variable.
Here are the commands that I have used. There are no missing values for wt,
doy, sex, or country. sex is factor with 2 levels (M and F); country is
factor with 2 levels (US and Ru):
xyplot(wt~doy|sex,groups= country,
data=combwt,
panel=function(x,y,subscripts,...){
panel.superpose(x,y,subscripts,pch=1:2,...)
panel.loess(x,y,subscripts,lty=1:10,...)},
layout=c(1,2),aspect=.6,
xlab="Day of year",ylab="Mass (kg)"
)
I receive the following error message:
Too many values for parameter lty; some ignored
Error in lines: Invalid argument name: groups
This script works if I don't try to do the panel.loess-- but then I don't
get the superimposed smooths. Perhaps panel.loess doesn't like
the groups argument??? Can someone tell me how to use trellis to get the
smooths superimposed?
A long time ago (before Trellis) I wrote an Splus function that does these
chores. However, it doesn't have the capability of reading formulas, using
data frames, subsets, etc.
Anne
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070 USA
e-mail: anne.york@noaa.gov
Voice: +1 206-526-4039
Fax: +1 206-526-6615
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|