Try this

Rich


tmp <- data.frame(
y=rnorm(100),
category=rep(factor(letters[1:5]),each=20),
level=rep(factor(0:1), length=100))
tmp
table(tmp[,2:3])
tmp$y[with(tmp, category=="a" & level=0)] <- NA
tmp$y[with(tmp, category=="a" & level==0)] <- NA
tmp$y[with(tmp, category=="e" & level==1)] <- NA
tmp$y[78:80] <- NA
tmp[!is.na(tmp$y),]
tmp2 <- tmp[!is.na(tmp$y),]
table(tmp2[2:3])

bwplot(y ~ category | level, data=tmp2)
bwplot(y ~ category | level, data=tmp2, layout=c(1,2))

bwplot(y ~ level | category, data=tmp2, layout=c(5,1))
bwplot(y ~ level | category, data=tmp2, layout=c(5,1))

______________________________________________
R-help@r-project.org 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.

Reply via email to