Dear All:
In the following code which I modified from previous question, in addition
to show the fact1 level names (y, b, r) in strips, I also want to have a
color bar to indicate the state of every panel (in this example, y
correspods to 1, and b, r correspond to 0). Does anyone have a quick
solution?
Thanks
df <- expand.grid("fact1"=c("y","b","r"),
"fact2"=c"far","por","lis","set"), "year"=1991:2000, "value"= NA)
df[,"value"] <- sample(1:50, 120, replace=TRUE)
df$state <- 0
df$state[df$fact1=="y"] <- 1
require("lattice")
xyplot( value ~ year | fact1, data=df, type="b", subset= fact2=="far",
strip = strip.custom(bg=gray.colors(1,0.95),
factor.levels=c("yellow", "black", "red")), layout=c(1,3))
_________________________________________________________________
Share your special moments by uploading 500 photos per month to Windows Live
Spaces
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.