Rev 681 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
postscript("temp.ps")library(lattice)## dotplot labels problemxx <- 1:10names(xx) <- rep(letters[1:5], 2)dotplot(xx)## missing levels of factors## drop unused levelsx <- 1:100y <- rnorm(100)g <- gl(4, 25, 100)xyplot(y ~ x | g)xyplot(y ~ x | g, subset = g != "2")xyplot(y ~ x | g, subset = g != "2",panel = function(x, y, subscripts) {print(subscripts)ltext(x, y, lab = subscripts)})## subset & subscript interactionx <- rnorm(50)y <- rnorm(50)subset <- 20:40xyplot(y ~ x,panel = function(x, y, subscripts) {print(subscripts)ltext(x, y, lab = subscripts)})## gives subscripts = 20:40xyplot(y ~ x, subset = subset,panel = function(x, y, subscripts) {print(subscripts)ltext(x, y, lab = subscripts)})g <- gl(2,1,50)xyplot(y ~ x, groups = g, panel = panel.superpose)xyplot(y ~ x, groups = g, panel = panel.superpose, subset = subset)## reordering testsdata(iris)iris$foo <- equal.count(iris$Sepal.Length)foo <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris)foofoo$subset.cond <- list(1:3, 1:6)foo$perm.cond <- 1:2foofoo$perm.cond <- 2:1foo$subset.cond <- list(c(1,2,3,1), 2:4)foobar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T))barbar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T), scales = "free")bar## other stuffx <- numeric(0)y <- numeric(0)bwplot(y ~ x) # fails? FIXMEx <- c(rnorm(10), rep(NA, 10))y <- gl(1, 20)a <- gl(2, 10)bwplot(x ~ y | a)## warning: why ?bwplot(x ~ y | a * a)## example from Wolfram Fischermy.barley <- subset( barley, ! ( site == "Grand Rapids" & year == "1932" ) )dotplot(variety ~ yield | year * site, my.barley,layout=c(6,2), between=list(x=c(0,6)))dotplot(variety ~ yield | year * site, data = my.barley,layout=c(6,2),scales =list(rot = 0,y =list(relation='sliced',at = rep( list( FALSE, NULL ), 6 ))),par.settings =list(layout.widths = list(axis.panel = rep(c(1, 0), 3))))dev.off()