Hello, I have a graphical problem: I would like to change the labeling of the levels of the conditioning factor in the plot below. Here, the labeling is done automatically by the xyplot command (a cursor indicates the three levels and the name of the variable is written out). Instead, I would like to have a specific character string on each strip. The command to generate the plot was very simple: xyplot(Resin~Pt|Weather,data=sharout,panel.function=panel.smooth). I tried to define a new strip function as well as modifying default variables using strip.custom, but I could not get it to work. Could somebody explain it to me? Thank you very much! Marion -------------- next part -------------- A non-text attachment was scrubbed... Name: xyplot1.pdf Type: application/pdf Size: 153732 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091113/0c9e1bbf/attachment-0002.pdf>
The first step is to make Weather a factor. Then the levels would be displayed in the strip labels. The second step would be to change the level values to the actual strings you want to see.> tmp <- data.frame(Weather=1:3, x=rnorm(3), y=rnorm(3)) > xyplot(y ~ x | Weather, data=tmp) > tmp$Weather <- factor(tmp$Weather) > xyplot(y ~ x | Weather, data=tmp) > levels(tmp$Weather) <- c("long string", "longer string", "short") > xyplot(y ~ x | Weather, data=tmp) > xyplot(y ~ x | Weather, data=tmp, layout=c(3,1))