Re: [R] Question with lattice xyplot

From: Deepayan Sarkar <deepayan_at_stat.wisc.edu>
Date: Wed 23 Mar 2005 - 04:01:02 EST

On Tuesday 22 March 2005 10:26, Ghosh, Sandeep wrote:
> Hi All,
>
> I have a quick question and any help is greatly appreciated. For the
> following data when I try to produce the image using xyplot function
> in lattice package, the key has 4 rows instead of 2. Can anyone tell
> me what I'm doing wrong and what is the way to fix the problem. Here
> the code that I'm running

Your key is not formatted correctly. In particular, the first component of key$points is (1) not named and (2) itself a list of length 4. Since it's not named, it's not contributing anything to the key itself, but the length of 4 confuses draw.key into thinking that the points component should have 4 rows.

Deepayan

> print(xyplot(foldChange ~ timeInterval, data=studyData, type='b',
> groups = treatment, pch=1:treatmentCount,
> key = list(points = list(Rows(trellis.par.get("superpose.line"),
> c(1:treatmentCount)), col=Rows(trellis.par.get("superpose.line"),
> c(1:treatmentCount))$col, pch = 1:treatmentCount, type='b'), cex =
> trellis.par.get("superpose.symbol")$cex[1:treatmentCount], text =
> list(lab = as.character(unique(studyData$treatment))), columns = 1,
> border=TRUE,
> space="top"),
> ylab="Relative Change(1=12.50%tile)",
> xlab="Time Interval (hour)"));
>
> Thanks,
> Sandeep.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 23 04:05:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:53 EST