lattice/0000755000176200001440000000000014773255122011707 5ustar liggesuserslattice/tests/0000755000176200001440000000000014772502714013052 5ustar liggesuserslattice/tests/dataframe-methods.R0000644000176200001440000000252614772502714016567 0ustar liggesuserspdf("dataframe-methods.pdf") library(lattice) mtcars <- within(mtcars, am <- factor(am, levels = c(0, 1), labels = c("automatic", "manual"))) stripplot(mtcars, am ~ mpg) stripplot(mtcars, gear ~ mpg | am, jitter.data = TRUE, grid = TRUE) bwplot(mtcars, am ~ mpg) qq(mtcars, am ~ mpg) qqmath(mtcars, ~ mpg | am) histogram(mtcars, ~ mpg | am) densityplot(mtcars, ~ mpg | am) xyplot(mtcars, mpg ~ wt, groups = am) cloud(mtcars, mpg ~ wt * disp | am) splom(mtcars[3:7]) parallelplot(mtcars[3:7]) tmd(mtcars, mpg ~ wt) ct.tab <- as.data.frame.table(xtabs(~ cyl + am, mtcars)) barchart(ct.tab, cyl ~ Freq, groups = am) dotplot(ct.tab, cyl ~ Freq, groups = am, auto.key = TRUE) dotplot(x = mtcars, data = gear ~ mpg, groups = am, auto.key = TRUE) dotplot(mtcars, formula = gear ~ mpg, col = 1) g <- expand.grid(a = seq(-1, 1, length.out = 101), b = seq(-1, 1, length.out = 101), KEEP.OUT.ATTRS = FALSE) g <- within(g, { z <- sinh(complex(real = 2 * pi* a, imaginary = 2 * pi * b)) arg <- Arg(z) mod <- Mod(z) re <- Re(z) im <- Im(z) }) levelplot(g, arg ~ a * b) contourplot(g, re ~ a * b) wireframe(g, im ~ a * b, shade = TRUE) ## check for handling of missing argumnets dotplot(mtcars, , formula = gear ~ mpg, col = 1) dotplot(mtcars, formula = gear ~ mpg, , col = 1) lattice/tests/shade-wireframe.R0000644000176200001440000000144614413027417016237 0ustar liggesusers library(lattice) pdf("shade-wireframe.pdf") classicShadePalette <- function(irr, ref, height, saturation = .9) { hsv(h = height, s = 1 - saturation * (1 - (1-ref)^0.5), v = irr) } trellis.par.set(shade.colors = list(palette = classicShadePalette)) wireframe(volcano, shade = TRUE) ## Using makeShadePalette() ## matte cm.palette <- makeShadePalette(cm.colors(10), pref = 0.2) trellis.par.set(shade.colors = list(palette = cm.palette)) wireframe(volcano, shade = TRUE) ## glossy cm.palette <- makeShadePalette(cm.colors(10), pref = 1.2) trellis.par.set(shade.colors = list(palette = cm.palette)) wireframe(volcano, shade = TRUE) ygb.palette <- makeShadePalette(rev(hcl.colors(12, "YlGnBu"))) trellis.par.set(shade.colors = list(palette = ygb.palette)) wireframe(volcano, shade = TRUE) dev.off() lattice/tests/wireframe.R0000644000176200001440000000564414413027456015164 0ustar liggesusers library(lattice) pdf("wireframe.pdf") data(volcano) foo <- data.frame(z = as.vector(volcano), x = rep(1:87, 61), y = rep(1:61, each = 87)) wireframe(z ~ x * y, foo) ## this used to give an error, but seems fine now (?) wireframe(z ~ x * y, foo, subset = z > 150) ## Example 1 (a). valgrind shows warnings, starting with ## ==9058== Invalid read of size 8 ## ==9058== at 0xA450AFF: wireframePanelCalculations (threeDplot.c:291) ## and subsequently in various other places in that function leading to ## ==9058== Conditional jump or move depends on uninitialised value(s) ## ==9058== at 0x3FFAA466CF: __printf_fp (in /lib64/libc-2.4.so) ## ==9058== by 0x3FFAA423AE: vfprintf (in /lib64/libc-2.4.so) ## ==9058== by 0x3FFAA4A477: fprintf (in /lib64/libc-2.4.so) ## ==9058== by 0x94975BE: PostScriptRLineTo (devPS.c:2683) ## A bit more tracing shows it is accessing element 4016 in an array of ## length 2456, and the plot seems nonsense (and random) when viewed on ## screen. (BDR, 2006/09/17) ## DS's earlier comment: what's this supposed to do ? weird thing is, ## result is random (probably indicator of memory access errors) if (FALSE) { wireframe(z + I(z + 100) ~ x * y, foo, subset = z > 150, scales = list(arrows = FALSE)) } ## this works as expected wireframe(z + I(z + 100) ~ x * y, foo) ## Example 1 (b). Another way of seeing the problem: ## this is OK: bar <- foo bar$z[bar$z < 150] <- NA wireframe(z + I(z + 100) ~ x * y, bar, scales = list(arrows = FALSE)) ## but this is not if (FALSE) { wireframe(z + I(z + 100) ~ x * y, subset(bar, !is.na(z)), scales = list(arrows = FALSE)) } ## Example 2. Probably another example of the same "bug": see ## https://stat.ethz.ch/pipermail/r-devel/2005-September/034544.html n <- 20 psteps <- 50 binomtable <- function(n, psteps) { x <- (0:(10*n))/10 p <- (0:psteps)/psteps dd <- expand.grid(x=x,p=p) dd$F <- pbinom(dd$x,n,dd$p) dd$x0 <-trunc(dd$x) dd } bt <- binomtable(n = 5, psteps = 100) bt[bt$x - bt$x0 >= 0.9, ]$F <- NA if (FALSE) { ## this is problematic wireframe(F ~ x * p, bt, groups = bt$x0, shade = TRUE, scales = list(arrows = FALSE)) } ## this one OK wireframe(F ~ x * p, bt, shade = TRUE, scales = list(arrows = FALSE)) ## this too wireframe(F ~ x * p | factor(x0), bt, ## groups = bt$x0, shade = TRUE, scales = list(arrows = FALSE)) ## Working hypothesis: the problem crops up when there are groups ## (specified either directly or through the formula interface) AND x ## and y values for each group don't represent the full evaluation ## grid. The second condition is a bit unclear. In example 2, each ## group's support is disjoint from that of the others. In example 1, ## both groups have the same support, they are just not the full grid. dev.off() lattice/tests/temp.R0000644000176200001440000000426614772502714014152 0ustar liggesusers postscript("temp.ps") library(lattice) ## dotplot labels problem xx <- 1:10 names(xx) <- rep(letters[1:5], 2) dotplot(xx) ## missing levels of factors ## drop unused levels x <- 1:100 y <- 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, labels = subscripts) }) ## subset & subscript interaction x <- rnorm(50) y <- rnorm(50) subset <- 20:40 xyplot(y ~ x, panel = function(x, y, subscripts) { print(subscripts) ltext(x, y, labels = subscripts) }) ## gives subscripts = 20:40 xyplot(y ~ x, subset = subset, panel = function(x, y, subscripts) { print(subscripts) ltext(x, y, labels = 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 tests data(iris) iris$foo <- equal.count(iris$Sepal.Length) foo <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris) foo foo$subset.cond <- list(1:3, 1:6) foo$perm.cond <- 1:2 foo foo$perm.cond <- 2:1 foo$subset.cond <- list(c(1,2,3,1), 2:4) foo bar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T)) bar bar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T), scales = "free") bar ## other stuff x <- numeric(0) y <- numeric(0) bwplot(y ~ x) # fails? FIXME x <- 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 Fischer my.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() lattice/tests/call.R0000644000176200001440000001004514772502714014110 0ustar liggesuserslibrary(lattice) ## Background: https://stat.ethz.ch/pipermail/r-devel/2017-May/074245.html ## For a long time, lattice has used the following construct to add a ## $call component to the final "trellis" object produced: ## obj$call <- sys.call(sys.parent()); obj$call[[1]] <- quote(xyplot) ## But this doesn't work in all contexts, especially when using ## with(). From lattice_0.21, this has been changed to use sys.call(), ## but it is important to have this done in EVERY method. ## The following code tests this by checking the call component in ## every high-level method defined in lattice. g <- data.frame(x = runif(10), y = runif(10), g10 = gl(10, 1), g2 = gl(2, 5)) test.objects <- with(g, list(barchart.formula = barchart(g10 ~ x | g2, subset = g10 != "1"), barchart.array = barchart(unclass(Titanic)), barchart.default = barchart(g2), barchart.matrix = barchart(VADeaths), barchart.numeric = barchart(x), barchart.table = barchart(UCBAdmissions), bwplot.formula = bwplot(g2 ~ x + y, outer = TRUE), bwplot.numeric = bwplot(y, notch = TRUE), densityplot.formula = densityplot(~ x, groups = g2), densityplot.numeric = densityplot(y, plot.points = "jitter"), dotplot.formula = dotplot(g10 ~ x | g2), dotplot.array = dotplot(unclass(Titanic)), dotplot.default = dotplot(g2), dotplot.matrix = dotplot(VADeaths), dotplot.numeric = dotplot(x), dotplot.table = dotplot(UCBAdmissions), histogram.formula = histogram(~ c(x, y)), histogram.factor = histogram(g2), histogram.numeric = histogram(c(x, y)), qqmath.formula = qqmath(~ x + y), qqmath.numeric = qqmath(x), stripplot.formula = stripplot(g2 ~ x + y, outer = TRUE), stripplot.numeric = stripplot(y, jitter.data = TRUE), qq.formula = qq(g2 ~ x), xyplot.formula = xyplot(y ~ x), xyplot.ts = xyplot(ts(x)), levelplot.formula = levelplot(y ~ g2 + g10), levelplot.table = levelplot(UCBAdmissions), levelplot.array = levelplot(unclass(Titanic)), levelplot.matrix = levelplot(VADeaths), contourplot.formula = contourplot(y ~ g2 + g10), contourplot.table = contourplot(UCBAdmissions), contourplot.array = contourplot(unclass(Titanic)), contourplot.matrix = contourplot(VADeaths), cloud.formula = cloud(g10 ~ x + y), cloud.matrix = cloud(VADeaths), cloud.table = cloud(UCBAdmissions), wireframe.formula = wireframe(y ~ g2 + g10), wireframe.matrix = wireframe(VADeaths), splom.formula = splom(~cbind(x = x, y = y, g = as.numeric(g2))), splom.matrix = splom(cbind(x = x, y = y, g = as.numeric(g2))), splom.data.frame = splom(data.frame(x, y, g2)), parallelplot.formula = parallelplot(~iris), parallelplot.matrix = parallelplot(data.matrix(iris[1:4])), parallelplot.data.frame = parallelplot(iris), rfs = rfs(oneway(y ~ g2)), tmd.formula = tmd(sort(y) ~ sort(x)), tmd.trellis = tmd(xyplot(sort(y) ~ sort(x))), update.trellis = update(xyplot(y ~ x), pch = 16, cex = 1.5))) ## sanity check (some examples without with()) test.objects$xyplot <- xyplot(y ~ x | g2, data = g, cex = c(1, 2)) test.objects$densityplot <- densityplot(g$x, plot.points = FALSE) test.objects$shingle <- plot(equal.count(rnorm(1000))) for (m in names(test.objects)) cat(sprintf("%25s : %s\n", m, paste(deparse(test.objects[[m]]$call), collapse = ""))) pdf("test-call.pdf") for (m in names(test.objects)) { lab <- paste(deparse(test.objects[[m]]$call), collapse = "") print(update(test.objects[[m]], page = function(n) panel.text(0.5, 1, labels = lab, pos = 1))) } dev.off() lattice/tests/MASSch04.R0000644000176200001440000001253514772502714014425 0ustar liggesusers#-*- R -*- ## Script from Fourth Edition of `Modern Applied Statistics with S' # Chapter 4 Graphical Output library(MASS) library(lattice) trellis.device(postscript, file="MASS-ch04.ps", width=8, height=6, pointsize=9) options(echo=T, width=65, digits=5) # 4.2 Basic plotting functions topo.loess <- loess(z ~ x * y, topo, degree = 2, span = 0.25) topo.mar <- list(x = seq(0, 6.5, 0.2), y=seq(0, 6.5, 0.2)) topo.lo <- predict(topo.loess, expand.grid(topo.mar)) topo.lo1 <- cbind(expand.grid(x=topo.mar$x, y=topo.mar$y), z=as.vector(topo.lo)) contourplot(z ~ x * y, topo.lo1, aspect = 1, at = seq(700, 1000, 25), xlab = "", ylab = "", panel = function(x, y, subscripts, ...) { panel.levelplot(x, y, subscripts, ...) panel.xyplot(topo$x, topo$y, cex = 0.5) } ) # 4.5 Trellis graphics xyplot(time ~ dist, data = hills, panel = function(x, y, ...) { panel.xyplot(x, y, ...) panel.lmline(x, y, type = "l") panel.abline(lqs(y ~ x), lty = 3) # identify(x, y, row.names(hills)) } ) bwplot(Expt ~ Speed, data = michelson, ylab = "Experiment No.", main = "Speed of Light Data") data(swiss) splom(~ swiss, aspect = "fill", panel = function(x, y, ...) { panel.xyplot(x, y, ...); panel.loess(x, y, ...) } ) sps <- trellis.par.get("superpose.symbol") sps$pch <- 1:7 trellis.par.set("superpose.symbol", sps) xyplot(Time ~ Viscosity, data = stormer, groups = Wt, panel = panel.superpose, type = "b", key = list(columns = 3, text = list(paste(c("Weight: ", "", ""), unique(stormer$Wt), "gms")), points = Rows(sps, 1:3) ) ) rm(sps) topo.plt <- expand.grid(topo.mar) topo.plt$pred <- as.vector(predict(topo.loess, topo.plt)) levelplot(pred ~ x * y, topo.plt, aspect = 1, at = seq(690, 960, 10), xlab = "", ylab = "", panel = function(x, y, subscripts, ...) { panel.levelplot(x, y, subscripts, ...) panel.xyplot(topo$x,topo$y, cex = 0.5, col = 1) } ) ## if (F) { wireframe(pred ~ x * y, topo.plt, aspect = c(1, 0.5), drape = T, screen = list(z = -150, x = -60), colorkey = list(space="right", height=0.6)) ## } lcrabs.pc <- predict(princomp(log(crabs[,4:8]))) crabs.grp <- c("B", "b", "O", "o")[rep(1:4, each = 50)] splom(~ lcrabs.pc[, 1:3], groups = crabs.grp, panel = panel.superpose, key = list(text = list(c("Blue male", "Blue female", "Orange Male", "Orange female")), points = Rows(trellis.par.get("superpose.symbol"), 1:4), columns = 4) ) sex <- crabs$sex levels(sex) <- c("Female", "Male") sp <- crabs$sp levels(sp) <- c("Blue", "Orange") splom(~ lcrabs.pc[, 1:3] | sp*sex, cex = 0.5, pscales = 0) Quine <- quine levels(Quine$Eth) <- c("Aboriginal", "Non-aboriginal") levels(Quine$Sex) <- c("Female", "Male") levels(Quine$Age) <- c("primary", "first form", "second form", "third form") levels(Quine$Lrn) <- c("Average learner", "Slow learner") bwplot(Age ~ Days | Sex*Lrn*Eth, data = Quine) bwplot(Age ~ Days | Sex*Lrn*Eth, data = Quine, layout = c(4, 2), strip = function(...) strip.default(..., style = 1)) stripplot(Age ~ Days | Sex*Lrn*Eth, data = Quine, jitter.data = TRUE, layout = c(4, 2)) stripplot(Age ~ Days | Eth*Sex, data = Quine, groups = Lrn, jitter.data = TRUE, panel = function(x, y, subscripts, jitter.data = F, ...) { if(jitter.data) y <- jitter(as.numeric(y)) panel.superpose(x, y, subscripts, ...) }, xlab = "Days of absence", between = list(y = 1), par.strip.text = list(cex = 0.7), key = list(columns = 2, text = list(levels(Quine$Lrn)), points = Rows(trellis.par.get("superpose.symbol"), 1:2) ), strip = function(...) strip.default(..., strip.names = c(TRUE, TRUE), style = 1) ) fgl0 <- fgl[ ,-10] # omit type. fgl.df <- data.frame(type = rep(fgl$type, 9), y = as.vector(as.matrix(fgl0)), meas = factor(rep(1:9, each = 214), labels = names(fgl0))) stripplot(type ~ y | meas, data = fgl.df, scales = list(x = "free"), xlab = "", cex = 0.5, strip = function(...) strip.default(style = 1, ...)) if(F) { # no data supplied xyplot(ratio ~ scant | subject, data = A5, xlab = "scan interval (years)", ylab = "ventricle/brain volume normalized to 1 at start", subscripts = TRUE, ID = A5$ID, strip = function(factor, ...) strip.default(..., factor.levels = labs, style = 1), layout = c(8, 5, 1), skip = c(rep(FALSE, 37), rep(TRUE, 1), rep(FALSE, 1)), panel = function(x, y, subscripts, ID) { panel.xyplot(x, y, type = "b", cex = 0.5) which <- unique(ID[subscripts]) panel.xyplot(c(0, 1.5), pr3[names(pr3) == which], type = "l", lty = 3) if(which == 303 || which == 341) points(1.4, 1.3) }) } Cath <- equal.count(swiss$Catholic, number = 6, overlap = 0.25) xyplot(Fertility ~ Education | Cath, data = swiss, span = 1, layout = c(6, 1), aspect = 1, panel = function(x, y, span) { panel.xyplot(x, y); panel.loess(x, y, span) } ) Cath2 <- equal.count(swiss$Catholic, number = 2, overlap = 0) Agr <- equal.count(swiss$Agriculture, number = 3, overlap = 0.25) xyplot(Fertility ~ Education | Agr * Cath2, data = swiss, span = 1, aspect = "xy", panel = function(x, y, span) { panel.xyplot(x, y); panel.loess(x, y, span) } ) Cath levels(Cath) plot(Cath, aspect = 0.3) # End of ch04 lattice/tests/dates.R0000644000176200001440000000070113070415115014257 0ustar liggesusers postscript("date.ps") library(lattice) ## POSIXt handling y <- Sys.time() + 10000 * 1:100 x <- rnorm(100) b <- gl(3,1,100) xyplot(y ~ x | b) xyplot(y ~ x | b, scales = list(relation = "free", rot = 0)) xyplot(y ~ x | b, scales = "sliced") ## Date handling dat <- data.frame(a = 1:10, b = seq(as.Date("2003/1/1"), as.Date("2003/1/10"), by="day")) xyplot(a~b, dat) xyplot(a~b, dat, scales=list(x=list(at=dat$b))) dev.off() lattice/tests/levelplot.R0000644000176200001440000001013114576465132015203 0ustar liggesusers pdf("levelplot.pdf") library(lattice) data(volcano) foo <- data.frame(z = as.vector(volcano), x = rep(log1p(1:87), 61), y = rep(1:61, each = 87)) system.time(print(levelplot(z ~ x * y, foo, contour = TRUE))) system.time(print(levelplot(z ~ x * y, foo, contour = TRUE, panel = panel.levelplot.raster))) system.time(print(levelplot(z ~ x * y, foo, contour = TRUE, region.type = "contour"))) levelplot(z ~ x * y, subset(foo, z > 150), contour = T) ## region.type = "contour" does not support missing grid points suppressWarnings(plot(levelplot(z ~ x * y, subset(foo, z > 150), contour = T, main = "Expect error", region.type = "contour"))) levelplot(z ~ x * y, foo, subset = z > 150, contour = T) contourplot(z ~ x * y, foo, subset = z > 150, cuts = 10) ## manual colorkey labels levelplot(z ~ x * y, foo, subset = z > 150, colorkey = list(labels = list(at = c(145, 150), labels = c("below min", 150)))) ## lattice <= 0.21-5 put the "below min" label at z=150 ## This should be an error because 'labels' are specified without 'at': e <- try(print(levelplot(z ~ x * y, foo, subset = z > 150, colorkey = list(labels = list(labels = c("A", "B"))))), silent = TRUE) stopifnot(inherits(e, "try-error")) ## subset group interaction has problems (does it any longer?): cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = 0.8, groups = Species, subpanel = panel.superpose, main = "With subset", screen = list(z = 20, x = -70, y = 0), subset = 30:60) cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris[30:60, ], cex = 0.8, groups = Species, subpanel = panel.superpose, main = "Without subset", screen = list(z = 20, x = -70, y = 0)) levelplot(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, groups = Species, subset = 30:60) cloud(z ~ x * y, foo) cloud(z ~ x * y, foo, subset = z > 150) ## long format: NA's clipped at the beginning (??) splom(~iris[,1:4], iris, groups = Species) splom(~iris[,1:4], iris, groups = Species, subset = 70:130, auto.key = T) parallelplot(~iris[,1:4] | Species, iris, subset = 30:130) ## NA-s in matrix volna <- volcano volna[20:40, 20:40] <- NA levelplot(volna) levelplot(volna, region.type = "contour") cloud(volna) wireframe(volna) dev.off() # grid.newpage() # pushViewport(viewport()) # grid.lines(x = c(1:5, NA, 7:10) / 10, # y = c(1:5, NA, 7:10) / 10) # grid.points(x = c(1:5, NA, 7:10) / 10, # y = c(1:5, 6, 7:10) / 10) # grid.points(x = .5, y = .1, pch = 16, gp = gpar(cex = 1)) # grid.points(x = .5, y = .2, pch = 16, gp = gpar(cex = 3)) # grid.points(x = .5, y = .3, pch = '+', gp = gpar(cex = 1)) # grid.points(x = .5, y = .4, pch = '+', gp = gpar(cex = 3)) # viewport[ROOT] -> # (viewport[GRIDVP1182]-> # (viewport[GRIDVP1185], # viewport[GRIDVP1187], # viewport[GRIDVP1189], # viewport[GRIDVP1190], # viewport[panel.1]-> # (viewport[GRIDVP1184]-> # (viewport[subpanel.1.1], # viewport[subpanel.1.2], viewport[subpanel.1.3], # viewport[subpanel.2.1], viewport[subpanel.2.2], # viewport[subpanel.2.3], viewport[subpanel.3.1], # viewport[subpanel.3.2], viewport[subpanel.3.3])), # viewport[panel.2]-> # (viewport[GRIDVP1186]-> # (viewport[subpanel.1.1], # viewport[subpanel.1.2], viewport[subpanel.1.3], # viewport[subpanel.2.1], viewport[subpanel.2.2], # viewport[subpanel.2.3], viewport[subpanel.3.1], # viewport[subpanel.3.2], viewport[subpanel.3.3])), # viewport[panel.3]-> # (viewport[GRIDVP1188]-> # (viewport[subpanel.1.1], # viewport[subpanel.1.2], viewport[subpanel.1.3], # viewport[subpanel.2.1], viewport[subpanel.2.2], # viewport[subpanel.2.3], viewport[subpanel.3.1], # viewport[subpanel.3.2], viewport[subpanel.3.3])))) lattice/tests/fontsize.R0000644000176200001440000000057714413027273015041 0ustar liggesuserslibrary(lattice) pdf("fontsize.pdf", pointsize = 5) splom(iris, sub = "pdf:fontsize = 5") trellis.par.set(grid.pars = list(fontsize = 5)) splom(iris, sub = "grid.pars:fontsize = 5") trellis.par.set(grid.pars = list(fontsize = 10)) splom(iris, sub = "grid.pars:fontsize = 10") trellis.par.set(fontsize = list(text = 15)) splom(iris, sub = "grid.pars:fontsize = 15") dev.off() lattice/tests/test.R0000644000176200001440000000714614772502714014164 0ustar liggesuserspostscript("test.ps") library(lattice) lattice.options(default.args = list(page = function(n) { grid::grid.text(label = paste(deparse(trellis.last.object()$call, width.cutoff = 150L), collapse = "\n"), x = 0.01, y = 0.99, just = c("left", "top")) })) densityplot(~ 5) densityplot(~ 1:5 | letters[1:5]) x <- rnorm(200) y <- rnorm(200) z <- equal.count(rnorm(200)) a <- factor(rep_len(1:3, 200)) df.test <- list(xx = x+1-min(x), yy = y, zz = z, aa = a) xyplot(y ~ x | z * a, strip = function(...) strip.default(..., style = 4), par.strip.text = list(cex = 2, col = "blue", font = 2), ##scales = list(x = list(draw = FALSE), y = "sliced")) scales = list(x = list(rot = 0), y = list(rot = 0))) xyplot(a ~ x | z, main = "xyplot call with modified options", lattice.options = list(panel.xyplot = "panel.bwplot", default.args = list(between = list(x = 1, y = 1)))) bwplot(zz ~ xx | aa, df.test) bwplot(aa ~ xx | zz, df.test, scales = list(x = list(log = "e", tck = 5, rot = 90, cex = 2), y = list(col = "red", tck = 3, alternating = TRUE, cex = 5, rot = 0), tick.number = 20), main = list("main", cex = 5), sub = list("sub", cex = 5), xlab = list("xlab", cex = 5), ylab = list("ylab", cex = 5)) bwplot(~zz , df.test) bwplot(~xx , df.test) dotplot(zz ~ xx | aa, df.test) dotplot(aa ~ xx | zz, df.test) dotplot(~zz , df.test) dotplot(~xx , df.test) stripplot(zz ~ xx | aa, df.test) stripplot(aa ~ xx | zz, df.test) stripplot(~zz , df.test) stripplot(~xx , df.test) xa <- 1:8 xb <- rep( c( NA, 10 ), 4 ) xc <- rep( c( 'C2', 'C1' ), 4 ) xyplot( xa ~ xb | xc) xyplot( xa ~ xb | xc, scales = "free") xc <- rep( c( 'C1', 'C2' ), 4 ) xyplot( xa ~ xb | xc) xyplot( xa ~ xb | xc, scales = "free") x = sample(1:3, 100, replace=TRUE) histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='count') histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='density') ## splom pscales data(iris) iris2 <- iris[,1:4] splom(iris2, groups = iris$Species, pscales = 10) splom(iris2, groups = iris$Species, pscales = list(list(at = 6, lab = "six"), list(at = 3), list(at = 4), list(at = 1))) splom(iris2, groups = iris$Species, pscales = list(list(at = 6, lab = "six", lim = c(-10, 10)), list(at = 3), list(at = 4), list(lim = c(-5, 5)))) ## factors in formula data(barley) levelplot(yield ~ year * variety | site, barley, panel = function(x, y, ...) { x <- as.numeric(x) y <- as.numeric(y) panel.levelplot(x, y, ...) }) data(volcano) levelplot(volcano, key = list(x = .5, y = .5, points = list(col = 1:3)), legend = list(top = list(fun = grid::textGrob("This \nis \na \nstupid \nlegend")))) ## demo of seekViewport library(grid) splom(~iris[1:3]|Species, data = iris, layout=c(2,2), pscales = 0, varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"), page = function(...) { ltext(x = seq(.6, .8, length.out = 4), y = seq(.9, .6, length.out = 4), labels = c("Three", "Varieties", "of", "Iris"), cex = 2) }, par.settings = list(clip = list(panel = FALSE))) seekViewport(vpPath(trellis.vpname("panel", 1, 1), "pairs", "subpanel.2.3")) grid.yaxis(main = TRUE) seekViewport(vpPath(trellis.vpname("panel", 2, 1), "pairs", "subpanel.2.1")) grid.yaxis(main = FALSE) seekViewport(vpPath(trellis.vpname("panel", 1, 2), "pairs", "subpanel.2.2")) grid.yaxis(main = FALSE) demo("lattice") dev.off() lattice/tests/dotplotscoping.R0000644000176200001440000000031213070415115016225 0ustar liggesuserspostscript("dotplotscoping.ps") library(lattice) fubar <- function() { k <- 2 kkk <- 1:10 names(kkk) <- 1:10 data = list(x=kkk) dotplot(~x^k + rnorm(10), data) } fubar() dev.off() lattice/tests/colorkey-title.R0000644000176200001440000000215113657202215016134 0ustar liggesuserspostscript("colorkey-title.ps") library(lattice) levelplot(volcano) # no title levelplot(volcano, colorkey = list(title = "Height", space = "bottom")) levelplot(volcano, colorkey = list(title = "Height", space = "top")) # ?? levelplot(volcano, colorkey = list(title = "Height", space = "left")) # ?? levelplot(volcano, colorkey = list(title = "Height", space = "right")) levelplot(volcano, colorkey = list(space = "bottom", title = list(label = "Height", rot = 0, y = 1, vjust = 0), title.control = list(side = "left", padding = 0.5))) levelplot(volcano, colorkey = list(space = "right", title = list(label = "Height", cex = 1, x = 0, hjust = 0), title.control = list(side = "top"))) require(grid) f <- frameGrob(layout = grid.layout(heights = unit(0, "mm"))) f <- placeGrob(f, textGrob("Height", x = 0, y = 1, hjust = 0, vjust = -0.5)) levelplot(volcano, colorkey = list(space = "right", title = f, title.control = list(side = "top", padding = 0))) dev.off() lattice/tests/summary.R0000644000176200001440000000452013657201524014667 0ustar liggesusers library(lattice) ## Output of summary() methods d <- list(x = 1:10, y = 1:10, g = gl(2, 5)) summary(barchart(factor(y) ~ x, d)) # S3method(barchart, formula) summary(barchart(unclass(Titanic))) # S3method(barchart, array) # S3method(barchart, default) summary(barchart(VADeaths)) # S3method(barchart, matrix) summary(barchart(precip)) # S3method(barchart, numeric) summary(barchart(Titanic)) # S3method(barchart, table) summary(bwplot(g ~ x, d)) # S3method(bwplot, formula) summary(bwplot(precip)) # S3method(bwplot, numeric) summary(densityplot( ~ x | g, d)) # S3method(densityplot, formula) summary(densityplot(precip)) # S3method(densityplot, numeric) summary(dotplot(factor(y) ~ x, d)) # S3method(dotplot, formula) summary(dotplot(unclass(Titanic))) # S3method(dotplot, array) # S3method(dotplot, default) summary(dotplot(VADeaths)) # S3method(dotplot, matrix) summary(dotplot(precip)) # S3method(dotplot, numeric) summary(dotplot(Titanic)) # S3method(dotplot, table) ## S3method(histogram, formula) ## S3method(histogram, factor) ## S3method(histogram, numeric) ## S3method(qqmath, formula) ## S3method(qqmath, numeric) ## S3method(stripplot, formula) ## S3method(stripplot, numeric) ## S3method(qq, formula) summary(xyplot(y ~ x | g, data = d)) # S3method(xyplot, formula) summary(with(d, xyplot(y ~ x | g))) # S3method(xyplot, formula) summary(xyplot(sunspot.year)) # S3method(xyplot, ts) ## S3method(levelplot, formula) ## S3method(levelplot, table) ## S3method(levelplot, array) ## S3method(levelplot, matrix) ## S3method(contourplot, formula) ## S3method(contourplot, table) ## S3method(contourplot, array) ## S3method(contourplot, matrix) ## S3method(cloud, formula) ## S3method(cloud, matrix) ## S3method(cloud, table) ## S3method(wireframe, formula) ## S3method(wireframe, matrix) ## S3method(splom, formula) ## S3method(splom, matrix) ## S3method(splom, data.frame) ## S3method(parallelplot, formula) ## S3method(parallelplot, matrix) ## S3method(parallelplot, data.frame) lattice/tests/barchart-width.R0000644000176200001440000000136414413027104016067 0ustar liggesusers ## Allow custom widths for barcharts? Currently allowed (without NSE), ## but could be improved. pdf("barchart-width.pdf") library(lattice) x <- 1:10 names(x) <- sample(LETTERS, 10) barchart(x, origin = 0) barchart(x, origin = 0, box.width = runif(5)) barchart(x, origin = 0, box.width = runif(5), horizontal = FALSE) d <- within(expand.grid(a = gl(4, 1), b = gl(10, 1)), { x <- rexp(40) w <- 0.8 * runif(40) }) barchart(b ~ x | a, data = d, origin = 0, box.width = d$w) barchart(b ~ x | a, data = d, origin = 0, box.width = d$w[1:10]) barchart(b ~ x, data = d, groups = a, box.width = d$w) barchart(b ~ x, data = d, groups = a, stack = TRUE, box.width = d$w) barchart(x ~ b, data = d, groups = a, stack = TRUE, box.width = d$w) dev.off() lattice/tests/scales.R0000644000176200001440000001650214772502714014453 0ustar liggesusers postscript("scales.ps") ## Testing weird scales options library(lattice) ## relation = "free" for factors dat <- data.frame(a=letters[1:5], b=c("A","A","A","B","B"), y=1:5) dotplot(y ~ a | b, data=dat, scales = "same") dotplot(y ~ a | b, data=dat, scales = "free") dotplot(y ~ a | b, data=dat, scales = "sliced") dat <- data.frame(a = letters[1:10], b = c("A","A","A","B","B","A","B","B", "A", "A")) dat <- dat[sample(1:10, 200, replace = TRUE), ] dat$y <- rnorm(200, mean = unclass(as.factor(dat$a))) bwplot(a ~ y | b, data=dat, scales = "same") bwplot(a ~ y | b, data=dat, scales = "free") bwplot(a ~ y | b, data=dat, scales = "sliced") ## text axis colors xyplot(1:10 ~ 1:10, scales = list(y = list(font = 2, cex = 1, col = "green", col.line = "cyan", tck = 5)), xlab = list("one to ten", fontfamily = "HersheySerif"), par.settings = list(axis.text = list(col = "red", font = 4, cex = 3), axis.line = list(col = "yellow"))) x <- rnorm(100) y <- 2 + 3 * runif(100) a <- gl(3, 1, 100) xyplot(y ~ x | a) xyplot(y ~ x | a, scales = list(axs = "i")) xyplot(y ~ x | a, xlim = c(-5, 5), scales = list(limits = c(-6, 6))) xyplot(y ~ x | a, xlim = c(-5, 5), ylim = letters[1:5]) ## Should produce an error cat(try(print(xyplot(y ~ x | a, scales = list(x = list( relation = "same", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) )))), silent = TRUE)) xyplot(y ~ x | a, scales = list(x = list( relation = "free", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) ## Should produce an error cat(try(print(xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "same", axs = "i")))), silent = TRUE)) xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "free", axs = "i"))) xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "sliced", axs = "i"))) xyplot(y ~ x | a, scales = list(x = list( relation = "free" ))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = c(-5, 5)))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = c(-3, 3, 0)))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), FALSE ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", rot = 45, limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], month.name[1:5] )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced" ))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced" , axs = "i" ))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = c(-5, 5)))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = c(-3, 3, 0)))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), FALSE ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", rot = 45, limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), labels = list( as.character(c(0, 5, -5)) , letters[5:7], month.name[1:5] )))) xyplot(y ~ x | a, scales = list(x = list( relation = "free", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 )))) xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 )))) ## should produce an error cat(try(print(xyplot(y ~ x | a, scales = list(y = list( relation = "same", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ))))), silent = TRUE)) ## problem stripplot(rep(1:20, 5) ~ x | a, scales = list(relation = "free", col = "transparent")) dev.off() lattice/tests/auto-key.R0000644000176200001440000000270514413027040014721 0ustar liggesusers library(lattice) pdf("auto-key.pdf", width = 10, height = 7) d <- data.frame(x = rnorm(100), y = rnorm(100), a = gl(2, 50), b = gl(7, 1, 50)) xyplot(y ~ x | a, data = d, groups = b, type = "p", auto.key = TRUE) xyplot(y ~ x | a, data = d, groups = b, type = "l", auto.key = TRUE) xyplot(y ~ x | a, data = d, groups = b, type = "o", auto.key = TRUE) cloud(y ~ x + a, data = d, groups = b, type = "b", auto.key = TRUE) splom(~ data.frame(x, y, z = x + y) | a, data = d, groups = b, type = "b", auto.key = TRUE) densityplot(~ x, data = d, groups = b, auto.key = TRUE) histogram(~ x, data = d, groups = b, auto.key = TRUE) qqmath( ~ x | a, data = d, groups = b, type = "o", auto.key = TRUE) barchart(xtabs(x ~ a + b, data = d), auto.key = TRUE) ## not-default placements xyplot(y ~ x | a, data = d, groups = b, type = "o", auto.key = list(space = "left", columns = 2)) xyplot(y ~ x | a, data = d, groups = b, type = "o", auto.key = list(columns = 3)) p1 <- xyplot(y ~ x | a, data = d, groups = b, type = "o", par.settings = simpleTheme(pch = 16)) p2 <- dotplot(xtabs(x ~ b + a, data = d), par.settings = simpleTheme(pch = 16)) p3 <- barchart(xtabs(x ~ b + a, data = d), par.settings = simpleTheme(pch = 16)) p1 update(p1, auto.key = list(columns = 3)) p2 update(p2, auto.key = list(columns = 2)) p3 update(p3, auto.key = list(columns = 2)) dev.off() lattice/MD50000644000176200001440000001761014773255122012224 0ustar liggesuserse95aaa0cfaeae98778a8abe01fb8df92 *ChangeLog 7eb51d7f85e96abac3ee95e9f0b97656 *DESCRIPTION eb723b61539feef013de476e68b5c50a *GPL-2 d32239bcb673463ab874e80d47fae504 *GPL-3 82da699a39ddc36665f053c7482a1da6 *LICENSE.note 7495858ad04e1b942f435db04111e0a2 *NAMESPACE 1a0b3b8bbf133dac8eef0c784f991ae6 *NEWS.md 6c0d9b5a91e685639aab277071fce5b0 *R/axis.R ae668e3204f220ebaae1fb70bec3f27b *R/bwplot.R cd8d650a2ec83c332bb78450e53ffd93 *R/cloud.R 61951b849dc60405014d91484b17f361 *R/common.R da5e52712f89d8dde198a6b3f988977b *R/dataframe-methods.R b55224a5062e2616e38630e9542748bf *R/densityplot.R 344b1fdf4e5cc660c669b6c330c180b1 *R/histogram.R 4b1e3f09aa9e3e23b572a943733690fa *R/imports.R 72825ce7987ad5dedef1e061549d2c95 *R/interaction.R a1bb3d47582f131df93dc252a0e70621 *R/layout.R 7d6a527f319c2c30b7de9ac89eda8759 *R/legend.R 06e99657ff1884e1989c7b20708281d8 *R/levelplot.R aec90deb3db94f65c3f0977d69339995 *R/make.groups.R 7b29b67df55a1769ef76d2f3b9d8720e *R/miscellaneous.R 448c1c26d3b587a76c58836df8b2e666 *R/panel.smooth.R c360f892ca1c0b2a20c45e2cdd5df57c *R/panel.smoothscatter.R 00bb2409a0113a793a29ebe017e20d81 *R/panel.superpose.R 3f81623211bd62b9e1b67510ba11c017 *R/panels.R 831ab42af5e18d993881ae463fe91be7 *R/parallel.R e11725a18854de0ae31de6f609674ad0 *R/print.trellis.R 53dda0ef336cf9921ac2d4c94ad7aecb *R/qq.R ba62cd24bc2d417d4f1f40d6bb5d623b *R/qqmath.R bcf2022d27241a1c5e14fa9fb2244169 *R/rfs.R 11d54fd77425f5d6785587c8f42bcbaa *R/scales.R 51e562ee87167f7c4136f7cf7efc29fd *R/settings.R e166fa0e56cdf53ff35d0d027c720f57 *R/shingle.R 5838c8c9f9ddf52ab493c555104f43b7 *R/splom.R ec462e00ed4ed6f06ef6c3d7415d3137 *R/strip.R f5c8c7178bb827879815060218696269 *R/summary.trellis.R 063f6ec3636fb8cb99cc92ec4f47a27c *R/tmd.R fb30c4a0b56823c0fb4880c80c07b9ad *R/update.trellis.R e01635c1f910a96f2fb50d63fbd715f4 *R/xyplot.R 9e27ffc3e64a0b8c165ccf8bae85effa *R/xyplot.ts.R 7dab32f13ada41b4296f2d68615dbb73 *R/zzz.R 192acbf5df95765d57bbba3c898668d9 *README.md 49b44d926504bdbc68e780772337a9b8 *build/vignette.rds 765ee6e3bc3240ac18845b75292db266 *data/USMortality.rda 839fa6a8802e12e50eee0cc823833dc3 *data/USRegionalMortality.rda 5c131dc8879c365d29a061f52f378e79 *data/barley.rda 7adba139660ed9fb45aaa7ad57d3e4b9 *data/environmental.rda 901676b6e12765e9a8b71d5b5c9e816b *data/ethanol.rda eda0b902176da9b77e909af894719e89 *data/melanoma.rda 81e2bda00d637deea7b890488bb2b6b3 *data/singer.rda 5b19b9d9c6ceea57bbd416fd55f4cbbb *demo/00Index 49b53be0f5cfbc31fdf2d1028ab66b01 *demo/intervals.R 9ec1d932fca442660b60818b0be9c0f3 *demo/labels.R aeb8a42c24baed6f0918691449a49681 *demo/lattice.R f5e96e30c746b6c4e1dc57d13218b9e7 *demo/panel.R f320410deb7000e178c2511dc230d4e8 *inst/CITATION ef9e47d4ac451c27026d87a50188d4ba *inst/doc/grid.R 8a20458a8a55c1bfe485e95472a6fbda *inst/doc/grid.Rnw 40ea9f67bed51b9469b1658d5335d244 *inst/doc/grid.pdf 3b921d21cf96136668af284a860978c9 *inst/po/de/LC_MESSAGES/R-lattice.mo a216e44ce3054520fb9e94f963cf7825 *inst/po/en@quot/LC_MESSAGES/R-lattice.mo c1ac665c6f52d285a3687870a97376de *inst/po/fr/LC_MESSAGES/R-lattice.mo 1750d938bd426713d022e4d97bea78c2 *inst/po/it/LC_MESSAGES/R-lattice.mo 1cef4f9ea9b499945200a7d562f53a29 *inst/po/ko/LC_MESSAGES/R-lattice.mo d82d08bf160cde0c737ea7133ecd8810 *inst/po/pl/LC_MESSAGES/R-lattice.mo a0814a0c5c6bf3f099ff3752a75a8b54 *man/Lattice.Rd 40f3906db75059b7b0c73f544e5bd671 *man/Rows.Rd 79c4842bffe44e37f6c574bf9ed30537 *man/USMortality.Rd abff15820149230efbbf7dc291d16dbb *man/axis.default.Rd d32fef9c6d91a0f11bfbbf748e285688 *man/banking.Rd 5a8fe5da32d284aa737ab5bb68672b46 *man/barchart.table.Rd 50a56d80344353513a894f655ca399df *man/barley.Rd 0730386835acb2bb8f738d06bd28faba *man/cloud.Rd f6a751cbfdf703528448c7fa341a61d7 *man/draw.colorkey.Rd 7a9f48a2dd425c447df410a2a8403f16 *man/draw.key.Rd 23d5aa6ada174889c7ad6998304c67e1 *man/environmental.Rd a3e4f7d1058aaf090a9855859bdb05fa *man/ethanol.Rd 15acce2b4abddf21311d26cde587449b *man/histogram.Rd 36639924a81841f411a0413d5ace3146 *man/interaction.Rd 441617b0c3441c2343e1186ea56a4155 *man/lattice.options.Rd 7852ba42b1bed6da21746fde616c5043 *man/latticeParseFormula.Rd b0997911c42d1540b37af3e0fbe48617 *man/level.colors.Rd add5c9970c02fb6cc64afe7d0f833548 *man/levelplot.Rd d1432fb068214960f959b1a12f50e7c9 *man/llines.Rd 637c4d16ebc7d78a3d198bb02f94bc30 *man/lset.Rd 6daec9a9f39ed0fe486f929e66b5957f *man/make.groups.Rd 5e89fce7ef15b4ab47d0f720c9d41120 *man/melanoma.Rd a8738eee6c1c65628bf83b8202b18489 *man/oneway.Rd 44e4c575f0412e87fd81e6cd43e8f274 *man/packet.panel.default.Rd 2b4dc3cf2fd4956d684507e3461fec9a *man/panel.axis.Rd ad572c902c1a8f150869a3545d3c5ef8 *man/panel.barchart.Rd 3502ac7cf2616d1244b812c7f032941a *man/panel.bwplot.Rd acf7719e35673f072c7f4ad76557b4c1 *man/panel.cloud.Rd c748ad690cbf3b462de28c97379a7ab5 *man/panel.densityplot.Rd 2d505aa06a5b6497ba137103d9d55dfb *man/panel.dotplot.Rd b6341cef78907a10aed915ead962705b *man/panel.functions.Rd 33c161933e0244b34d759135c89d48e9 *man/panel.histogram.Rd 231718b6f399b761f78a05d97a35d01a *man/panel.levelplot.Rd ee3d36a61d0f15ce54a121a092551882 *man/panel.loess.Rd 3c2625a2c55b6e4c81b6edb147772585 *man/panel.number.Rd d703dd78f99c97b4f67f870866c7726e *man/panel.pairs.Rd 2b8ee171e54ec9c5c1e3d081987d2692 *man/panel.parallel.Rd 9c2e5de40b02248dc031e1583dafd217 *man/panel.qqmath.Rd 305b47447420e35545366145464d132b *man/panel.qqmathline.Rd bb9381fb0d60cc72276a1b8e5c9ddf30 *man/panel.smoothScatter.Rd 937f13a18fc84a224726faa3c54b868d *man/panel.spline.Rd d8e942a568f0c7f83c60f848268978a7 *man/panel.stripplot.Rd 94fca14eb7304344632a3840603497e1 *man/panel.superpose.Rd bbf84d8515419329cd509f0ab22d2d75 *man/panel.violin.Rd 8015b8ef0f35c61314e0452d442012e5 *man/panel.xyplot.Rd a365bf5225608b07982762e60f06f022 *man/prepanel.default.Rd 4e5ceaaae8286bd7d9062867f1739c72 *man/prepanel.functions.Rd e4080822d8415ba849846c83974a6bcb *man/print.trellis.Rd 91ea2322f55d7b0cd7a4dc495806ab86 *man/qq.Rd dcf1266e90f8369b52dc3ca0d8737998 *man/qqmath.Rd 946cab8bd5b934fad8f76842b1ffb8d9 *man/rfs.Rd e0e4bc6a77446eb9ef035efe2a61c11a *man/shingles.Rd a564aef967083acd8efec4425a726163 *man/simpleKey.Rd 82a810dbc2af10045ef67c8ab08f5039 *man/simpleTheme.Rd dd982978d3c59e6e4885670297b16c06 *man/singer.Rd b07ea7d8737c6c5b332b238ab6c394bd *man/splom.Rd 9d74429f9363a8ead9a074346909540e *man/standard.theme.Rd d1c1ec8933b2ecb035a9f7f15a7295e6 *man/strip.default.Rd 5ac6c4f369aa182bb3703ea5dab485d6 *man/tmd.Rd 1a8ad980a4f560f6007461f3f9ee481e *man/trellis.device.Rd ac5a0b9ec9158bacc9eebc737f61c215 *man/trellis.object.Rd 26d29e8a65c86102f4cfaf91ee0e8cb2 *man/trellis.par.get.Rd ce115caa3b4039ee31736e6944b6215e *man/update.trellis.Rd bb1565a3c0f5f1e253adb38c25a05505 *man/utilities.3d.Rd 40769ca7d51d0ba6ed3b0e6d32abc4bf *man/xyplot.Rd 61bc7d9f2cec3ca64a4f4c413fd31fef *man/xyplot.ts.Rd 0413903250306f4bc91db05971e4219b *po/R-de.po 19b7800f842842f1eb3c2812a4cb0b2c *po/R-fr.po 8782a2ff46aa4edd5342db666e84b8fb *po/R-it.po 8355aa9ca0e944cb11777137164fefb9 *po/R-ko.po eddedc3ce0a7ec0926da846a60a333c4 *po/R-lattice.pot 31037c3aba1f2b56b0655b9ed3cb563d *po/R-pl.po e92972db59c6aa30de492fc63d8a332f *src/init.c 918025909f36306797291250b5360243 *src/threeDplot.c f52b692774cf58f83a86a2269b8f699d *src/threeDplot.h 3215d438038ab5f792483b1f8164c779 *tests/MASSch04.R dd87430e0d1697b449065e29f3e1c04f *tests/auto-key.R 557096c2fd1742da9e1126ef24c07043 *tests/barchart-width.R 393c6f3c5a7ca5199f052635d95c6160 *tests/call.R 93051b5a89784dd6811b4f401f301f27 *tests/colorkey-title.R 0a026bd1310a25b498714a96f4373d8a *tests/dataframe-methods.R f4d056454690daa11fa91ecb5373a70c *tests/dates.R 88c9963a80692f6d0f4a99a43582c868 *tests/dotplotscoping.R 8512f69fae17b460624b0e1bef71c79b *tests/fontsize.R b9c92a212a7608bcf9e47936abde87bb *tests/levelplot.R 048eb903f459bb6b0390f65eb2f39deb *tests/scales.R 30f4ceb0a152e04d9014b9cc4206da84 *tests/shade-wireframe.R e6902eeea9846c7ffe44e1fd1d70b590 *tests/summary.R aff935fb10fcb2fcf7bd81af6f0ed9f1 *tests/temp.R b66e862fcd0e79ccab8e057f721386a8 *tests/test.R 90bcdce9c08f601fc2d2af32772c0902 *tests/wireframe.R 8a20458a8a55c1bfe485e95472a6fbda *vignettes/grid.Rnw lattice/po/0000755000176200001440000000000014772676012012331 5ustar liggesuserslattice/po/R-fr.po0000644000176200001440000003624014772676012013504 0ustar liggesusers# Translation of R-lattice.pot to French # Copyright (C) 2007 The R Foundation # This file is distributed under the same license as the lattice R package. # Philippe Grosjean , 2006. # msgid "" msgstr "" "Project-Id-Version: lattice 0.13-1\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: 2021-02-06 16:15+0100\n" "Last-Translator: Philippe Grosjean \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 2.4.2\n" msgid "Invalid value of 'log'" msgstr "Valeur incorrecte pour 'log'" msgid "'at' missing or incompatible with 'labels'" msgstr "'at' manquant ou incompatible avec 'labels'" msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" msgid "range too small for min.n" msgstr "étendue trop étroite pour min.n" msgid "'origin' forced to 0 for stacked bars" msgstr "'origin' forcé à 0 pour les diagrammes en barre empilées" msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "" msgid "" "%s must be length 1 or a vector of \n" " length multiple of group length (%d)" msgstr "" msgid "," msgstr "," msgid "explicit 'data' specification ignored" msgstr "spécification explicite de 'data' ignorée" msgid "mismatch in number of packets" msgstr "incohérence dans le nombre de paquets" msgid "'type' has unsupported values" msgstr "argument 'type' contient des valeurs non autorisées" msgid "Inappropriate arguments" msgstr "Arguments inadaptés" msgid "shingles can not be concatenated" msgstr "les lattes ('shingles') ne peuvent être concaténées" msgid "model must be a formula object" msgstr "l'argument 'model' doit être un objet formule" msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "'multiple = TRUE' est ignoré ('groups' non nuls avec 'outer = FALSE')" msgid "invalid dimension '%s'" msgstr "dimension '%s' incorrecte" msgid "invalid model" msgstr "model incorrect" msgid "newFactor cannot be NULL; you have found a bug!" msgstr "'newFactor' ne peut être NULL ; vous avez trouvé une anomalie !" msgid "" "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "" "'newFactor != NULL && groups == NULL' est impossible ; vous trouvé une " "anomalie !" msgid "Length check mismatch; you have found a bug!" msgstr "" "Incohérence lors de la vérification de la longueur ; vous avez trouvé une " "anomalie !" msgid "Non matching lengths" msgstr "Longueurs incohérentes" msgid "'length' and 'prop' cannot both be specified" msgstr "'length' et 'prop' ne peuvent être spécifiés simultanément" msgid "'length' must be positive" msgstr "'length' doit être positif" msgid "improper length of 'lim'" msgstr "taille incorrecte de 'lim'" msgid "Invalid value of perm.cond" msgstr "Valeur de 'perm.cond' incorrecte" msgid "Invalid value of index.cond" msgstr "Valeur de 'index.cond' incorrecte" msgid "skip cannot be all TRUE" msgstr "les valeurs de 'skip' ne peuvent pas toutes être 'TRUE'" msgid "layout must have at least 2 elements" msgstr "'layout' doit avoir au moins 2 éléments" msgid "Inadmissible value of layout." msgstr "Valeur erronée pour layout." msgid "invalid value for layout" msgstr "valeur incorrecte pour 'layout'" msgid "More pages in layout than seem to be necessary." msgstr "La mise en page contient plus de pages qu'il ne semble nécessaire." msgid "a formula must be specified for the 'data.frame' method" msgstr "" #, fuzzy msgid "'formula' must be a formula object" msgstr "l'argument 'model' doit être un objet formule" msgid "Density" msgstr "Densité" msgid "Can't have log Y-scale" msgstr "L'axe Y ne peut avoir une échelle logarithmique" msgid "type='%s' can be misleading in this context" msgstr "type='%s' peut être ambigü dans ce contexte" msgid "problem with 'hist' computations" msgstr "calcul d'histogramme défectueux" msgid "Count" msgstr "Dénombrements" msgid "Percent of Total" msgstr "Pourcentage du total" msgid "no observations within" msgstr "aucune observation dans" msgid "points" msgstr "points" msgid "nearest observation already identified" msgstr "le point le plus proche est déjà identifié" msgid "column must be specified" msgstr "'column' doit être spécifié" msgid "row must be specified" msgstr "'row' doit être spécifié" msgid "panel position unspecified or invalid" msgstr "la position du panneau n'est pas spécifiée ou est incorrecte" msgid "" "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use " "'trellis.focus' first" msgstr "" "'trellis.switchFocus' ne peut être utilisé pour basculer vers un 'prefix' " "différent. Utilisez 'trellis.focus' en premier lieu" msgid "Plot object was not saved, cannot retrieve panel data" msgstr "" "Le graphe actuel n'a pas été sauvegardé, impossible de restaurer les données " "des panneaux" msgid "Plot spans multiple pages, only last page can be updated" msgstr "" "Le graphe s'étend sur plusieurs pages, seule la dernière peut être mise à " "jour" msgid "You have to first select a panel using trellis.focus()" msgstr "Vous devez d'abord sélectionner un panneau à l'aide de trellis.focus()" msgid "Selecting panel at position (%g, %g)" msgstr "Sélection du panneau à la position (%g, %g)" msgid "No panels available" msgstr "Aucun panneau disponible" msgid "Click on panel to focus" msgstr "Cliquez sur un panneau pour le rendre actif" msgid "'f.value' not supported; ignoring" msgstr "'f.value' non supporté ; valeur ignorée" msgid "Click to choose one point to highlight" msgstr "Cliquez pour sélectionner un point à mettre en évidence" msgid "no points within" msgstr "aucun point dans" msgid "points of click" msgstr "points cliqués" msgid "component '%s' duplicated in key and legend" msgstr "la composante '%s' est redondante dans 'key' et 'legend'" msgid "key must be a list" msgstr "'key' doit être une liste" msgid "first component of text must be vector of labels" msgstr "la première composante de 'text' doit être un vecteur d'étiquettes" msgid "" "Invalid key, need at least one component named lines, text, rect or points" msgstr "" "'key' incorrecte, besoin d'une composante au moins parmi 'lines', 'text', " "'rect' ou 'points'" msgid "not enough rows for columns" msgstr "trop peu de lignes pour le nombre de colonnes" msgid "Sorry, align=FALSE is not supported" msgstr "Désolé, 'align=FALSE' n'est pas disponible" msgid "'at' values are not equispaced; output may be wrong" msgstr "" "les valeurs 'at' ne sont pas équidistantes ; le résultat peut être erroné" msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" msgid "malformed colorkey" msgstr "'colorkey' inadéquat" msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "Valeur de 'tri.upper/tri.lower' incorrecte et ignorée." msgid "Invalid 'shrink' parameter ignored" msgstr "Paramètre 'shrink' incorrect et ignoré" msgid "Invalid label.style" msgstr "'label.style' incorrect" msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" "impossible de déterminer si le périphérique supporte les images raster, " "'raster=TRUE' est ignoré" msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "" "le périphérique ne supporte pas les images raster, 'raster=TRUE' est ignoré" msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "" "le périphérique ne supporte pas les images raster qui contiennent des NA, " "'raster=TRUE' est ignoré" msgid "'x' values are not equispaced; output may be wrong" msgstr "" "les valeurs de 'x' ne sont pas équidistantes ; le résultat peut être " "incorrect" msgid "'y' values are not equispaced; output may be wrong" msgstr "" "les valeurs de 'y' ne sont pas équidistantes ; le résultat peut être " "incorrect" msgid "x must be (coercible to be) a factor" msgstr "" "'x' doit être un facteur (ou doit être convertible automatiquement en " "facteur)" msgid "error" msgstr "erreur" msgid "Invalid value of 'pos' ignored." msgstr "Valeur de 'pos' incorrecte et ignorée." msgid "(loaded the KernSmooth namespace)" msgstr "(espace de noms KernSmooth chargé)" msgid "" "panel.smoothScatter() requires the KernSmooth package, but unable to load " "KernSmooth namespace" msgstr "" "panel.smoothScatter() nécessite le paquet KernSmooth, mais impossible de " "charger l'espace de noms de ce paquet" msgid "'nbin' must be numeric of length 1 or 2" msgstr "'nbin' doit être un vecteur numérique de longueur 1 ou 2" msgid "'bandwidth' must be numeric" msgstr "'bandwidth' doit être numérique" msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "'nrpoints' doit être un scalaire numérique >= 0." msgid "'a' is overridden by 'reg'" msgstr "'a' est remplacé par 'reg'" msgid "only using the first two of %d regression coefficients" msgstr "" "utilisation seulement des deux premiers coefficients de régression parmi les " "%d" msgid "'a' and 'b' are overridden by 'coef'" msgstr "'a' et 'b' sont remplacés par les valeurs de 'coef'" msgid "'expr' must be a function or an expression containing 'x'" msgstr "'expr' doit être une fonction ou une expression contenant 'x'" msgid "'varnames' has wrong length." msgstr "'varnames' a une longueur incorrecte." msgid "Parallel Coordinate Plot" msgstr "Graphique en coordonnées parallèles" msgid "cannot have log y-scale" msgstr "axe Y logarithmique impossible" msgid "" "Error using packet %g\n" "%s" msgstr "" "Erreur lors de l'utilisation du paquet %g\n" "%s" msgid "y must have exactly 2 levels" msgstr "'y' doit avoir exactement 2 niveaux" msgid "Can't have log X-scale" msgstr "Axe X logarithmique impossible" msgid "Fitted Values minus Mean" msgstr "Valeurs ajustées moins la moyenne" msgid "Residuals" msgstr "Résidus" msgid "Invalid or ambiguous component names:" msgstr "Noms de composants incorrects ou ambigus :" msgid "Multiple matches to component name" msgstr "Correspondances multiples pour les noms des composants" msgid "" "the 'at' and 'labels' components of 'scales' may not be lists when 'relation " "= \"same\"'" msgstr "" "les composantes 'at' et 'labels' de 'scales' ne peuvent pas être des listes " "quand 'relation = \"same\"'" msgid "limits cannot be a list when relation = same" msgstr "'limits' ne peut pas être une liste lorsque 'relation = same'" msgid "Explicitly specified limits ignored" msgstr "Les limites spécifiées explicitement ont été ignorées" msgid "need at least one panel" msgstr "besoin d'au moins un panneau" msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "'aspect=\"iso\"' approximatif lorsque 'relation=\"free\"'" msgid "" "Note: The default device has been opened to honour attempt to modify trellis " "settings" msgstr "" "Remarque : le périphérique par défaut a été ouvert pour permettre de " "modifier les paramètres d'un graphe trellis" msgid "Invalid 'theme' specified" msgstr "'theme' spécifié incorrect" msgid "Could not find device function '%s'" msgstr "Impossible de trouver la fonction du périphérique '%s'" msgid "" "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "'trellis.device' a changé, 'bg' peut ne plus faire ce que vous pensiez" msgid "x must be a shingle" msgstr "'x' soit être une latte ('shingle')" msgid "x must be matrix with 2 columns" msgstr "'x' doit être une matrice à 2 colonnes" msgid "bad value of 'intervals'" msgstr "mauvaise valeur pour 'intervals'" msgid "Data:" msgstr "Données :" msgid "no intervals" msgstr "pas d'intervalles" msgid "Intervals:" msgstr "Intervalles :" msgid "Overlap between adjacent intervals:" msgstr "Superposition d'intervalles contigus :" msgid "Range" msgstr "Étendue" msgid "Panel" msgstr "Panneau" msgid "Scatter Plot Matrix" msgstr "Matrice de nuages de points" msgid "Call:" msgstr "Appel :" msgid "Number of observations:" msgstr "Nombre d'observations :" msgid "supplied 'dimnames' have wrong length" msgstr "le 'dimnames' fourni est de longueur incorrecte" msgid "some components of supplied 'dimnames' have wrong length" msgstr "certains composants du 'dimnames' fourni sont de longueur incorrecte" msgid "mean" msgstr "moyenne" msgid "difference" msgstr "différence" msgid "Requested 'trellis' object was not saved" msgstr "L'objet 'trellis' requis n'a pas été sauvegardé" msgid "Inappropriate value of 'as.table'" msgstr "Valeur de 'as.table' incorrecte" msgid "'par.strip.text' must be a list" msgstr "'par.strip.text' doit être une liste" msgid "'par.settings' must be a list" msgstr "'par.settings' doit être une liste" msgid "'plot.args' must be a list" msgstr "'plot.args' doit être une liste" msgid "'lattice.options' must be a list" msgstr "'lattice.options' doit être une liste" msgid "Invalid value of 'perm.cond'" msgstr "Valeur de 'perm.cond' incorrecte" msgid "" "Note: 'auto.key' ignored since legend already present.\n" "Use 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" "Remarque : 'auto.key' est ignoré car une légende est déjà présente.\n" "Utilisez 'update(…, legend = NULL)' pour retirer le(s) légende(s) " "existante(s)" msgid "log scales cannot be changed via 'update'" msgstr "" "l'échelle des axes logarithmiques ne peut être modifiée à l'aide d''update'" msgid "" "the at and labels components of scales may not be lists when relation = same" msgstr "" "les composantes d'échelles 'at' et 'labels' ne peuvent pas être des listes " "quand 'relation = same'" msgid "Unrecognized value of 'aspect': '%s'" msgstr "Valeur inconnue pour 'aspect' : '%s'" msgid "Invalid value of 'aspect'" msgstr "Valeur incorrecte pour 'aspect'" msgid "'drop=TRUE' ignored" msgstr "'drop=TRUE' est ignoré" msgid "Invalid indices" msgstr "Indices incorrects" #~ msgid "missing values and NaN's not allowed if 'na.rm' is FALSE" #~ msgstr "" #~ "les valeurs manquantes et les NaN's ne sont pas permis lorsque 'na.rm = " #~ "FALSE'" #~ msgid "'probs' outside [0,1]" #~ msgstr "'probs' est en dehors de [0,1]" #~ msgid "regression coefficients" #~ msgstr "coefficients de régression" #~ msgid "" #~ "Note: you shouldn't be seeing this message unless\n" #~ "you are using a non-standard version of lattice" #~ msgstr "" #~ "Remarque : vous ne devriez pas lire ce message à moins que\n" #~ "vous utilisiez une version non standard de lattice" #~ msgid "" #~ "The grid package couldn't be loaded.\n" #~ "Please check your installation of R" #~ msgstr "" #~ "Le package grid ne peut être chargé.\n" #~ "Veuillez vérifier votre installation de R" #~ msgid "at least one element of layout must be positive" #~ msgstr "au moins un des éléments de 'layout' doit être positif" #~ msgid "" #~ "'packet.number' and 'panel.number' are no longer supplied to the panel " #~ "function. See ?packet.number" #~ msgstr "" #~ "'packet.number' et 'panel.number' ne sont plus passés à la fonction " #~ "panel. Voir ?packet.number" #~ msgid "currently saved object is not the last one plotted" #~ msgstr "" #~ "l'objet actuellement sauvegardé n'est pas le dernier qui a été tracé" lattice/po/R-it.po0000644000176200001440000003026014772676012013505 0ustar liggesusers# R Italian translation # Copyright (C) The R Foundation # This file is distributed under the same license as the R package. # Daniele Medri , 2005-2020. # msgid "" msgstr "" "Project-Id-Version: R-lattice\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: \n" "Last-Translator: Daniele Medri \n" "Language-Team: Italian https://github.com/dmedri/R-italian-lang\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 2.2.1\n" #, fuzzy msgid "Invalid value of 'log'" msgstr "Valore di 'aspect' non valido" msgid "'at' missing or incompatible with 'labels'" msgstr "'at' mancante o incompatibile con 'labels'" msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" msgid "range too small for min.n" msgstr "" msgid "'origin' forced to 0 for stacked bars" msgstr "'origin' forzato a 0 per le barre sovrapposte" msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "" msgid "" "%s must be length 1 or a vector of \n" " length multiple of group length (%d)" msgstr "" msgid "," msgstr "" msgid "explicit 'data' specification ignored" msgstr "ignorata l'esplicita specificazione di 'data'" msgid "mismatch in number of packets" msgstr "mancata corrispondenza nel numero di pacchetti" msgid "'type' has unsupported values" msgstr "'type' ha valori non supportati" msgid "Inappropriate arguments" msgstr "Argomenti inappropriati" msgid "shingles can not be concatenated" msgstr "shingle non concatenabili" msgid "model must be a formula object" msgstr "il modello dev'essere un oggetto formula" msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "'multiple=TRUE' ignorato ('groups' non nulli con 'outer=FALSE')" msgid "invalid dimension '%s'" msgstr "dimensione '%s' non valida" msgid "invalid model" msgstr "modello non valido" msgid "newFactor cannot be NULL; you have found a bug!" msgstr "newFactor non può essere NULL; hai trovato un bug!" msgid "" "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "newFactor != NULL && groups == NULL non regge; hai trovato un bug!" msgid "Length check mismatch; you have found a bug!" msgstr "Il controllo delle lunghezze non corrisponde; hai trovato un bug!" msgid "Non matching lengths" msgstr "Lunghezze non corrispondenti" msgid "'length' and 'prop' cannot both be specified" msgstr "'length' e 'prop' non possono essere entrambi specificati" msgid "'length' must be positive" msgstr "'length' dev'essere positivo" msgid "improper length of 'lim'" msgstr "lunghezza di 'lim' impropria" msgid "Invalid value of perm.cond" msgstr "Valore perm.cond non valido" msgid "Invalid value of index.cond" msgstr "Valore di index.cond non valido" msgid "skip cannot be all TRUE" msgstr "i salti non possono essere tutti TRUE" msgid "layout must have at least 2 elements" msgstr "il layout deve avere almeno 2 elementi" #, fuzzy msgid "Inadmissible value of layout." msgstr "valore non valido per il layout" msgid "invalid value for layout" msgstr "valore non valido per il layout" msgid "More pages in layout than seem to be necessary." msgstr "" msgid "a formula must be specified for the 'data.frame' method" msgstr "" #, fuzzy msgid "'formula' must be a formula object" msgstr "il modello dev'essere un oggetto formula" msgid "Density" msgstr "Densità" msgid "Can't have log Y-scale" msgstr "Non è possibile avere log Y-scale" msgid "type='%s' can be misleading in this context" msgstr "type = '%s' può essere fuorviante in questo contesto" msgid "problem with 'hist' computations" msgstr "problema con le computazioni di 'hist'" msgid "Count" msgstr "Conta" msgid "Percent of Total" msgstr "Percentuale sul totale" msgid "no observations within" msgstr "nessuna osservazione all'interno" msgid "points" msgstr "punti" msgid "nearest observation already identified" msgstr "l'osservazione più vicina è già identificata" msgid "column must be specified" msgstr "la colonna dev'essere specificata" msgid "row must be specified" msgstr "la riga dev'essere specificata" msgid "panel position unspecified or invalid" msgstr "posizione del pannello non specificata o non valida" msgid "" "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use " "'trellis.focus' first" msgstr "" msgid "Plot object was not saved, cannot retrieve panel data" msgstr "" msgid "Plot spans multiple pages, only last page can be updated" msgstr "" msgid "You have to first select a panel using trellis.focus()" msgstr "" msgid "Selecting panel at position (%g, %g)" msgstr "Selezione del pannello in posizione (%g,%g)" msgid "No panels available" msgstr "Nessun pannello disponibile" msgid "Click on panel to focus" msgstr "Fai clic sul pannello per il focus" msgid "'f.value' not supported; ignoring" msgstr "'f.value' non supportato; ignorato" msgid "Click to choose one point to highlight" msgstr "Fate clic per scegliere un punto da evidenziare" msgid "no points within" msgstr "nessun punto all'interno" msgid "points of click" msgstr "punti di clic" msgid "component '%s' duplicated in key and legend" msgstr "componente '%s' duplicata nella chiave e nella legenda" msgid "key must be a list" msgstr "key dev'essere una lista" msgid "first component of text must be vector of labels" msgstr "" msgid "" "Invalid key, need at least one component named lines, text, rect or points" msgstr "" "Chiave non valida, è necessario almeno un componente denominato linee, " "testo, rettangolo o punti" msgid "not enough rows for columns" msgstr "non ci sono abbastanza righe per colonne" msgid "Sorry, align=FALSE is not supported" msgstr "" msgid "'at' values are not equispaced; output may be wrong" msgstr "" msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" msgid "malformed colorkey" msgstr "colorkey malformato" #, fuzzy msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "Valore di 'perm.cond' non valido" msgid "Invalid 'shrink' parameter ignored" msgstr "Ignorati i parametri 'shrink' non validi" msgid "Invalid label.style" msgstr "label.style non valido" msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "" msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "" msgid "'x' values are not equispaced; output may be wrong" msgstr "" msgid "'y' values are not equispaced; output may be wrong" msgstr "" msgid "x must be (coercible to be) a factor" msgstr "x dev'essere (coercibile per essere) un fattore" msgid "error" msgstr "errore" #, fuzzy msgid "Invalid value of 'pos' ignored." msgstr "Valore di 'perm.cond' non valido" msgid "(loaded the KernSmooth namespace)" msgstr "(caricato il namespace KernSmooth)" msgid "" "panel.smoothScatter() requires the KernSmooth package, but unable to load " "KernSmooth namespace" msgstr "" "panel.smoothScatter() richiede il pacchetto KernSmooth, ma non possibile " "caricarne il namespace" msgid "'nbin' must be numeric of length 1 or 2" msgstr "'nbin' dev'essere numerico di lunghezza 1 o 2" msgid "'bandwidth' must be numeric" msgstr "'bandwidth' dev'essere numerico" msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "'nrpoints' dovrebbe essere uno scalare numerico con valore >= 0." msgid "'a' is overridden by 'reg'" msgstr "'a' è annullato da'reg'" msgid "only using the first two of %d regression coefficients" msgstr "" msgid "'a' and 'b' are overridden by 'coef'" msgstr "'a' e 'b' sono annullati da 'coef'" msgid "'expr' must be a function or an expression containing 'x'" msgstr "'expr' dev'essere una funzione o un'espressione contenente 'x'" #, fuzzy msgid "'varnames' has wrong length." msgstr "il 'dimnames' passato ha lunghezze sbagliate" msgid "Parallel Coordinate Plot" msgstr "Plot delle Coordinate Parallele" msgid "cannot have log y-scale" msgstr "non è possibile avere log y-scale" msgid "" "Error using packet %g\n" "%s" msgstr "" "Errore durante l'utilizzo di packet %g\n" "%s" msgid "y must have exactly 2 levels" msgstr "y deve avere esattamente 2 livelli" msgid "Can't have log X-scale" msgstr "Non è possibile avere log X-scale" msgid "Fitted Values minus Mean" msgstr "Valori adattati meno media" msgid "Residuals" msgstr "Residui" msgid "Invalid or ambiguous component names:" msgstr "" msgid "Multiple matches to component name" msgstr "" #, fuzzy msgid "" "the 'at' and 'labels' components of 'scales' may not be lists when 'relation " "= \"same\"'" msgstr "" "i componenti di scala 'at' e 'labels' potrebbero non essere liste con " "relation = same" msgid "limits cannot be a list when relation = same" msgstr "i limiti non possono essere una lista quando relation = same" msgid "Explicitly specified limits ignored" msgstr "Ignorati i limiti specificati esplicitamente" msgid "need at least one panel" msgstr "richiede almeno un pannello" msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "'aspect=\"iso\"' approssimativo con 'relation=\"free\"'" msgid "" "Note: The default device has been opened to honour attempt to modify trellis " "settings" msgstr "" "Nota: Il dispositivo predefinito è stato aperto per onorare il tentativo di " "modificare le impostazioni trellis" msgid "Invalid 'theme' specified" msgstr "Specificato 'theme' non valido" msgid "Could not find device function '%s'" msgstr "Non è possibile trovare la funzione del dispositivo '%s'" msgid "" "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "" "'trellis.device' è cambiato, 'bg' potrebbe non fare quello che pensi che sia" msgid "x must be a shingle" msgstr "x dev'essere un shingle" msgid "x must be matrix with 2 columns" msgstr "x dev'essere una matrice con 2 colonne" msgid "bad value of 'intervals'" msgstr "valore errato per 'intervals'" msgid "Data:" msgstr "Dati:" msgid "no intervals" msgstr "nessun intervallo" msgid "Intervals:" msgstr "Intervalli:" msgid "Overlap between adjacent intervals:" msgstr "Sovrapposizione tra intervalli adiacenti:" msgid "Range" msgstr "Intervallo" msgid "Panel" msgstr "Pannello" msgid "Scatter Plot Matrix" msgstr "Matrice Scatter Plot" msgid "Call:" msgstr "Chiamata:" msgid "Number of observations:" msgstr "Numero di osservazioni:" msgid "supplied 'dimnames' have wrong length" msgstr "il 'dimnames' passato ha lunghezze sbagliate" msgid "some components of supplied 'dimnames' have wrong length" msgstr "alcune componenti del 'dimnames' passato hanno lunghezze sbagliate" msgid "mean" msgstr "media" msgid "difference" msgstr "differenza" msgid "Requested 'trellis' object was not saved" msgstr "" msgid "Inappropriate value of 'as.table'" msgstr "Valori inappropriati di 'as.table'" msgid "'par.strip.text' must be a list" msgstr "'par.strip.text' dev'essere una lista" msgid "'par.settings' must be a list" msgstr "'par.settings' dev'essere una lista" msgid "'plot.args' must be a list" msgstr "'plot.args' dev'essere una lista" msgid "'lattice.options' must be a list" msgstr "'lattice.options' dev'essere una lista" msgid "Invalid value of 'perm.cond'" msgstr "Valore di 'perm.cond' non valido" msgid "" "Note: 'auto.key' ignored since legend already present.\n" "Use 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" "Nota: 'auto.key' è ignorato poiché la legenda è già presente.\n" "Utilizza 'update (..., legend = NULL)' per rimuovere le legende esistenti" msgid "log scales cannot be changed via 'update'" msgstr "le scale log non possono essere cambiate con 'update'" msgid "" "the at and labels components of scales may not be lists when relation = same" msgstr "" "i componenti di scala 'at' e 'labels' potrebbero non essere liste con " "relation = same" msgid "Unrecognized value of 'aspect': '%s'" msgstr "Valore di 'aspect' non riconosciuto: '%s'" msgid "Invalid value of 'aspect'" msgstr "Valore di 'aspect' non valido" msgid "'drop=TRUE' ignored" msgstr "'drop=TRUE' ignorato" msgid "Invalid indices" msgstr "Indici non validi" lattice/po/R-pl.po0000644000176200001440000006732514772676012013520 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: lattice 0.20-27\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: 2014-03-25 21:26+0100\n" "Last-Translator: Łukasz Daniel \n" "Language-Team: Łukasz Daniel \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" "X-Poedit-SourceCharset: iso-8859-1\n" "X-Generator: Poedit 1.5.4\n" # lattice/R/miscellaneous.R: 465 # warning("Invalid value of 'pos' ignored.") msgid "Invalid value of 'log'" msgstr "niepoprawna wartość 'log'" # lattice/R/axis.R: 688 # stop("'at' missing or incompatible with 'labels'") msgid "'at' missing or incompatible with 'labels'" msgstr "brakuje 'at' lub niespójne z 'labels'" msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" # lattice/R/axis.R: 596 # stop("range too small for min.n") msgid "range too small for min.n" msgstr "zakres dla 'min.n' jest zbyt mały" # lattice/R/bwplot.R: 184 # warning("'origin' forced to 0 for stacked bars") # lattice/R/bwplot.R: 321 # warning("'origin' forced to 0 for stacked bars") msgid "'origin' forced to 0 for stacked bars" msgstr "'origin' wymuszone aby być zerem dla ułożonych pasków" msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "" msgid "" "%s must be length 1 or a vector of \n" " length multiple of group length (%d)" msgstr "" msgid "," msgstr "," # lattice/R/cloud.R: 1427 # warning("explicit 'data' specification ignored") # lattice/R/cloud.R: 1488 # warning("explicit 'data' specification ignored") # lattice/R/splom.R: 333 # warning("explicit 'data' specification ignored") # lattice/R/parallel.R: 157 # warning("explicit 'data' specification ignored") # lattice/R/qqmath.R: 246 # warning("explicit 'data' specification ignored") # lattice/R/densityplot.R: 188 # warning("explicit 'data' specification ignored") # lattice/R/histogram.R: 163 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 398 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 429 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 454 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 465 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 504 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 511 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 549 # warning("explicit 'data' specification ignored") # lattice/R/levelplot.R: 569 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 926 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 938 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 955 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 1016 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 1034 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 1098 # warning("explicit 'data' specification ignored") # lattice/R/bwplot.R: 1143 # warning("explicit 'data' specification ignored") # lattice/R/xyplot.R: 223 # warning("explicit 'data' specification ignored") msgid "explicit 'data' specification ignored" msgstr "jawne określenie 'data' zostało zignorowane" # lattice/R/cloud.R: 1853 # stop("mismatch in number of packets") # lattice/R/splom.R: 493 # stop("mismatch in number of packets") # lattice/R/parallel.R: 331 # stop("mismatch in number of packets") # lattice/R/qq.R: 211 # stop("mismatch in number of packets") # lattice/R/qqmath.R: 407 # stop("mismatch in number of packets") # lattice/R/densityplot.R: 369 # stop("mismatch in number of packets") # lattice/R/histogram.R: 357 # stop("mismatch in number of packets") # lattice/R/levelplot.R: 852 # stop("mismatch in number of packets") # lattice/R/bwplot.R: 1349 # stop("mismatch in number of packets") # lattice/R/xyplot.R: 383 # stop("mismatch in number of packets") msgid "mismatch in number of packets" msgstr "niezgodność w liczbie pakietów" # lattice/R/cloud.R: 294 # warning("'type' has unsupported values") msgid "'type' has unsupported values" msgstr "'type' posiada niewspierane wartości" # lattice/R/common.R: 45 # stop("Inappropriate arguments") msgid "Inappropriate arguments" msgstr "Niepoprawne argumenty" # lattice/R/common.R: 154 # stop("shingles can not be concatenated") msgid "shingles can not be concatenated" msgstr "obiekty klasy \"shingle\" nie mogą być przycięte" # lattice/R/common.R: 159 # stop("model must be a formula object") msgid "model must be a formula object" msgstr "model musi być obiektem formuły" # lattice/R/common.R: 164 # warning("'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')") msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "zignorowano 'multiple=TRUE' ('groups' są niepuste z 'outer=FALSE')" # lattice/R/common.R: 176 # stop(gettextf("invalid dimension '%s'", as.character(dimension))) msgid "invalid dimension '%s'" msgstr "niepoprawny wymiar '%s'" # lattice/R/common.R: 334 # stop("invalid model") msgid "invalid model" msgstr "niepoprawny model" # lattice/R/common.R: 376 # stop("newFactor cannot be NULL; you have found a bug!") msgid "newFactor cannot be NULL; you have found a bug!" msgstr "'newFactor' nie może mieć wartości NULL; znalazłeś błąd!" # lattice/R/common.R: 390 # stop("newFactor != NULL && groups == NULL does not hold; you have found a bug!") msgid "" "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "newFactor != NULL && groups == NULL nie trzyma się; znalazłeś błąd!" # lattice/R/common.R: 401 # stop("Length check mismatch; you have found a bug!") msgid "Length check mismatch; you have found a bug!" msgstr "Sprawdzenie długości nie zgadza się; znalazłeś błąd!" # lattice/R/common.R: 421 # stop("Non matching lengths") # lattice/R/common.R: 445 # stop("Non matching lengths") msgid "Non matching lengths" msgstr "Niezgodne długości" # lattice/R/common.R: 498 # stop("'length' and 'prop' cannot both be specified") msgid "'length' and 'prop' cannot both be specified" msgstr "'length' oraz 'prop' nie mogą być jednocześnie określone" # lattice/R/common.R: 499 # stop("'length' must be positive") msgid "'length' must be positive" msgstr "argument 'length' musi być dodatni" # lattice/R/common.R: 514 # stop("improper length of 'lim'") msgid "improper length of 'lim'" msgstr "niepoprawna długość argumentu 'lim'" # lattice/R/common.R: 701 # stop("Invalid value of index.cond") msgid "Invalid value of perm.cond" msgstr "Niepoprawna wartość 'perm.cond'" # lattice/R/common.R: 701 # stop("Invalid value of index.cond") msgid "Invalid value of index.cond" msgstr "Niepoprawna wartość 'index.cond'" # lattice/R/common.R: 719 # stop("skip cannot be all TRUE") msgid "skip cannot be all TRUE" msgstr "'skip' nie może całe być TRUE" # lattice/R/common.R: 736 # stop("layout must have at least 2 elements") msgid "layout must have at least 2 elements" msgstr "'layout' musi mieć przynajmniej 2 elementy" # lattice/R/common.R: 741 # stop("Inadmissible value of layout.") msgid "Inadmissible value of layout." msgstr "Niedopuszczalna wartość 'layout'." # lattice/R/common.R: 741 # stop("Inadmissible value of layout.") msgid "invalid value for layout" msgstr "niepoprawna wartość 'layout'" # lattice/R/common.R: 756 # warning("More pages in layout than seem to be necessary.") msgid "More pages in layout than seem to be necessary." msgstr "Więcej stron na ekranie niż wydaje się być konieczne." msgid "a formula must be specified for the 'data.frame' method" msgstr "" # lattice/R/common.R: 159 # stop("model must be a formula object") #, fuzzy msgid "'formula' must be a formula object" msgstr "model musi być obiektem formuły" # lattice/R/densityplot.R: 288 # gettext("Density") # lattice/R/densityplot.R: 306 # gettext("Density") # lattice/R/histogram.R: 339 # gettext("Density") msgid "Density" msgstr "Gęstość" # lattice/R/densityplot.R: 349 # warning("Can't have log Y-scale") # lattice/R/histogram.R: 304 # warning("Can't have log Y-scale") msgid "Can't have log Y-scale" msgstr "Nie można mieć logarytmicznej skali Y" # lattice/R/histogram.R: 330 # warning(gettextf("type='%s' can be misleading in this context", type)) msgid "type='%s' can be misleading in this context" msgstr "'type = %s' może być mylące w tym kontekście" # lattice/R/histogram.R: 134 # warning("problem with 'hist' computations") msgid "problem with 'hist' computations" msgstr "problem z obliczeniami 'hist'" # lattice/R/histogram.R: 337 # gettext("Count") msgid "Count" msgstr "Zliczenia" # lattice/R/histogram.R: 338 # gettext("Percent of Total") msgid "Percent of Total" msgstr "Procent całości" # lattice/R/interaction.R: 83 # warning(gettextf("no observations within %d points", threshold)) # lattice/R/interaction.R: 149 # warning(gettextf("no observations within %d points", threshold)) msgid "no observations within" msgstr "brak obserwacji w zasięgu" msgid "points" msgstr "punktów" # lattice/R/interaction.R: 96 # warning("nearest observation already identified") # lattice/R/interaction.R: 161 # warning("nearest observation already identified") msgid "nearest observation already identified" msgstr "najbliższa obserwacja jest już zidentyfikowana" # lattice/R/interaction.R: 394 # stop("column must be specified") msgid "column must be specified" msgstr "kolumna musi zostać określona" # lattice/R/interaction.R: 395 # stop("row must be specified") msgid "row must be specified" msgstr "wiersz musi zostać określony" # lattice/R/interaction.R: 427 # stop("panel position unspecified or invalid") msgid "panel position unspecified or invalid" msgstr "położenie panelu jest nieokreślone lub jest niepoprawne" # lattice/R/interaction.R: 467 # stop("'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first") msgid "" "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use " "'trellis.focus' first" msgstr "" "'trellis.switchFocus' nie może być użyte aby przełączyć się na inną wartość " "'prefix'. Użyj najpierw 'trellis.focus'" # lattice/R/interaction.R: 513 # stop("Plot object was not saved, cannot retrieve panel data") msgid "Plot object was not saved, cannot retrieve panel data" msgstr "Wykres nie został zapisany, nie można przywrócić danych panelu" # lattice/R/interaction.R: 516 # warning("Plot spans multiple pages, only last page can be updated") msgid "Plot spans multiple pages, only last page can be updated" msgstr "" "Wykres rozciąga się na wiele stron, tylko ostatnia strona może zostać " "zaktualizowana" # lattice/R/interaction.R: 530 # stop("You have to first select a panel using trellis.focus()") msgid "You have to first select a panel using trellis.focus()" msgstr "Musisz najpierw wybrać panel używając 'trellis.focus()'" # lattice/R/interaction.R: 557 # message(sprintf("Selecting panel at position (%g, %g)", focusRow, focusCol)) # lattice/R/interaction.R: 609 # message(sprintf("Selecting panel at position (%g, %g)", focusRow, focusCol)) msgid "Selecting panel at position (%g, %g)" msgstr "Wybieranie panelu na pozycji (%g, %g)" # lattice/R/interaction.R: 561 # warning("No panels available") # lattice/R/interaction.R: 613 # warning("No panels available") msgid "No panels available" msgstr "Brak dostępnych paneli" # lattice/R/interaction.R: 566 # message("Click on panel to focus") # lattice/R/interaction.R: 618 # message("Click on panel to focus") msgid "Click on panel to focus" msgstr "Kliknij na panel aby go sfokusować" # lattice/R/interaction.R: 673 # warning("'f.value' not supported; ignoring") msgid "'f.value' not supported; ignoring" msgstr "'f.value' nie jest wspierane; ignorowanie" # lattice/R/interaction.R: 732 # message("Click to choose one point to highlight") msgid "Click to choose one point to highlight" msgstr "Kliknij aby wybrać jeden punkt do podświetlenia" # lattice/R/interaction.R: 756 # warning(gettextf("no points within %d points of click", threshold)) msgid "no points within" msgstr "brak punktów z pośród" # lattice/R/interaction.R: 756 # warning(gettextf("no points within %d points of click", threshold)) msgid "points of click" msgstr "punktów kliknięcia" # lattice/R/legend.R: 56 # stop(gettextf("component '%s' duplicated in key and legend", space)) msgid "component '%s' duplicated in key and legend" msgstr "komponent '%s' jest powtórzony w kluczu oraz legendzie" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "key must be a list" msgstr "argument 'key' musi być listą" # lattice/R/legend.R: 250 # stop("first component of text must be vector of labels") msgid "first component of text must be vector of labels" msgstr "pierwszy komponent musi być wektorem etykiet" # lattice/R/legend.R: 337 # stop("Invalid key, need at least one component named lines, text, rect or points") msgid "" "Invalid key, need at least one component named lines, text, rect or points" msgstr "" "Niepoprawny klucz, potrzeba co najmniej jeden komponent z nazwany 'lines', " "'text', 'rect' lub 'points'" # lattice/R/legend.R: 375 # warning("not enough rows for columns") msgid "not enough rows for columns" msgstr "zbyt mało wierszy dla kolumn" # lattice/R/legend.R: 743 # stop("Sorry, align=FALSE is not supported") msgid "Sorry, align=FALSE is not supported" msgstr "Przykro mi, 'allign = FALSE' nie jest wpierane" # lattice/R/legend.R: 831 # warning("'at' values are not equispaced; output may be wrong") msgid "'at' values are not equispaced; output may be wrong" msgstr "" "wartości 'at' nie są równomiernie rozmieszczone; wyjście może być błędne" msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" # lattice/R/legend.R: 892 # stop("malformed colorkey") msgid "malformed colorkey" msgstr "niepoprawnie sformatowane 'colorkey'" # lattice/R/miscellaneous.R: 465 # warning("Invalid value of 'pos' ignored.") msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "Niepoprawna wartość 'tri.upper/tri.lower' została zignorowana." # lattice/R/levelplot.R: 179 # warning("Invalid 'shrink' parameter ignored") msgid "Invalid 'shrink' parameter ignored" msgstr "Niepoprawny parametr 'shrink' został zignorowany" msgid "Invalid label.style" msgstr "niepoprawna wartość 'label.style'" # lattice/R/levelplot.R: 659 # warning("device support for raster images unknown, ignoring 'raster=TRUE'") msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" "wspomaganie sprzętowe dla obrazów rastrowych nie jest znane, ignorowanie " "'raster=TRUE'" # lattice/R/levelplot.R: 664 # warning("device has no raster support, ignoring 'raster=TRUE'") msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "urządzenie nie ma wsparcia rastrowego, ignorowanie 'raster=TRUE'" # lattice/R/levelplot.R: 669 # warning("device does not support raster images with NA, ignoring 'raster=TRUE'") msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "" "urządzenie nie wspiera obrazów rastrowych z wartością NA, ignorowanie " "'raster=TRUE'" # lattice/R/levelplot.R: 943 # warning("'x' values are not equispaced; output may be wrong") msgid "'x' values are not equispaced; output may be wrong" msgstr "wartości 'x' nie są równomiernie rozłożone; wyjście może być błędne" # lattice/R/levelplot.R: 956 # warning("'y' values are not equispaced; output may be wrong") msgid "'y' values are not equispaced; output may be wrong" msgstr "wartości 'y' nie są równomiernie rozłożone; wyjście może być błędne" # lattice/R/miscellaneous.R: 116 # stop("x must be (coercible to be) a factor") msgid "x must be (coercible to be) a factor" msgstr "'x' musi być czynnikiem (musi być przekształcalne w czynnik)" # lattice/R/miscellaneous.R: 188 # stop("error") msgid "error" msgstr "błąd" # lattice/R/miscellaneous.R: 465 # warning("Invalid value of 'pos' ignored.") msgid "Invalid value of 'pos' ignored." msgstr "Niepoprawna wartość 'pos' została zignorowana." # lattice/R/panel.smoothscatter.R: 16 # message("(loaded the KernSmooth namespace)") msgid "(loaded the KernSmooth namespace)" msgstr "(załadowano przestrzeń nazw pakietu 'KernSmooth')" # lattice/R/panel.smoothscatter.R: 17 # stop("panel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespace") msgid "" "panel.smoothScatter() requires the KernSmooth package, but unable to load " "KernSmooth namespace" msgstr "" "'panel.smoothScatter()' wymaga pakietu 'KernSmooth', ale nie można załadować " "przestrzeni nazw pakietu 'KernSmooth'" # lattice/R/panel.smoothscatter.R: 21 # stop("'nbin' must be numeric of length 1 or 2") msgid "'nbin' must be numeric of length 1 or 2" msgstr "'nbin' musi być liczbą o długości 1 lub 2" # lattice/R/panel.smoothscatter.R: 25 # stop("'bandwidth' must be numeric") msgid "'bandwidth' must be numeric" msgstr "'bandwidth' musi być liczbą" # lattice/R/panel.smoothscatter.R: 73 # stop("'nrpoints' should be numeric scalar with value >= 0.") msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "'nrpoints' powinno być skalarem liczbowym z wartością >= 0." # lattice/R/panels.R: 47 # warning("'a' is overridden by 'reg'") msgid "'a' is overridden by 'reg'" msgstr "'a' jest nadpisane przez 'reg'" # lattice/R/panels.R: 54 # warning("only using the first two of ", p, "regression coefficients") #, fuzzy msgid "only using the first two of %d regression coefficients" msgstr "używanie jedynie pierwszych dwóch z " # lattice/R/panels.R: 73 # warning("'a' and 'b' are overridden by 'coef'") msgid "'a' and 'b' are overridden by 'coef'" msgstr "'a' oraz 'b' są nadpisane przez 'coef'" # lattice/R/panels.R: 276 # stop("'expr' must be a function or an expression containing 'x'") msgid "'expr' must be a function or an expression containing 'x'" msgstr "'expr' musi być funkcją lub wyrażeniem zawierającym 'x'" # lattice/R/splom.R: 421 # stop("'varnames' has wrong length.") # lattice/R/parallel.R: 240 # stop("'varnames' has wrong length.") msgid "'varnames' has wrong length." msgstr "argument 'varnames' posiada błędną długość" # lattice/R/parallel.R: 255 # gettext("Parallel Coordinate Plot") msgid "Parallel Coordinate Plot" msgstr "Wykres równoległych współrzędnych" # lattice/R/parallel.R: 315 # warning("cannot have log y-scale") msgid "cannot have log y-scale" msgstr "nie można mieć logarytmicznej skali Y" # lattice/R/print.trellis.R: 203 # gettextf("Error using packet %g\n%s", # panel.number(), # conditionMessage(e)) msgid "" "Error using packet %g\n" "%s" msgstr "" "Błąd podczas używania paczki %g\n" "%s" # lattice/R/qq.R: 118 # stop("y must have exactly 2 levels") msgid "y must have exactly 2 levels" msgstr "'y' musi mieć dokładnie 2 poziomy" # lattice/R/qqmath.R: 372 # warning("Can't have log X-scale") msgid "Can't have log X-scale" msgstr "Nie można mieć logarytmicznej skali X" # lattice/R/rfs.R: 19 # gettext("Fitted Values minus Mean") msgid "Fitted Values minus Mean" msgstr "Dopasowanie wartości minus średnia" # lattice/R/rfs.R: 20 # gettext("Residuals") msgid "Residuals" msgstr "Reszty" # lattice/R/scales.R: 32 # warning("Invalid or ambiguous component names: ", tmp_n, sep = "") msgid "Invalid or ambiguous component names:" msgstr "Niepoprawne lub niejednoznacznie nazwy komponentów" # lattice/R/scales.R: 35 # stop("Multiple matches to component name") msgid "Multiple matches to component name" msgstr "Wielokrotne dopasowania do nazwy komponentu" # lattice/R/scales.R: 94 # stop("the 'at' and 'labels' components of 'scales' may not be lists when 'relation = \"same\"'") # lattice/R/scales.R: 96 # stop("the 'at' and 'labels' components of 'scales' may not be lists when 'relation = \"same\"'") msgid "" "the 'at' and 'labels' components of 'scales' may not be lists when 'relation " "= \"same\"'" msgstr "" "komponenty, 'at' oraz 'labels', dla 'scales' nie mogą być listami gdy " "'relation = \"same\"'" # lattice/R/scales.R: 275 # stop("limits cannot be a list when relation = same") msgid "limits cannot be a list when relation = same" msgstr "'limits' nie mogą być listą gdy 'relation = \"same\"'" # lattice/R/scales.R: 299 # warning("Explicitly specified limits ignored") msgid "Explicitly specified limits ignored" msgstr "Jawnie określone granice zostały zignorowane" # lattice/R/scales.R: 425 # stop("need at least one panel") msgid "need at least one panel" msgstr "co najmniej jeden panel jest wymagany" # lattice/R/scales.R: 526 # warning("'aspect=\"iso\"' approximate since 'relation=\"free\"'") msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "przybliżenie 'aspect=\"iso\"' ponieważ 'relation=\"free\"'" # lattice/R/settings.R: 309 # warning("Note: The default device has been opened to honour attempt to modify trellis settings") msgid "" "Note: The default device has been opened to honour attempt to modify trellis " "settings" msgstr "" "Uwaga: Domyślne urządzenie zostało otwarte aby umożliwić próbę modyfikacji " "ustawień 'trellis'" # lattice/R/settings.R: 345 # warning("Invalid 'theme' specified") # lattice/R/settings.R: 435 # warning("Invalid 'theme' specified") msgid "Invalid 'theme' specified" msgstr "określono niepoprawne 'theme'" # lattice/R/settings.R: 383 # stop(gettextf("Could not find device function '%s'", device)) msgid "Could not find device function '%s'" msgstr "Nie można znaleźć funkcji '%s' urządzenia" # lattice/R/settings.R: 399 # warning("'trellis.device' has changed, 'bg' may not be doing what you think it is") msgid "" "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "" "'trellis.device' zmienił się, 'bg' może nie robić tego co ci się wydaje" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "x must be a shingle" msgstr "argument 'x' musi być obiektem klasy \"shingle\"" # lattice/R/shingle.R: 49 # stop("x must be matrix with 2 columns") msgid "x must be matrix with 2 columns" msgstr "argument 'x' musi być macierzą z 2 kolumnami" # lattice/R/shingle.R: 74 # stop("bad value of 'intervals'") msgid "bad value of 'intervals'" msgstr "błędna wartość 'intervals'" # lattice/R/shingle.R: 122 # gettext("Data:", domain = "R-lattice") msgid "Data:" msgstr "Dane:" # lattice/R/shingle.R: 127 # gettext("no intervals", domain = "R-lattice") msgid "no intervals" msgstr "brak interwałów" # lattice/R/shingle.R: 135 # gettext("Intervals:", domain = "R-lattice") msgid "Intervals:" msgstr "Interwały:" # lattice/R/shingle.R: 142 # gettext("Overlap between adjacent intervals:", domain = "R-lattice") msgid "Overlap between adjacent intervals:" msgstr "Pokrywanie się pomiędzy sąsiadującymi interwałami:" # lattice/R/shingle.R: 153 # gettext("Range") msgid "Range" msgstr "Zakres" # lattice/R/shingle.R: 154 # gettext("Panel") msgid "Panel" msgstr "Panel" # lattice/R/splom.R: 358 # gettext("Scatter Plot Matrix") # lattice/R/splom.R: 436 # gettext("Scatter Plot Matrix") msgid "Scatter Plot Matrix" msgstr "Macierzowy wykres punktowy" # lattice/R/summary.trellis.R: 37 # gettext("Call:", domain = "R-lattice") msgid "Call:" msgstr "Wywołanie:" # lattice/R/summary.trellis.R: 39 # gettext("Number of observations:", domain = "R-lattice") msgid "Number of observations:" msgstr "Liczba obserwacji:" # lattice/R/summary.trellis.R: 96 # stop("supplied 'dimnames' have wrong length") msgid "supplied 'dimnames' have wrong length" msgstr "dostarczone 'dimnames' ma niepoprawną długość" # lattice/R/summary.trellis.R: 98 # stop("some components of supplied 'dimnames' have wrong length") msgid "some components of supplied 'dimnames' have wrong length" msgstr "" "niektóre komponenty dostarczonego 'dimnames' posiadają niepoprawną długość" # lattice/R/tmd.R: 206 # gettext("mean") msgid "mean" msgstr "średnia" # lattice/R/tmd.R: 207 # gettext("difference") msgid "difference" msgstr "różnica" # lattice/R/update.trellis.R: 30 # warning("Requested 'trellis' object was not saved") msgid "Requested 'trellis' object was not saved" msgstr "Zażądany obiekt 'trellis' nie został zapisany" # lattice/R/update.trellis.R: 152 # warning("Inappropriate value of 'as.table'") msgid "Inappropriate value of 'as.table'" msgstr "Niepoprawna wartość 'as.table'" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "'par.strip.text' must be a list" msgstr "argument 'par.strip.text' musi być listą" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "'par.settings' must be a list" msgstr "argument 'par.settings' musi być listą" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "'plot.args' must be a list" msgstr "argument 'plot.args' musi być listą" # lattice/R/legend.R: 139 # stop("key must be a list") # lattice/R/legend.R: 758 # stop("key must be a list") msgid "'lattice.options' must be a list" msgstr "argument 'lattice.options' musi być listą" # lattice/R/common.R: 701 # stop("Invalid value of index.cond") msgid "Invalid value of 'perm.cond'" msgstr "Niepoprawna wartość 'perm.cond'" # lattice/R/update.trellis.R: 305 # message("Note: 'auto.key' ignored since legend already present.\nUse 'update(..., legend = NULL)' to remove existing legend(s)") msgid "" "Note: 'auto.key' ignored since legend already present.\n" "Use 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" "Uwaga: 'auto.key' zostało zignorowane ponieważ legenda jest już obecna.\n" "Użyj 'update(..., legend = NULL)' aby usunąć istniejące legendy" # lattice/R/update.trellis.R: 348 # warning("log scales cannot be changed via 'update'") msgid "log scales cannot be changed via 'update'" msgstr "skale logarytmiczne nie mogą zostać zmienione poprzez 'update'" # lattice/R/update.trellis.R: 408 # stop("the at and labels components of scales may not be lists when relation = same") # lattice/R/update.trellis.R: 410 # stop("the at and labels components of scales may not be lists when relation = same") msgid "" "the at and labels components of scales may not be lists when relation = same" msgstr "" "komponenty, 'at' oraz 'labels', dla 'scales' nie mogą być listami gdy " "'relation = \"same\"'" # lattice/R/update.trellis.R: 447 # warning(gettextf("Unrecognized value of 'aspect': '%s'", as.character(aspect))) msgid "Unrecognized value of 'aspect': '%s'" msgstr "nierozpoznana wartość 'aspect': '%s'" # lattice/R/common.R: 701 # stop("Invalid value of index.cond") msgid "Invalid value of 'aspect'" msgstr "niepoprawna wartość 'aspect'" # lattice/R/update.trellis.R: 493 # warning("'drop=TRUE' ignored") # lattice/R/update.trellis.R: 545 # warning("'drop=TRUE' ignored") msgid "'drop=TRUE' ignored" msgstr "'drop=TRUE' zostało zignorowane" # lattice/R/update.trellis.R: 525 # stop("Invalid indices") # lattice/R/update.trellis.R: 581 # stop("Invalid indices") msgid "Invalid indices" msgstr "niepoprawne indeksy" # lattice/R/qqmath.R: 35 # stop("missing values and NaN's not allowed if 'na.rm' is FALSE") #~ msgid "missing values and NaN's not allowed if 'na.rm' is FALSE" #~ msgstr "" #~ "brakujące wartości oraz wartości NaN nie są dozwolone jeśli 'na.rm' ma " #~ "wartość FALSE" # lattice/R/qqmath.R: 37 # stop("'probs' outside [0,1]") #~ msgid "'probs' outside [0,1]" #~ msgstr "wartości 'probs' poza przedziałem [0,1]" # lattice/R/panels.R: 54 # warning("only using the first two of ", p, "regression coefficients") #~ msgid "regression coefficients" #~ msgstr "współczynników regresji" lattice/po/R-de.po0000644000176200001440000003625214772676012013470 0ustar liggesusers# Translation of R-lattice.pot to German # Copyright (C) 2007-2025 The R Foundation # This file is distributed under the same license as the lattice R package. # Chris Leick , 2009. # Detlef Steuer , 2010-2025. msgid "" msgstr "" "Project-Id-Version: R 4.5.0\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: 2025-03-18 11:16+0100\n" "Last-Translator: Detlef Steuer \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "Invalid value of 'log'" msgstr "Ungültiger Wert von 'log'" msgid "'at' missing or incompatible with 'labels'" msgstr "'at' fehlt oder ist inkompatibel mit 'labels'" msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" "Spezifizieren von 'labels', aber nicht von 'at' kann zu unerwarteten " "Ergebnissen führen" msgid "range too small for min.n" msgstr "Spannweite zu klein für min.n" msgid "'origin' forced to 0 for stacked bars" msgstr "'origin' wurde für gestapelte Balken zwangsweise auf 0 gesetzt" msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "Länge von '%s' muss 1 sein oder ein Vielfaches der Gruppenlänge (%d)" msgid "" "%s must be length 1 or a vector of \n" " length multiple of group length (%d)" msgstr "" "%s muss von Länge 1 sein oder ein Vektor mit\n" " einer vielfachen Länge der Gruppenlänge (%d)" msgid "," msgstr "," msgid "explicit 'data' specification ignored" msgstr "ausdrückliche 'data'-Spezifikation ignoriert" msgid "mismatch in number of packets" msgstr "fehlende Übereinstimmung in Anzahl der Pakete" msgid "'type' has unsupported values" msgstr "'type' enthält nicht unterstützte Werte" msgid "Inappropriate arguments" msgstr "Unangemessene Argumente" msgid "shingles can not be concatenated" msgstr "Kacheln können nicht zusammengefügt werden" msgid "model must be a formula object" msgstr "Modell muss ein Formelobjekt sein" msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "'multiple=TRUE' ignoriert ('groups' nicht Null mit 'outer=FALSE')" msgid "invalid dimension '%s'" msgstr "ungültige Dimension '%s'" msgid "invalid model" msgstr "ungültiges Modell" msgid "newFactor cannot be NULL; you have found a bug!" msgstr "newFactor kann nicht NULL sein. Sie haben einen Fehler gefunden!" msgid "" "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "" "newFactor != NULL && groups == NULL gilt nicht. Sie haben einen Fehler " "gefunden!" msgid "Length check mismatch; you have found a bug!" msgstr "Längenprüfung stimmt nicht überein. Sie haben einen Fehler gefunden!" msgid "Non matching lengths" msgstr "Nicht übereinstimmende Längen" msgid "'length' and 'prop' cannot both be specified" msgstr "'length' und 'prop' können nicht beide angegeben werden" msgid "'length' must be positive" msgstr "'length' muss positiv sein" msgid "improper length of 'lim'" msgstr "ungeeignete Länge von 'lim'" msgid "Invalid value of perm.cond" msgstr "Ungültiger Wert von perm.cond" msgid "Invalid value of index.cond" msgstr "Ungültiger Wert von index.cond" msgid "skip cannot be all TRUE" msgstr "'skip' kann nicht nur TRUE sein" msgid "layout must have at least 2 elements" msgstr "Layout muss mindestens 2 Elemente haben" msgid "Inadmissible value of layout." msgstr "unzulässiger Wert für layout" msgid "invalid value for layout" msgstr "ungültiger Wert für Layout" msgid "More pages in layout than seem to be necessary." msgstr "Mehr Seiten im Layout als anscheinend nötig" msgid "a formula must be specified for the 'data.frame' method" msgstr "" msgid "'formula' must be a formula object" msgstr "'formula' muss ein Formelobjekt sein" msgid "Density" msgstr "Dichte" msgid "Can't have log Y-scale" msgstr "Y-Achse kann keine logarithmische Skala haben" msgid "type='%s' can be misleading in this context" msgstr "type='%s' kann in diesem Zusammenhang irreführend sein" msgid "problem with 'hist' computations" msgstr "Problem mit 'hist'-Berechnungen" msgid "Count" msgstr "Anzahl" msgid "Percent of Total" msgstr "Prozent der Gesamtheit" msgid "no observations within" msgstr "keine Beobachtungen in" msgid "points" msgstr "Punkte" msgid "nearest observation already identified" msgstr "nächstliegende Beobachtung bereits erkannt" msgid "column must be specified" msgstr "Spalte muss angegeben werden" msgid "row must be specified" msgstr "Zeile muss angegeben werden" msgid "panel position unspecified or invalid" msgstr "Position des Bedienfeldes nicht angegeben oder ungültig" msgid "" "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use " "'trellis.focus' first" msgstr "" "'trellis.switchFocus' kann nicht benutzt werden, um auf einen anderen " "'prefix' zu schalten. Zuerst 'trellis.focus' benutzen" msgid "Plot object was not saved, cannot retrieve panel data" msgstr "" "Plot-Objekt wurde nicht gespeichert. Panel Daten können nicht abgefragt " "werden." msgid "Plot spans multiple pages, only last page can be updated" msgstr "" "Plot umfasst mehrere Seiten. Nur die letzte Seite kann aktualisiert werden" msgid "You have to first select a panel using trellis.focus()" msgstr "Sie müssen zuerst ein Panel mittels trellis.focus() auswählen." msgid "Selecting panel at position (%g, %g)" msgstr "Bedienfeld an Position (%g, %g) wird ausgewählt." msgid "No panels available" msgstr "Keine Bedienfelder verfügbar" msgid "Click on panel to focus" msgstr "Zum Fokussieren auf das Bedienfeld klicken." msgid "'f.value' not supported; ignoring" msgstr "'f.value' nicht unterstützt. Wird ignoriert." msgid "Click to choose one point to highlight" msgstr "Klicken Sie einen Punkt, um ihn hervorzuheben" msgid "no points within" msgstr "keine Punkte innerhalb" msgid "points of click" msgstr "Anklickpunkte" msgid "component '%s' duplicated in key and legend" msgstr "Komponente '%s' doppelt in Schlüssel und Beschriftung" msgid "key must be a list" msgstr "Schlüssel muss eine Liste sein" msgid "first component of text must be vector of labels" msgstr "erste Komponente des Textes muss ein Vektor aus Bezeichnungen sein" msgid "" "Invalid key, need at least one component named lines, text, rect or points" msgstr "" "Ungültiger Schlüssel. Es wird mindestens eine Komponente mit Namen 'lines', " "'text', 'rect' oder 'points' benötigt." msgid "not enough rows for columns" msgstr "nicht genug Zeilen für Spalten" msgid "Sorry, align=FALSE is not supported" msgstr "Entschuldigung. align=FALSE wird nicht unterstützt." msgid "'at' values are not equispaced; output may be wrong" msgstr "'at' Werte sind nicht äquidistant; Ausgabe kann falsch sein" msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "Der Key spezifiziert 'labels$labels' aber nicht 'labels$at'" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" "Die Längen von 'labels$labels' und 'labels$at' des Schlüssels unterscheiden " "sich" msgid "malformed colorkey" msgstr "missgestalteter Farbschlüssel" msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "Unzulässiger Wert für 'tri.upper/tri.lower' ignoriert." msgid "Invalid 'shrink' parameter ignored" msgstr "Falscher 'shrink'-Parameter ignoriert" msgid "Invalid label.style" msgstr "Ungültiger label.style" msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" "Geräteunterstützung für Rastergrafiken unbekannt, ignoriere 'raster=TRUE'" msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "Gerät unterstützt keine Rastergrafik, ignoriere 'raster=TRUE'" msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "Gerät unterstützt keine Rastergrafiken mit NA, ignoriere 'raster=TRUE'" msgid "'x' values are not equispaced; output may be wrong" msgstr "'x' Werte sind nicht äquidistant; Ausgabe kann falsch sein" msgid "'y' values are not equispaced; output may be wrong" msgstr "'y' Werte sind nicht äquidistant; Ausgabe kann falsch sein" msgid "x must be (coercible to be) a factor" msgstr "x muss (zwingend) ein Faktor sein" msgid "error" msgstr "Fehler" msgid "Invalid value of 'pos' ignored." msgstr "Unzulässiger Wert für 'pos' ignoriert." msgid "(loaded the KernSmooth namespace)" msgstr "(lud den KernSmooth-Namensraum)" msgid "" "panel.smoothScatter() requires the KernSmooth package, but unable to load " "KernSmooth namespace" msgstr "" "panel.smoothScatter() benötigt das KernSmooth-Paket, aber der KernSmooth-" "Namensraum kann nicht geladen werden." msgid "'nbin' must be numeric of length 1 or 2" msgstr "'nbin' muss numerisch und von der Länge 1 oder 2 sein" msgid "'bandwidth' must be numeric" msgstr "'bandwidth' muss numerisch sein" msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "'nrpoints' sollte numerisch skalar mit Wert >= 0 sein." msgid "'a' is overridden by 'reg'" msgstr "'a' wurde mit 'reg' überschrieben" msgid "only using the first two of %d regression coefficients" msgstr "benutze nur die ersten beiden von %d Regressionskoeffizienten" msgid "'a' and 'b' are overridden by 'coef'" msgstr "'a' und 'b' wurden mit 'coef' überschrieben" msgid "'expr' must be a function or an expression containing 'x'" msgstr "'expr' muss eine Funktion oder ein Ausdruck sein, der 'x' enthält" msgid "'varnames' has wrong length." msgstr "'varnames' hat falsche Länge" msgid "Parallel Coordinate Plot" msgstr "Plot paralleler Koordinaten" msgid "cannot have log y-scale" msgstr "Y-Achse kann keine logarithmische Skala haben" msgid "" "Error using packet %g\n" "%s" msgstr "" "Fehler beim Benutzen des Paketes %g\n" "%s" msgid "y must have exactly 2 levels" msgstr "y muss genau 2 Stufen haben" msgid "Can't have log X-scale" msgstr "X-Achse kann keine logarithmische Skala haben" msgid "Fitted Values minus Mean" msgstr "Angepasste Werte abzüglich Mittelwert" msgid "Residuals" msgstr "Residuen" msgid "Invalid or ambiguous component names:" msgstr "Unzulässige oder zweideutige Komponentennamen:" msgid "Multiple matches to component name" msgstr "Mehrere Übereinstimmungen mit dem Komponentennamen" msgid "" "the 'at' and 'labels' components of 'scales' may not be lists when 'relation " "= \"same\"'" msgstr "" "die 'at'- und 'labels'-Komponenten der Skalen sind möglicherweise keine " "Listen, wenn 'relation = \"same\"'" msgid "limits cannot be a list when relation = same" msgstr "Begrenzungen können keine Liste sein, wenn 'relation = same'" msgid "Explicitly specified limits ignored" msgstr "Ausdrücklich angegebene Begrenzungen ignoriert" msgid "need at least one panel" msgstr "mindestens ein Bedienfeld wird benötigt" msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "'aspect=\"iso\"' ungefähr seit 'relation=\"free\"'" msgid "" "Note: The default device has been opened to honour attempt to modify trellis " "settings" msgstr "" "Anmerkung: Das Standardgerät wurde geöffnet, um zu versuchen, das Verändern " "von Trellis-Einstellungen zu akzeptieren." msgid "Invalid 'theme' specified" msgstr "Ungültiges 'theme' angegeben" msgid "Could not find device function '%s'" msgstr "Gerätefunktion '%s' konnte nicht gefunden werden" msgid "" "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "" "'trellis.device' wurde geändert, 'bg' tut möglicherweise nicht das, was Sie " "denken" msgid "x must be a shingle" msgstr "x muss eine Kachel sein" msgid "x must be matrix with 2 columns" msgstr "x muss eine Matrix mit 2 Spalten sein" msgid "bad value of 'intervals'" msgstr "falscher Wert von 'intervals'" msgid "Data:" msgstr "Daten:" msgid "no intervals" msgstr "keine Intervalle" msgid "Intervals:" msgstr "Intervalle:" msgid "Overlap between adjacent intervals:" msgstr "Überlappung zwischen benachbarten Intervallen:" msgid "Range" msgstr "Bereich" msgid "Panel" msgstr "Bedienfeld" msgid "Scatter Plot Matrix" msgstr "Streudiagramm-Matrix" msgid "Call:" msgstr "Aufruf:" msgid "Number of observations:" msgstr "Anzahl der Beobachtungen:" msgid "supplied 'dimnames' have wrong length" msgstr "angegebene 'dimnames' haben falsche Längen" msgid "some components of supplied 'dimnames' have wrong length" msgstr "einige Bestandteile der angegebenen 'dimnames' haben falsche Längen" msgid "mean" msgstr "Mittelwert" msgid "difference" msgstr "Unterschied" msgid "Requested 'trellis' object was not saved" msgstr "Angefordertes Trellis-Objekt wurde nicht gespeichert" msgid "Inappropriate value of 'as.table'" msgstr "Unangemessener Wert von 'as.table'" msgid "'par.strip.text' must be a list" msgstr "'par.strip.text' muss eine Liste sein" msgid "'par.settings' must be a list" msgstr "'par.settings' muss eine Liste sein" msgid "'plot.args' must be a list" msgstr "'plot.args' muss eine Liste sein" msgid "'lattice.options' must be a list" msgstr "'lattice.options' muss eine Liste sein" msgid "Invalid value of 'perm.cond'" msgstr "Ungültiger Wert von 'perm.cond'" msgid "" "Note: 'auto.key' ignored since legend already present.\n" "Use 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" "Anmerkung: 'auto.key' ignoriert, da Beschriftung bereits vorhanden.\n" "Benutzen Sie 'update(..., legend = NULL)', um existierende\n" "Beschriftung(en) zu entfernen." msgid "log scales cannot be changed via 'update'" msgstr "logarithmische Skalen können nicht per 'update' geändert werden" msgid "" "the at and labels components of scales may not be lists when relation = same" msgstr "" "die 'at'- und 'labels'-Komponenten der Skalen sind möglicherweise keine " "Listen, wenn 'relation = same'" msgid "Unrecognized value of 'aspect': '%s'" msgstr "Nicht erkannter Wert von 'aspect': '%s'" msgid "Invalid value of 'aspect'" msgstr "Ungültiger Wert von 'aspect'" msgid "'drop=TRUE' ignored" msgstr "'drop=TRUE' ignoriert" msgid "Invalid indices" msgstr "Falsche Indizes" #~ msgid "missing values and NaN's not allowed if 'na.rm' is FALSE" #~ msgstr "fehlende Werte und NaNs nicht erlaubt, wenn 'na.rm' FALSE ist" #~ msgid "'probs' outside [0,1]" #~ msgstr "'probs' außerhalb [0,1]" #~ msgid "regression coefficients" #~ msgstr "Regressionskoeffizienten" #~ msgid "" #~ "Note: you shouldn't be seeing this message unless\n" #~ "you are using a non-standard version of lattice" #~ msgstr "" #~ "Anmerkung: Sie sollten die Nachricht nicht sehen, außer\n" #~ "Sie benutzen eine Nicht-Standard-Version von Lattice." #~ msgid "" #~ "The grid package couldn't be loaded.\n" #~ "Please check your installation of R" #~ msgstr "" #~ "Das grid-Paket konnte nicht geladen werden.\n" #~ "Bitte prüfen Sie Ihre Installation von R." #~ msgid "at least one element of layout must be positive" #~ msgstr "mindestens ein Element des Layouts muss positiv sein" #~ msgid "" #~ "'packet.number' and 'panel.number' are no longer supplied to the panel " #~ "function. See ?packet.number" #~ msgstr "" #~ "'packet.number' und 'panel.number' werden nicht länger an die 'panel'-" #~ "Funktion weitergereicht. Siehe ?packet.number" #~ msgid "currently saved object is not the last one plotted" #~ msgstr "derzeit gespeichertes Objekt ist nicht das zuletzt dargestellte" lattice/po/R-lattice.pot0000644000176200001440000001717614772676012014715 0ustar liggesusersmsgid "" msgstr "" "Project-Id-Version: lattice 0.22-7\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" msgid "Invalid value of 'log'" msgstr "" msgid "'at' missing or incompatible with 'labels'" msgstr "" msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" msgid "range too small for min.n" msgstr "" msgid "'origin' forced to 0 for stacked bars" msgstr "" msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "" msgid "%s must be length 1 or a vector of \n length multiple of group length (%d)" msgstr "" msgid "," msgstr "" msgid "explicit 'data' specification ignored" msgstr "" msgid "mismatch in number of packets" msgstr "" msgid "'type' has unsupported values" msgstr "" msgid "Inappropriate arguments" msgstr "" msgid "shingles can not be concatenated" msgstr "" msgid "model must be a formula object" msgstr "" msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "" msgid "invalid dimension '%s'" msgstr "" msgid "invalid model" msgstr "" msgid "newFactor cannot be NULL; you have found a bug!" msgstr "" msgid "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "" msgid "Length check mismatch; you have found a bug!" msgstr "" msgid "Non matching lengths" msgstr "" msgid "'length' and 'prop' cannot both be specified" msgstr "" msgid "'length' must be positive" msgstr "" msgid "improper length of 'lim'" msgstr "" msgid "Invalid value of perm.cond" msgstr "" msgid "Invalid value of index.cond" msgstr "" msgid "skip cannot be all TRUE" msgstr "" msgid "layout must have at least 2 elements" msgstr "" msgid "Inadmissible value of layout." msgstr "" msgid "invalid value for layout" msgstr "" msgid "More pages in layout than seem to be necessary." msgstr "" msgid "a formula must be specified for the 'data.frame' method" msgstr "" msgid "'formula' must be a formula object" msgstr "" msgid "Density" msgstr "" msgid "Can't have log Y-scale" msgstr "" msgid "type='%s' can be misleading in this context" msgstr "" msgid "problem with 'hist' computations" msgstr "" msgid "Count" msgstr "" msgid "Percent of Total" msgstr "" msgid "no observations within" msgstr "" msgid "points" msgstr "" msgid "nearest observation already identified" msgstr "" msgid "column must be specified" msgstr "" msgid "row must be specified" msgstr "" msgid "panel position unspecified or invalid" msgstr "" msgid "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first" msgstr "" msgid "Plot object was not saved, cannot retrieve panel data" msgstr "" msgid "Plot spans multiple pages, only last page can be updated" msgstr "" msgid "You have to first select a panel using trellis.focus()" msgstr "" msgid "Selecting panel at position (%g, %g)" msgstr "" msgid "No panels available" msgstr "" msgid "Click on panel to focus" msgstr "" msgid "'f.value' not supported; ignoring" msgstr "" msgid "Click to choose one point to highlight" msgstr "" msgid "no points within" msgstr "" msgid "points of click" msgstr "" msgid "component '%s' duplicated in key and legend" msgstr "" msgid "key must be a list" msgstr "" msgid "first component of text must be vector of labels" msgstr "" msgid "Invalid key, need at least one component named lines, text, rect or points" msgstr "" msgid "not enough rows for columns" msgstr "" msgid "Sorry, align=FALSE is not supported" msgstr "" msgid "'at' values are not equispaced; output may be wrong" msgstr "" msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" msgid "malformed colorkey" msgstr "" msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "" msgid "Invalid 'shrink' parameter ignored" msgstr "" msgid "Invalid label.style" msgstr "" msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "" msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "" msgid "'x' values are not equispaced; output may be wrong" msgstr "" msgid "'y' values are not equispaced; output may be wrong" msgstr "" msgid "x must be (coercible to be) a factor" msgstr "" msgid "error" msgstr "" msgid "Invalid value of 'pos' ignored." msgstr "" msgid "(loaded the KernSmooth namespace)" msgstr "" msgid "panel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespace" msgstr "" msgid "'nbin' must be numeric of length 1 or 2" msgstr "" msgid "'bandwidth' must be numeric" msgstr "" msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "" msgid "'a' is overridden by 'reg'" msgstr "" msgid "only using the first two of %d regression coefficients" msgstr "" msgid "'a' and 'b' are overridden by 'coef'" msgstr "" msgid "'expr' must be a function or an expression containing 'x'" msgstr "" msgid "'varnames' has wrong length." msgstr "" msgid "Parallel Coordinate Plot" msgstr "" msgid "cannot have log y-scale" msgstr "" msgid "Error using packet %g\n%s" msgstr "" msgid "y must have exactly 2 levels" msgstr "" msgid "Can't have log X-scale" msgstr "" msgid "Fitted Values minus Mean" msgstr "" msgid "Residuals" msgstr "" msgid "Invalid or ambiguous component names:" msgstr "" msgid "Multiple matches to component name" msgstr "" msgid "the 'at' and 'labels' components of 'scales' may not be lists when 'relation = \"same\"'" msgstr "" msgid "limits cannot be a list when relation = same" msgstr "" msgid "Explicitly specified limits ignored" msgstr "" msgid "need at least one panel" msgstr "" msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "" msgid "Note: The default device has been opened to honour attempt to modify trellis settings" msgstr "" msgid "Invalid 'theme' specified" msgstr "" msgid "Could not find device function '%s'" msgstr "" msgid "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "" msgid "x must be a shingle" msgstr "" msgid "x must be matrix with 2 columns" msgstr "" msgid "bad value of 'intervals'" msgstr "" msgid "Data:" msgstr "" msgid "no intervals" msgstr "" msgid "Intervals:" msgstr "" msgid "Overlap between adjacent intervals:" msgstr "" msgid "Range" msgstr "" msgid "Panel" msgstr "" msgid "Scatter Plot Matrix" msgstr "" msgid "Call:" msgstr "" msgid "Number of observations:" msgstr "" msgid "supplied 'dimnames' have wrong length" msgstr "" msgid "some components of supplied 'dimnames' have wrong length" msgstr "" msgid "mean" msgstr "" msgid "difference" msgstr "" msgid "Requested 'trellis' object was not saved" msgstr "" msgid "Inappropriate value of 'as.table'" msgstr "" msgid "'par.strip.text' must be a list" msgstr "" msgid "'par.settings' must be a list" msgstr "" msgid "'plot.args' must be a list" msgstr "" msgid "'lattice.options' must be a list" msgstr "" msgid "Invalid value of 'perm.cond'" msgstr "" msgid "Note: 'auto.key' ignored since legend already present.\nUse 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" msgid "log scales cannot be changed via 'update'" msgstr "" msgid "the at and labels components of scales may not be lists when relation = same" msgstr "" msgid "Unrecognized value of 'aspect': '%s'" msgstr "" msgid "Invalid value of 'aspect'" msgstr "" msgid "'drop=TRUE' ignored" msgstr "" msgid "Invalid indices" msgstr "" lattice/po/R-ko.po0000644000176200001440000004024114772676012013502 0ustar liggesusers# Korean translation for R lattice package # Recommended/lattice/po/R-ko.po # Maintainer: Deepayan Sarkar # # This file is distributed under the same license as the R lattice package. # Chel Hee Lee , 2013-2015 # # Reviewing source codes for translation is in progress (05-FEB-2015) # Reviewing process is in progress (05-FEB-2015) # QC: PASS # Freezing on 06-FEB-2015 for R-3.1.3 # msgid "" msgstr "" "Project-Id-Version: R 3.2.0\n" "Report-Msgid-Bugs-To: bugs.r-project.org\n" "POT-Creation-Date: 2025-03-31 17:47\n" "PO-Revision-Date: 2015-02-09 00:06-0600\n" "Last-Translator:Chel Hee Lee \n" "Language-Team: Chel Hee Lee \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "Invalid value of 'log'" msgstr "'log' 값이 올바르지 않습니다." msgid "'at' missing or incompatible with 'labels'" msgstr "'at'의 값이 누락되었거나 'labels'의 길이와 일치하지 않습니다." msgid "specifying 'labels' but not 'at' may lead to unexpected results" msgstr "" msgid "range too small for min.n" msgstr "" msgid "'origin' forced to 0 for stacked bars" msgstr "" "분할된 바챠트(stacked bars)의 경우에 'origin'의 값은 자동으로 0으로 변경됩니" "다." msgid "length of '%s' must be 1 or multiple of group length (%d)" msgstr "" msgid "" "%s must be length 1 or a vector of \n" " length multiple of group length (%d)" msgstr "" msgid "," msgstr "," msgid "explicit 'data' specification ignored" msgstr "'data' 인자에 지정된 이름을 가진 데이터셋을 이용하지 않았습니다." msgid "mismatch in number of packets" msgstr "패킷(packet)의 개수가 올바르지 않습니다." msgid "'type' has unsupported values" msgstr "입력된 'type'의 값은 사용할 수 없습니다." msgid "Inappropriate arguments" msgstr "인자들이 올바르게 입력되지 않았습니다." msgid "shingles can not be concatenated" msgstr "슁글(shingles)은 연결(concatenated)될 수 없습니다." msgid "model must be a formula object" msgstr "model에 입력된 객체의 클래스는 반드시 포뮬러(formula)이어야 합니다." msgid "'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')" msgstr "" "'outer=FALSE'이며 'group'에 NULL이 아닌 값이 주어졌으므로 'multiple=TRUE'는 " "사용되지 않습니다." msgid "invalid dimension '%s'" msgstr "'%s'은 사용할 수 없는 차원수(dimension)입니다." msgid "invalid model" msgstr "사용할 수 있는 모형이 아닙니다." msgid "newFactor cannot be NULL; you have found a bug!" msgstr "newFactor는 NULL이 될 수 없습니다. 당신은 버그(bug)를 찾았습니다. " msgid "" "newFactor != NULL && groups == NULL does not hold; you have found a bug!" msgstr "" "newFactor != NULL && groups == NULL이 될 수 없습니다. 당신은 버그(bug)를 찾" "았습니다." msgid "Length check mismatch; you have found a bug!" msgstr "newFactor의 길이가 올바르지 않습니다. 당신은 버그(bug)를 찾았습니다." msgid "Non matching lengths" msgstr "dx의 길이와 dy의 길이가 서로 일치하지 않습니다." msgid "'length' and 'prop' cannot both be specified" msgstr "'length'와 'prop'를 동시에 함께 지정해서는 안됩니다." msgid "'length' must be positive" msgstr "'length'는 반드시 양수이어야 합니다" msgid "improper length of 'lim'" msgstr "'lim'의 길이가 올바르지 않습니다." msgid "Invalid value of perm.cond" msgstr "perm.cond의 값이 올바르지 않습니다." msgid "Invalid value of index.cond" msgstr "index.cond의 값이 올바르지 않습니다." msgid "skip cannot be all TRUE" msgstr "skip의 값들 모두가 TRUE가 될 수는 없습니다." msgid "layout must have at least 2 elements" msgstr "layout은 반드시 최소한 2개의 요소를 가지고 있어야 합니다." msgid "Inadmissible value of layout." msgstr "layout에 사용할 수 없는 값이 발견되었습니다." msgid "invalid value for layout" msgstr "layout에 사용할 수 없는 값이 발견되었습니다." msgid "More pages in layout than seem to be necessary." msgstr "layout에 필요이상의 페이지가 있는 것 같습니다." msgid "a formula must be specified for the 'data.frame' method" msgstr "" #, fuzzy msgid "'formula' must be a formula object" msgstr "model에 입력된 객체의 클래스는 반드시 포뮬러(formula)이어야 합니다." msgid "Density" msgstr "밀도(density)" msgid "Can't have log Y-scale" msgstr "log Y-scale을 가질 수 없습니다." msgid "type='%s' can be misleading in this context" msgstr "type='%s'은 문맥상 올바르게 이해되지 않을 수 있습니다." msgid "problem with 'hist' computations" msgstr "'hist' 함수를 이용한 계산에서 문제가 발생했습니다." msgid "Count" msgstr "개수(count)" msgid "Percent of Total" msgstr "백분율(percent of total)" msgid "no observations within" msgstr "no observations within" msgid "points" msgstr "points" msgid "nearest observation already identified" msgstr "가장 가까운 관측값이 이미 확인되었습니다." msgid "column must be specified" msgstr "column의 값은 반드시 주어져야 합니다." msgid "row must be specified" msgstr "row의 값은 반드시 주어져야 합니다." msgid "panel position unspecified or invalid" msgstr "패널의 위치(panel position)이 지정되지 않았거나 올바르지 않습니다." msgid "" "'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use " "'trellis.focus' first" msgstr "" "'trellis.switchFocus'는 다른 'prefix'로 전환하는데 사용할 수 없습니다. 먼저 " "'trellis.focus'를 사용해 보시길 바랍니다." msgid "Plot object was not saved, cannot retrieve panel data" msgstr "플롯객체가 저장되지 않았기 때문에 패널데이터를 불러올 수 없습니다." msgid "Plot spans multiple pages, only last page can be updated" msgstr "" "플롯이 여러 페이지에 걸쳐 이어지고 있는데, 오로지 마지막 페이지만이 업데이트 " "될 수 있습니다." msgid "You have to first select a panel using trellis.focus()" msgstr "먼저 trellis.focus()를 이용하여 패널을 선택해야 합니다." msgid "Selecting panel at position (%g, %g)" msgstr "(%g, %g)의 위치에서 패널을 선택합니다." msgid "No panels available" msgstr "이용가능한 패널이 없습니다." msgid "Click on panel to focus" msgstr "포커스(focus)할 패널을 클릭하세요." msgid "'f.value' not supported; ignoring" msgstr "'f.value'은 사용되지 않습니다." msgid "Click to choose one point to highlight" msgstr "강조해야할 한 점을 선택하기 위하기 클릭하세요." msgid "no points within" msgstr "no points within" msgid "points of click" msgstr "points of click" msgid "component '%s' duplicated in key and legend" msgstr "구성요소 '%s'가 key와 legend 양쪽 모두로부터 발견되었습니다." msgid "key must be a list" msgstr "key는 반드시 리스트(list)이어야 합니다" msgid "first component of text must be vector of labels" msgstr "" "text의 첫번째 구성요소는 반드시 라벨을 구성요소로 가진 벡터이어야 합니다." msgid "" "Invalid key, need at least one component named lines, text, rect or points" msgstr "" "사용할 수 없는 key입니다. 최소한 이름이 주어진 line, text, rect 또는 point" "와 같은 구성요소가 하나 이상 필요합니다." msgid "not enough rows for columns" msgstr "" msgid "Sorry, align=FALSE is not supported" msgstr "죄송합니다. align=FALSE는 지원되지 않습니다." msgid "'at' values are not equispaced; output may be wrong" msgstr "" "'at'의 값이 균등(equispaced)하지 않아 출력이 올바르게 표현되지 않을 수 있습니" "다." msgid "key specifies 'labels$labels' but not 'labels$at'" msgstr "" msgid "lengths of key's 'labels$labels' and 'labels$at' differ" msgstr "" msgid "malformed colorkey" msgstr "잘못된 컬러키(colorkey)입니다." msgid "Invalid value of 'tri.upper/tri.lower' ignored." msgstr "'tri.upper/tri.lower'의 값이 올바르지 않아 무효처리 되었습니다." msgid "Invalid 'shrink' parameter ignored" msgstr "'shrink'의 값이 올바르지 않아 무효처리 되었습니다." msgid "Invalid label.style" msgstr "올바른 label.styel이 아닙니다." msgid "device support for raster images unknown, ignoring 'raster=TRUE'" msgstr "" "래스터 이미지(raster image)를 지원하는 장치를 확인할 수 없어 'raster=TRUE'는 " "무효처리 됩니다." msgid "device has no raster support, ignoring 'raster=TRUE'" msgstr "" "장치가 래스터(raster)를 지원하지 않기 때문에 'raster=TRUE'는 무효처리 됩니다." msgid "device does not support raster images with NA, ignoring 'raster=TRUE'" msgstr "" msgid "'x' values are not equispaced; output may be wrong" msgstr "" "'x'의 값들이 균등(equispaced)하지 않아 출력이 올바르지 않을 수 있습니다." msgid "'y' values are not equispaced; output may be wrong" msgstr "" "'y'의 값들이 균등(equispaced)하지 않아 출력이 올바르지 않을 수 있습니다." msgid "x must be (coercible to be) a factor" msgstr "x는 반드시 요인(factor)이거나 요인으로 강제변환이 될 수 있어야 합니다." msgid "error" msgstr "에러" msgid "Invalid value of 'pos' ignored." msgstr "'pos'의 값이 올바르지 않아 무효처리 되었습니다." msgid "(loaded the KernSmooth namespace)" msgstr "(KernSmooth 패키지를 로딩했습니다)" msgid "" "panel.smoothScatter() requires the KernSmooth package, but unable to load " "KernSmooth namespace" msgstr "" "panel.smoothScatter()는 KernSmooth 패키지를 필요로 하는데 KernSmooth를 로딩" "할 수 없습니다." msgid "'nbin' must be numeric of length 1 or 2" msgstr "'nbin'은 반드시 길이가 1 또는 2인 수치형이어야 합니다." msgid "'bandwidth' must be numeric" msgstr "'bandwidth'는 반드시 수치형이어야 합니다." msgid "'nrpoints' should be numeric scalar with value >= 0." msgstr "" "'nrpoints'는 반드시 0 이상의 값을 가지는 수치형 스칼라(scalar)이어야 합니다." msgid "'a' is overridden by 'reg'" msgstr "'a'는 'reg'에 의하여 무효화되었습니다." #, fuzzy msgid "only using the first two of %d regression coefficients" msgstr "오로지 " msgid "'a' and 'b' are overridden by 'coef'" msgstr "'a'와 'b'는 'coef'에 의하여 무효처리 되었습니다." msgid "'expr' must be a function or an expression containing 'x'" msgstr "" "'expr'는 반드시 함수(function) 또는 'x'를 포함하는 표현식(expression)이어야 " "합니다." msgid "'varnames' has wrong length." msgstr "'varnames'의 길이가 올바르지 않습니다." msgid "Parallel Coordinate Plot" msgstr "평행좌표 플랏(parallel coordinate plot)" msgid "cannot have log y-scale" msgstr "log y-scale을 가질 수 없습니다." msgid "" "Error using packet %g\n" "%s" msgstr "" "패킷 %g을 사용하는데 에러가 발견되었습니다.\n" "%s" msgid "y must have exactly 2 levels" msgstr "y는 반드시 2개의 수준(levels)을 가지고 있어야 합니다." msgid "Can't have log X-scale" msgstr "log X-scale을 가질 수 없습니다." msgid "Fitted Values minus Mean" msgstr "적합된 값으로부터 평균을 뺀 차이" msgid "Residuals" msgstr "잔차(residuals)" msgid "Invalid or ambiguous component names:" msgstr "" msgid "Multiple matches to component name" msgstr "" msgid "" "the 'at' and 'labels' components of 'scales' may not be lists when 'relation " "= \"same\"'" msgstr "" "'scales'의 구성요소 'at'과 'labels'가 'relation = \"same\"'인 경우에 리스트" "(list)가 아닐지도 모릅니다." msgid "limits cannot be a list when relation = same" msgstr "relation = same인 경우에는 limits가 리스트(list)가 될 수 없습니다." msgid "Explicitly specified limits ignored" msgstr "입력된 limits가 무효처리 되었습니다." msgid "need at least one panel" msgstr "최소한 하나 이상의 패널이 필요합니다" msgid "'aspect=\"iso\"' approximate since 'relation=\"free\"'" msgstr "" msgid "" "Note: The default device has been opened to honour attempt to modify trellis " "settings" msgstr "" "노트: 트렐리스 설정(trellis setting)을 수정하기 위하여 기본장치가 열렸습니다." msgid "Invalid 'theme' specified" msgstr "입력된 'theme'의 값이 올바르지 않습니다." msgid "Could not find device function '%s'" msgstr "장치 함수(device function) '%s'를 찾을 수 없습니다." msgid "" "'trellis.device' has changed, 'bg' may not be doing what you think it is" msgstr "" "'rellis.device'가 변경되었습니다. 'bg'는 아마도 생각하는 것과 같이 수행되지 " "않을 수 있습니다." msgid "x must be a shingle" msgstr "x는 반드시 슁글(shingle)이어야 합니다." msgid "x must be matrix with 2 columns" msgstr "x는 반드시 2개의 열을 가진 행렬이어야 합니다" msgid "bad value of 'intervals'" msgstr "'intervals'의 값이 올바르지 않습니다." msgid "Data:" msgstr "데이터(data):" msgid "no intervals" msgstr "구간(intervals)이 없습니다" msgid "Intervals:" msgstr "구간(intervals):" msgid "Overlap between adjacent intervals:" msgstr "" "다음은 서로 겹치는 부분을 가진 이웃한 구간(adjacent intervals)들입니다:" msgid "Range" msgstr "범위(Range)" msgid "Panel" msgstr "패널(Panel)" msgid "Scatter Plot Matrix" msgstr "산점도 행렬(scatter plot matrix)" msgid "Call:" msgstr "호출(Call):" msgid "Number of observations:" msgstr "관측치의 개수:" msgid "supplied 'dimnames' have wrong length" msgstr "주어진 'dimnames'의 길이가 잘못되었습니다." msgid "some components of supplied 'dimnames' have wrong length" msgstr "입력된 'dimnames'의 일부 구성요소들의 길이가 올바르지 않습니다." msgid "mean" msgstr "평균(mean)" msgid "difference" msgstr "차이(difference)" msgid "Requested 'trellis' object was not saved" msgstr "요청된 'trellis' 객체가 저장되지 않았습니다." msgid "Inappropriate value of 'as.table'" msgstr "'as.table'의 값이 올바르지 않습니다." msgid "'par.strip.text' must be a list" msgstr "'par.strip.text'는 반드시 리스트(list)이어야 합니다" msgid "'par.settings' must be a list" msgstr "'par.settings'는 반드시 리스트(list)이어야 합니다" msgid "'plot.args' must be a list" msgstr "'plot.args'는 반드시 리스트(list)이어야 합니다" msgid "'lattice.options' must be a list" msgstr "'lattice.options'은 반드시 리스트(list)이어야 합니다." msgid "Invalid value of 'perm.cond'" msgstr "'perm.cond'의 값이 올바르지 않습니다." msgid "" "Note: 'auto.key' ignored since legend already present.\n" "Use 'update(..., legend = NULL)' to remove existing legend(s)" msgstr "" "노트: 범례(legend)가 이미 존재하기 때문에 'auto.key'는 무효처리 됩니다.\n" "기존의 범례를 제거하기 위해서는 'update(..., legend = NULL)'를 사용하시길 바" "랍니다." msgid "log scales cannot be changed via 'update'" msgstr "'update'를 이용하여 로그변환된 값(log scales)들을 변경할 수 없습니다." msgid "" "the at and labels components of scales may not be lists when relation = same" msgstr "" "scales의 구성요소 at과 labels은 relation = same 인 경우에 리스트(list)가 아" "닐 수도 있습니다." msgid "Unrecognized value of 'aspect': '%s'" msgstr "다음에 인식할 수 없는 'aspect'의 값이 있습니다: '%s'" msgid "Invalid value of 'aspect'" msgstr "'aspect'의 값이 잘못되었습니다" msgid "'drop=TRUE' ignored" msgstr "'drop=TRUE'이 무시되었습니다" msgid "Invalid indices" msgstr "잘못된 인덱스입니다" #~ msgid "missing values and NaN's not allowed if 'na.rm' is FALSE" #~ msgstr "'na.rm'가 FALSE이라면 결측값 또는 NaN이 있어서는 안됩니다." #~ msgid "'probs' outside [0,1]" #~ msgstr "'probs'가 [0,1] 범위 밖에 있습니다" #~ msgid "regression coefficients" #~ msgstr "개의 회귀 계수들 중에서 처음 두개만을 사용합니다." lattice/R/0000755000176200001440000000000014772676012012114 5ustar liggesuserslattice/R/shingle.R0000644000176200001440000001311614772676012013672 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA "[.shingle" <- function(x, subset, drop = FALSE) { if (!is.shingle(x)) stop("x must be a shingle") ans <- as.numeric(x)[subset] attr(ans, "levels") <- levels(x) class(attr(ans, "levels")) <- "shingleLevel" if (drop) { xlvs <- levels(ans) dl <- logical(nlevels(ans)) for (i in seq_along(dl)) dl[i] <- any( ans >= xlvs[[i]][1] & ans <= xlvs[[i]][2] ) attr(ans, "levels") <- xlvs[dl] class(attr(ans, "levels")) <- "shingleLevel" } class(ans) <- "shingle" ans } make.list.from.intervals <- function(x) { if (ncol(x) != 2) stop("x must be matrix with 2 columns") ans <- vector(mode = "list", length = nrow(x)) for (i in seq_len(nrow(x))) ans[[i]] <- x[i,] ans } equal.count <- function(x, ...) { attr(x, "levels") <- make.list.from.intervals(co.intervals(x,...)) class(attr(x, "levels")) <- "shingleLevel" class(x) <- "shingle" x } shingle <- function(x, intervals=sort(unique(x))) { if (ncol(as.matrix(intervals))==1) intervals <- cbind(intervals, intervals, deparse.level = 0) else if (ncol(as.matrix(intervals)) > 2) stop("bad value of 'intervals'") attr(x, "levels") <- make.list.from.intervals(intervals) class(attr(x, "levels")) <- "shingleLevel" class(x) <- "shingle" x } as.data.frame.shingle <- function(x, row.names = NULL, optional = FALSE, ..., nm = deparse1(substitute(x))) { as.data.frame.vector(x, row.names = row.names, optional = optional, ..., nm = nm) } is.shingle <- function(x) inherits(x, "shingle") as.shingle <- function(x) if (is.shingle(x)) x else shingle(x) summary.shingle <- function(object, showValues = FALSE, ...) print.shingle(object, showValues = showValues, ...) as.character.shingleLevel <- function(x, ...) { interval2string <- function(x) { stopifnot(length(x) == 2) if (x[1] == x[2]) paste("{ ", x[1], " }", sep = "") else paste("[ ", x[1], ", ", x[2], " ]", sep = "") } sapply(x, interval2string) } print.shingleLevel <- function(x, ...) { print(do.call("rbind", x)) invisible(x) } print.shingle <- function(x, showValues = TRUE, ...) { if (showValues) { cat(gettext("\nData:\n")) print(as.numeric(x)) } l <- levels(x) n <- nlevels(x) if (n < 1) cat(gettext("\nno intervals\n")) else { int <- data.frame(min = numeric(n), max = numeric(n), count = numeric(n)) for (i in 1:n) { int$min[i] <- l[[i]][1] int$max[i] <- l[[i]][2] int$count[i] <- length(x[x>=l[[i]][1] & x<=l[[i]][2]]) } cat(gettext("\nIntervals:\n")) print(int) olap <- numeric(n-1) for (i in seq_len(n - 1)) olap[i] <- length(x[x >= l[[i]][1] & x <= l[[i]][2] & x >= l[[i+1]][1] & x <= l[[i+1]][2]]) cat(gettext("\nOverlap between adjacent intervals:\n")) print(olap) } invisible(x) } plot.shingle <- function(x, panel = panel.shingle, xlab = gettext("Range"), ylab = gettext("Panel"), ...) { ocall <- sys.call(); ocall[[1]] <- quote(plot) panel.shingle <- function(x, y, col = plot.polygon$col, lty = plot.polygon$lty, lwd = plot.polygon$lwd, alpha = plot.polygon$alpha, border = plot.polygon$border, ...) { plot.polygon <- trellis.par.get("plot.polygon") n <- nlevels(y) if (n > 0) lrect(xleft = x[1 + 2 * (0:(n-1))], xright = x[2 + 2 * (0:(n-1))], y = 1:n, height = 0.5, col = col, lty = lty, alpha = alpha, border = border, ...) } x <- levels(x) ans <- bwplot(factor(rep(seq_len(length(x)), each = 2)) ~ unlist(x), xlab = xlab, ylab = ylab, panel = panel, ...) ans$call <- ocall ans } ## as.factor.shingle <- function(x) ## { ## slevels <- unlist(levels(x)) ## if (is.unsorted(slevels)) ## { ## ## Overlapping levels. Will use overlaps as additional levels ## breaks <- sort(unique(slevels)) ## } ## else if (any(slevels[c(TRUE, FALSE)] == slevels[c(FALSE, TRUE)])) ## { ## ## Some intervals are singleton points. ## ## FIXME: This doesn't work ## breaks <- unique(slevels) ## } ## else ## { ## breaks <- unique(slevels) ## } ## cut(as.numeric(x), breaks = breaks, ## include.lowest = TRUE, right = TRUE)[drop = TRUE] ## } lattice/R/legend.R0000644000176200001440000021727114413526777013513 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA construct.legend <- function(legend = NULL, key = NULL, fun = "draw.key") { if (is.null(legend) && is.null(key)) return(NULL) if (is.null(legend)) legend <- list() if (!is.null(key)) { space <- key$space x <- y <- corner <- NULL if (is.null(space)) { if (any(c("x", "y", "corner") %in% names(key))) { stopifnot(is.null(x) || (length(x) == 1 && x >= 0 && x <= 1)) stopifnot(is.null(y) || (length(y) == 1 && y >= 0 && y <= 1)) stopifnot(is.null(corner) || (length(corner) == 2 && all(corner %in% c(0, 1)))) space <- "inside" x <- key$x y <- key$y corner <- key$corner ## check for valid values } else space <- "top" } if (space != "inside" && space %in% names(legend)) stop(gettextf("component '%s' duplicated in key and legend", space)) key.legend <- list(fun = fun, args = list(key = key, draw = FALSE)) key.legend$x <- x key.legend$y <- y key.legend$corner <- corner legend <- c(list(key.legend), legend) names(legend)[1] <- space } legend } ## A convenience function for deciding whether an ``automatic'' legend ## should be drawn following instructions contained in the 'auto.key' ## argument. needAutoKey <- function(auto.key, groups = NULL) { ((!is.null(groups) && (isTRUE(auto.key) || is.list(auto.key))) || (is.list(auto.key) && !is.null(auto.key$text))) ## old behaviour was: ## !is.null(groups) && (is.list(auto.key) || isTRUE(auto.key)) } ## Pick a position for the legend based on its contents. Mainly used ## for 'auto.key' via 'drawSimpleKey()'. Explicit 'space' is honored ## in preference to anything else, otherwise 'right', unless 'columns ## > 1'. defaultLegendPosition <- function(x) { if (!is.null(x$space)) return(x$space) if (any(c("x", "y", "corner") %in% names(x))) "inside" else if (!is.null(x$columns) && any(x$columns > 1)) "top" else "right" } autoKeyLegend <- function(args, more) { if (is.list(more)) args <- updateList(args, more) legend <- list(list(fun = "drawSimpleKey", args = args)) ## These should be missing rather than NULL, so assigned separately legend[[1]]$x <- legend[[1]]$args$x legend[[1]]$y <- legend[[1]]$args$y legend[[1]]$corner <- legend[[1]]$args$corner names(legend) <- defaultLegendPosition(legend[[1]]$args) legend } ## convenience function for auto.key drawSimpleKey <- function(...) draw.key(simpleKey(...), draw = FALSE) ## convenience function for the most common type of key simpleKey <- function(text, points = TRUE, rectangles = FALSE, lines = FALSE, col = add.text$col, cex = add.text$cex, alpha = add.text$alpha, font = add.text$font, fontface = add.text$fontface, fontfamily = add.text$fontfamily, lineheight = add.text$lineheight, ...) { add.text <- trellis.par.get("add.text") foo <- seq_along(text) ans <- list(text = list(lab = text), col = col, cex = cex, alpha = alpha, font = font, fontface = fontface, fontfamily = fontfamily, ...) if (points) ans$points <- Rows(trellis.par.get("superpose.symbol"), foo) if (rectangles) ans$rectangles <- Rows(trellis.par.get("superpose.polygon"), foo) if (lines) ans$lines <- updateList(Rows(trellis.par.get("superpose.symbol"), foo), ## for pch Rows(trellis.par.get("superpose.line"), foo)) ans } componentName <- function(name, x, y) { trellis.grobname(paste(name, x, y, sep="."), type="key") } draw.key <- function(key, draw = FALSE, vp = NULL, ...) { if (!is.list(key)) stop("key must be a list") max.length <- 0 ## maximum of the `row-lengths' of the above ## components. There is some scope for confusion ## here, e.g., if col is specified in key as a ## length 6 vector, and then lines=list(lty=1:3), ## what should be the length of that lines column ? ## If 3, what happens if lines=list() ? ## (Strangely enough, S+ accepts lines=list() ## if col (etc) is NOT specified outside, but not ## if it is) process.key <- function(reverse.rows = FALSE, ## invert rows (e.g. for barchart, stack = FALSE) between = 2, align = TRUE, title = NULL, rep = TRUE, background = trellis.par.get("background")$col, alpha.background = 1, border = FALSE, transparent = FALSE, col = "black", alpha = 1, lty = 1, lwd = 1, font = 1, fontface = NULL, fontfamily = NULL, pch = 8, cex = 1, fill = "transparent", adj = 0, type = "l", size = 5, height = 1, angle = 0, density = -1, cex.title = 1.5 * max(cex), padding.text = 1, lineheight = 1, columns = 1, divide = 3, between.columns = 3, ## to avoid partial matching, anything starting with ## lines, points, rect, text must come after ... ..., lines.title = 2) { list(reverse.rows = reverse.rows, between = between, align = align, title = title, rep = rep, background = background, alpha.background = alpha.background, border = border, transparent = transparent, col = col, alpha = alpha, lty = lty, lwd = lwd, font = font, fontface = fontface, fontfamily = fontfamily, pch = pch, cex = cex, fill = fill, adj = adj, type = type, size = size, height = height, angle = angle, density = density, cex.title = cex.title, padding.text = padding.text, lineheight = lineheight, columns = columns, divide = divide, between.columns = between.columns, lines.title = lines.title, ...) } fontsize.points <- trellis.par.get("fontsize")$points key <- do.call(process.key, key, quote = TRUE) key.length <- length(key) key.names <- names(key) # Need to update if (is.logical(key$border)) key$border <- if (key$border) "black" else "transparent" components <- list() for(i in 1:key.length) { curname <- pmatch(key.names[i], c("text", "rectangles", "lines", "points")) if (is.na(curname)) { ;## do nothing } else if (curname == 1) # "text" { if (!(is.characterOrExpression(key[[i]][[1]]))) stop("first component of text must be vector of labels") pars <- list(labels = key[[i]][[1]], col = key$col, alpha = key$alpha, adj = key$adj, cex = key$cex, lineheight = key$lineheight, font = key$font, fontface = key$fontface, fontfamily = key$fontfamily) pars <- pars[!sapply(pars, is.null)] # remove NULL components key[[i]][[1]] <- NULL key[[i]] <- complete_names(key[[i]], pars, allow.invalid = TRUE) pars[names(key[[i]])] <- key[[i]] tmplen <- length(pars$labels) for (j in 1:length(pars)) if (is.character(pars)) pars[[j]] <- rep(pars[[j]], length.out = tmplen) max.length <- max(max.length, tmplen) components[[length(components)+1]] <- list(type = "text", pars = pars, length = tmplen) } else if (curname == 2) # "rectangles" { pars <- list(col = key$col, border = "black", alpha = key$alpha, size = key$size, height = key$height, angle = key$angle, density = key$density) pars <- pars[!sapply(pars, is.null)] # remove NULL components key[[i]] <- complete_names(key[[i]], pars, allow.invalid = TRUE) pars[names(key[[i]])] <- key[[i]] tmplen <- max(unlist(lapply(pars,length))) max.length <- max(max.length, tmplen) components[[length(components)+1]] <- list(type = "rectangles", pars = pars, length = tmplen) } else if (curname == 3) # "lines" { pars <- list(col = key$col, alpha = key$alpha, size = key$size, lty = key$lty, cex = key$cex, pch = key$pch, fill = key$fill, lwd = key$lwd, type = key$type) pars <- pars[!sapply(pars, is.null)] # remove NULL components key[[i]] <- complete_names(key[[i]], pars, allow.invalid = TRUE) pars[names(key[[i]])] <- key[[i]] tmplen <- max(unlist(lapply(pars,length))) max.length <- max(max.length, tmplen) components[[length(components)+1]] <- list(type = "lines", pars = pars, length = tmplen) } else if (curname == 4) # "points" { pars <- list(col = key$col, alpha = key$alpha, cex = key$cex, pch = key$pch, lwd = key$lwd, fill = key$fill, font = key$font, fontface = key$fontface, fontfamily = key$fontfamily) pars <- pars[!sapply(pars, is.null)] # remove NULL components key[[i]] <- complete_names(key[[i]], pars, allow.invalid = TRUE) pars[names(key[[i]])] <- key[[i]] tmplen <- max(unlist(lapply(pars,length))) max.length <- max(max.length, tmplen) components[[length(components)+1]] <- list(type = "points", pars = pars, length = tmplen) } } number.of.components <- length(components) ## number of components named one of "text", ## "lines", "rectangles" or "points" if (number.of.components == 0) stop("Invalid key, need at least one component named lines, text, rect or points") ## The next part makes sure all components have same length, ## except text, which should be as long as the number of labels ## Update (9/11/2003): but that doesn't always make sense --- Re: ## r-help message from Alexander.Herr@csiro.au (though it seems ## that's S+ behaviour on Linux at least). Each component should ## be allowed to have its own length (that's what the lattice docs ## suggest too, don't know why). Anyway, I'm adding a rep = TRUE ## argument to the key list, which controls whether each column ## will be repeated as necessary to have the same length. for (i in seq_len(number.of.components)) { if (key$rep && (components[[i]]$type != "text")) components[[i]]$length <- max.length components[[i]]$pars <- lapply(components[[i]]$pars, rep, length.out = components[[i]]$length) if (key$reverse.rows) components[[i]]$pars <- lapply(components[[i]]$pars, rev) ## { ## if (key$rep) components[[i]]$length <- max.length ## components[[i]]$pars <- ## lapply(components[[i]]$pars, rep, components[[i]]$length) ## } ## else ## { ## components[[i]]$pars <- ## c(components[[i]]$pars[1], ## lapply(components[[i]]$pars[-1], rep, ## length.out = components[[i]]$length)) ## } } column.blocks <- key$columns rows.per.block <- ceiling(max.length/column.blocks) if (column.blocks > max.length) warning("not enough rows for columns") key$between <- rep(key$between, length.out = number.of.components) if (key$align) { ## Setting up the layout ## The problem of allocating space for text (character strings ## or expressions) is dealt with as follows: ## Each row and column will take exactly as much space as ## necessary. As steps in the construction, a matrix ## textMatrix (of same dimensions as the layout) will contain ## either 0, meaning that entry is not text, or n > 0, meaning ## that entry has the text given by textList[[n]], where ## textList is a list consisting of character strings or ## expressions. n.row <- rows.per.block + 1 n.col <- column.blocks * (1 + 3 * number.of.components) - 1 textMatrix <- matrix(0, n.row, n.col) textList <- list() textCex <- numeric(0) heights.x <- rep(1, n.row) heights.units <- rep("lines", n.row) heights.data <- vector(mode = "list", length = n.row) if (length(key$title) > 0) { stopifnot(length(key$title) == 1, is.characterOrExpression(key$title)) heights.x[1] <- key$lines.title * key$cex.title heights.units[1] <- "strheight" heights.data[[1]] <- key$title titleWidth <- unit(key$cex.title, "strwidth", data = list(key$title)) + unit(key$between[[1]], "strwidth", data = list("o")) } else { heights.x[1] <- 0 titleWidth <- unit(0, "mm") } widths.x <- rep(key$between.columns, n.col) widths.units <- rep("strwidth", n.col) widths.data <- as.list(rep("o", n.col)) ## FIXME: between is supposed to be in 'character widths'. Is ## there a better standard definition? Use "char" or "points" ## units? for (i in 1:column.blocks) { widths.x[(1:number.of.components-1)*3+1 + (i-1)*3*number.of.components + i-1] <- key$between/2 widths.x[(1:number.of.components-1)*3+1 + (i-1)*3*number.of.components + i+1] <- key$between/2 } index <- 1 for (i in 1:number.of.components) { cur <- components[[i]] id <- (1:column.blocks - 1) * (number.of.components * 3 + 1) + i * 3 - 1 if (cur$type == "text") { for (j in 1:cur$length) { colblck <- ceiling(j / rows.per.block) xx <- (colblck - 1) * (number.of.components * 3 + 1) + i * 3 - 1 yy <- j %% rows.per.block + 1 if (yy == 1) yy <- rows.per.block + 1 textMatrix[yy, xx] <- index textList <- c(textList, list(cur$pars$labels[j]) ) textCex <- c(textCex, cur$pars$cex[j]) index <- index + 1 } } ## FIXME: do the same as above for those below else if (cur$type == "rectangles") { widths.x[id] <- max(cur$pars$size) } else if (cur$type == "lines") { widths.x[id] <- max(cur$pars$size) } else if (cur$type == "points") { widths.x[id] <- max(cur$pars$cex) } } ## Need to adjust the heights and widths ## adjusting heights heights.insertlist.position <- 0 heights.insertlist.unit <- unit(1, "null") for (i in seq_len(n.row)) { textLocations <- textMatrix[i,] if (any(textLocations > 0)) { textLocations <- textLocations[textLocations>0] strbar <- textList[textLocations] heights.insertlist.position <- c(heights.insertlist.position, i) heights.insertlist.unit <- unit.c(heights.insertlist.unit, unit(.2 * key$padding.text, "lines") + max(unit(textCex[textLocations], "strheight", strbar))) } } layout.heights <- unit(heights.x, heights.units, data=heights.data) if (length(heights.insertlist.position)>1) for (indx in 2:length(heights.insertlist.position)) layout.heights <- rearrangeUnit(layout.heights, heights.insertlist.position[indx], heights.insertlist.unit[indx]) ## adjusting widths widths.insertlist.position <- 0 widths.insertlist.unit <- unit(1, "null") for (i in 1:n.col) { textLocations <- textMatrix[,i] if (any(textLocations > 0)) { textLocations <- textLocations[textLocations>0] strbar <- textList[textLocations] widths.insertlist.position <- c(widths.insertlist.position, i) widths.insertlist.unit <- unit.c(widths.insertlist.unit, max(unit(textCex[textLocations], "strwidth", strbar))) } } layout.widths <- unit(widths.x, widths.units, data=widths.data) if (length(widths.insertlist.position)>1) for (indx in 2:length(widths.insertlist.position)) layout.widths <- rearrangeUnit(layout.widths, widths.insertlist.position[indx], widths.insertlist.unit[indx]) key.layout <- grid.layout(nrow = n.row, ncol = n.col, widths = layout.widths, heights = layout.heights, respect = FALSE, just = if (is.null(key$just)) "center" else key$just) ## OK, layout set up, now to draw the key - no key.gf <- frameGrob(layout = key.layout, vp = vp, name = trellis.grobname("frame", type="key")) if (!key$transparent) key.gf <- placeGrob(key.gf, rectGrob(gp = gpar(fill = key$background, alpha = key$alpha.background, col = key$border), width = max(titleWidth, grobWidth(key.gf)), name = trellis.grobname("background", type="key")), row = NULL, col = NULL) else key.gf <- placeGrob(key.gf, rectGrob(gp = gpar(col = key$border), name = trellis.grobname("background", type="key")), row = NULL, col = NULL) ## Title (FIXME: allow color, font, alpha-transparency here? if (!is.null(key$title)) key.gf <- placeGrob(key.gf, textGrob(label = key$title, ## x = 0, gp = gpar(cex = key$cex.title, lineheight = key$lineheight), ## just = "left", name = trellis.grobname("title", type="key")), row = 1, col = NULL) for (i in 1:number.of.components) { cur <- components[[i]] for (j in seq_len(cur$length)) { colblck <- ceiling(j / rows.per.block) xx <- (colblck - 1) * (number.of.components*3 + 1) + i*3 - 1 yy <- j %% rows.per.block + 1 if (yy == 1) yy <- rows.per.block + 1 componentx <- (colblck - 1)*(number.of.components) + i componenty <- (j - 1) %% rows.per.block + 1 if (cur$type == "text") { key.gf <- placeGrob(key.gf, textGrob(x = cur$pars$adj[j], hjust = cur$pars$adj[j], ## just = c( ## if (cur$pars$adj[j] == 1) "right" ## else if (cur$pars$adj[j] == 0) "left" ## else "center", ## "center"), label = cur$pars$labels[j], gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], lineheight = cur$pars$lineheight[j], fontfamily = cur$pars$fontfamily[j], fontface = chooseFace(cur$pars$fontface[j], cur$pars$font[j]), cex = cur$pars$cex[j]), name = componentName("text", componentx, componenty)), row = yy, col = xx) } else if (cur$type == "rectangles") { key.gf <- placeGrob(key.gf, rectGrob(height = cur$pars$height[j], width = cur$pars$size[j] / max(cur$pars$size), default.units = "npc", ## centred, unlike S-PLUS, due to aesthetic reasons ! gp = gpar(alpha = cur$pars$alpha[j], fill = cur$pars$col[j], col = cur$pars$border[j]), name = componentName("rect", componentx, componenty)), row = yy, col = xx) ## FIXME: Need to make changes to support angle/density } else if (cur$type == "lines") { if (cur$pars$type[j] == "l") { key.gf <- placeGrob(key.gf, linesGrob(x = c(0,1) * cur$pars$size[j] / max(cur$pars$size), ## ^^ FIXME: this ## should be centered ## as well, but since ## the chances that ## someone would ## actually use this ## feature are ## astronomically ## small, I'm leaving ## that for later. y = c(.5, .5), gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], lty = cur$pars$lty[j], lwd = cur$pars$lwd[j]), name = componentName("lines", componentx, componenty)), row = yy, col = xx) } else if (cur$pars$type[j] == "p") { key.gf <- placeGrob(key.gf, pointsGrob(x = 0.5, y = 0.5, gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], cex = cur$pars$cex[j], fill = cur$pars$fill[j], fontfamily = cur$pars$fontfamily[j], fontface = chooseFace(cur$pars$fontface[j], cur$pars$font[j]), fontsize = fontsize.points), pch = cur$pars$pch[j], name = componentName("points", componentx, componenty)), row = yy, col = xx) } else # if (cur$pars$type[j] == "b" or "o") -- not differentiating { key.gf <- placeGrob(key.gf, linesGrob(x = c(0,1) * cur$pars$size[j]/max(cur$pars$size), ## ^^ this should be ## centered as well, ## but since the ## chances that ## someone would ## actually use this ## feature are ## astronomical, I'm ## leaving that for ## later. y = c(.5, .5), gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], lty = cur$pars$lty[j], lwd = cur$pars$lwd[j]), name = componentName("lines", componentx, componenty)), row = yy, col = xx) if (key$divide > 1) { key.gf <- placeGrob(key.gf, pointsGrob(x = (1:key$divide-1)/(key$divide-1), y = rep(.5, key$divide), gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], cex = cur$pars$cex[j], fill = cur$pars$fill[j], fontfamily = cur$pars$fontfamily[j], fontface = chooseFace(cur$pars$fontface[j], cur$pars$font[j]), fontsize = fontsize.points), pch = cur$pars$pch[j], name = componentName("points", componentx, componenty)), row = yy, col = xx) } else if (key$divide == 1) { key.gf <- placeGrob(key.gf, pointsGrob(x = 0.5, y = 0.5, gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], cex = cur$pars$cex[j], fill = cur$pars$fill[j], fontfamily = cur$pars$fontfamily[j], fontface = chooseFace(cur$pars$fontface[j], cur$pars$font[j]), fontsize = fontsize.points), pch = cur$pars$pch[j], name = componentName("points", componentx, componenty)), row = yy, col = xx) } } } else if (cur$type == "points") { key.gf <- placeGrob(key.gf, pointsGrob(x = 0.5, y = 0.5, gp = gpar(col = cur$pars$col[j], alpha = cur$pars$alpha[j], cex = cur$pars$cex[j], lwd = cur$pars$lwd[j], fill = cur$pars$fill[j], fontfamily = cur$pars$fontfamily[j], fontface = chooseFace(cur$pars$fontface[j], cur$pars$font[j]), fontsize = fontsize.points), pch = cur$pars$pch[j], name = componentName("points", componentx, componenty)), row = yy, col = xx) } } } } else stop("Sorry, align=FALSE is not supported") attr(key.gf, "titleWidth") <- titleWidth class(key.gf) <- c("latticeKey", class(key.gf)) if (draw) grid.draw(key.gf) key.gf } widthDetails.latticeKey <- function(x) { max(NextMethod("widthDetails"), attr(x, "titleWidth")) } draw.colorkey <- function(key, draw = FALSE, vp = NULL) { if (!is.list(key)) stop("key must be a list") process.key <- function(col = regions$col, alpha = regions$alpha, at, tick.number = 7, title = NULL, title.control = list(padding = 1, side = NULL), tck = 1, width = 2, height = 1, space = "right", raster = FALSE, interpolate = FALSE, tri.upper = NA, tri.lower = NA, axis.line = list(), axis.text = list(), ...) { regions <- trellis.par.get("regions") list(col = col, alpha = alpha, at = at, tick.number = tick.number, tck = tck, title = title, title.control = title.control, width = width, height = height, space = space, raster = raster, interpolate = interpolate, tri.upper = tri.upper, tri.lower = tri.lower, axis.line = axis.line, axis.text = axis.text, ...) } key <- do.call(process.key, key) axis.line <- updateList(trellis.par.get("axis.line"), key$axis.line) axis.text <- updateList(trellis.par.get("axis.text"), key$axis.text) ## made FALSE later if labels explicitly specified check.overlap <- TRUE ## Note: there are two 'at'-s here, one is key$at, which specifies ## the breakpoints of the rectangles, and the other is key$lab$at ## (optional) which is the positions of the ticks. We will use the ## 'at' variable for the latter, 'atrange' for the range of the ## former, and key$at explicitly when needed ## Getting the locations/dimensions/centers of the rectangles key$at <- sort(key$at) ## should check if ordered numcol <- length(key$at)-1 ## numcol.r <- length(key$col) ## key$col <- ## if (is.function(key$col)) key$col(numcol) ## else if (numcol.r <= numcol) rep(key$col, length.out = numcol) ## else key$col[floor(1+(1:numcol-1)*(numcol.r-1)/(numcol-1))] key$col <- level.colors(x = seq_len(numcol) - 0.5, at = seq_len(numcol + 1) - 1, col.regions = key$col, colors = TRUE) ## FIXME: need to handle DateTime classes properly atrange <- range(key$at, finite = TRUE) scat <- as.numeric(key$at) ## problems otherwise with DateTime objects (?) if (key$raster && !isTRUE(all.equal(diff(range(diff(scat))), 0))) warning("'at' values are not equispaced; output may be wrong") ## recnum <- length(scat)-1 reccentre <- (scat[-1] + scat[-length(scat)]) / 2 recdim <- diff(scat) cex <- axis.text$cex col <- axis.text$col font <- axis.text$font fontfamily <- axis.text$fontfamily fontface <- axis.text$fontface lineheight <- axis.text$lineheight rot <- 0 ## The following code assumes names key$lab and key$lab$lab (which ## may have been used in user code), whereas documentation says ## key$labels and key$labels$labels. To make both work without ## 'partial matching' warnings, we rename key$labels to key$lab ## etc. if (!is.null(key[["labels"]])) { key[["lab"]] <- key[["labels"]] key[["labels"]] <- NULL if (is.list(key[["lab"]]) && !is.null(key[["lab"]][["labels"]])) { key[["lab"]][["lab"]] <- key[["lab"]][["labels"]] key[["lab"]][["labels"]] <- NULL } } if (is.null(key$lab)) { at <- lpretty(atrange, key$tick.number) at <- at[at >= atrange[1] & at <= atrange[2]] labels <- format(at, trim = TRUE) } else if (is.characterOrExpression(key$lab) && length(key$lab)==length(key$at)) { check.overlap <- FALSE at <- key$at labels <- key$lab } else if (is.list(key$lab)) { at <- if (!is.null(key$lab$at)) key$lab$at else lpretty(atrange, key$tick.number) labels <- if (!is.null(key$lab$lab)) { if (is.null(key$lab$at)) stop("key specifies 'labels$labels' but not 'labels$at'", call. = FALSE) if (length(key$lab$lab) != length(key$lab$at)) stop("lengths of key's 'labels$labels' and 'labels$at' differ", call. = FALSE) check.overlap <- FALSE key$lab$lab } else format(at, trim = TRUE) .include <- at >= atrange[1] & at <= atrange[2] at <- at [.include] labels <- labels[.include] if (!is.null(key$lab$cex)) cex <- key$lab$cex if (!is.null(key$lab$col)) col <- key$lab$col if (!is.null(key$lab$font)) font <- key$lab$font if (!is.null(key$lab$fontface)) fontface <- key$lab$fontface if (!is.null(key$lab$fontfamily)) fontfamily <- key$lab$fontfamily if (!is.null(key$lab$lineheight)) lineheight <- key$lab$lineheight if (!is.null(key$lab$rot)) rot <- key$lab$rot } else stop("malformed colorkey") labscat <- at do.labels <- (length(labscat) > 0) ## title if (!is.null(key$title)) { ## can have usual components like xlab etc title <- getLabelList(key$title, trellis.par.get("par.title.text")) title.control <- key$title.control ## title.control has additional parameters 'side' and 'padding' if (is.null(title.control$side)) title.control$side <- key$space if (is.null(title.control$padding)) title.control$padding <- 1 if (!is.grob(title) && is.null(title$rot)) title$rot <- switch(title.control$side, top=0, bottom=0, left=90, right=90) title.grob <- grobFromLabelList(title, name = trellis.grobname("title", type="colorkey")) } ## Setting 'open.lower' and 'open.upper' to non-zero makes ## colorkey end with triangular extensions, indicating open-ended ## intervals. Set to non-zero by default only if first/last ## intervals are unbounded (-Inf / +Inf). (NOTE: default should ## perhaps be 0 for back-compatibility, but currently these are ## simply not shown in the legend, so probably new behaviour is no ## worse). When non-zero, controls fraction of key$height to be ## used for triangles at ends. convertTri <- function(x, inf = FALSE) { if (length(x) == 1) { if (is.na(x)) return(0.05 * inf) else if (is.numeric(x) && (x >= 0 && x <= 0.25)) return(x) else if (isTRUE(x)) return(0.05) else return(0) } warning("Invalid value of 'tri.upper/tri.lower' ignored.") 0 } open.lower <- convertTri(key$tri.lower, scat[1] == -Inf) open.upper <- convertTri(key$tri.upper, scat[length(scat)] == Inf) key.rect <- 1 - open.lower - open.upper gp.border <- with(axis.line, gpar(col = col, lty = lty, lwd = lwd, alpha = alpha, fill = "transparent")) if (key$space == "right") { labelsGrob <- if (do.labels) textGrob(label = labels, x = rep(0, length(labscat)), y = labscat, vp = viewport(yscale = atrange), default.units = "native", check.overlap = check.overlap, just = if (rot == -90) c("center", "bottom") else c("left", "center"), rot = rot, name = trellis.grobname("labels", type="colorkey"), gp = gpar(col = col, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), lineheight = lineheight)) else nullGrob() heights.x <- c(0.5 * (1 - key$height), key$height * c(open.upper, key.rect, open.lower), 0.5 * (1 - key$height)) heights.units <- rep("null", 5) widths.x <- c(0.6 * key$width, do.labels * (0.3 + key$tck * 0.3), do.labels * 1) widths.units <- c("lines", "lines", "grobwidth") widths.data <- list(NULL, NULL, labelsGrob) key.layout <- grid.layout(nrow = 5, ncol = 3, heights = unit(heights.x, heights.units), widths = unit(widths.x, widths.units, data = widths.data), respect = TRUE) key.gf <- frameGrob(layout = key.layout, vp = vp, name = trellis.grobname("frame", type="colorkey")) if (key$raster) { key.gf <- placeGrob(key.gf, rasterGrob(matrix(rev(key$col), ncol = 1), width = 1, height = 1, vp = viewport(clip = "on"), name = trellis.grobname("raster", type="colorkey"), interpolate = key$interpolate), row = 3, col = 1) } else { key.gf <- placeGrob(key.gf, rectGrob(x = rep(.5, length(reccentre)), y = reccentre, default.units = "native", vp = viewport(yscale = atrange), height = recdim, name = trellis.grobname("image", type="colorkey"), gp = gpar(fill = key$col, col = "transparent", alpha = key$alpha)), row = 3, col = 1) } if (open.lower > 0) { key.gf <- placeGrob(key.gf, polygonGrob(x = c(0, 1, 0.5), y = c(1, 1, 0), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("lower.arrow", type="colorkey"), gp = gpar(fill = key$col[1], col = "transparent", alpha = key$alpha)), row = 4, col = 1) } if (open.upper > 0) { key.gf <- placeGrob(key.gf, polygonGrob(x = c(0, 1, 0.5), y = c(0, 0, 1), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("upper.arrow", type="colorkey"), gp = gpar(fill = key$col[length(key$col)], col = "transparent", alpha = key$alpha)), row = 2, col = 1) } ## borders key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(0, 0), c(0, 1), c(1, 1), default.units = "npc", name = trellis.grobname("border.sides", type="colorkey"), gp = gp.border), row = 3, col = 1) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(1, 1), c(0.5, 0.5), c(0, 0), default.units = "npc", name = trellis.grobname("border.lower", type="colorkey"), gp = gp.border), row = 4, col = 1) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(0, 0), c(0.5, 0.5), c(1, 1), default.units = "npc", name = trellis.grobname("border.upper", type="colorkey"), gp = gp.border), row = 2, col = 1) ## labels if (do.labels) { if (key$tck != 0) key.gf <- placeGrob(frame = key.gf, segmentsGrob(x0 = rep(0, length(labscat)), y0 = labscat, x1 = rep(key$tck / (1 + key$tck), length(labscat)), y1 = labscat, vp = viewport(yscale = atrange), default.units = "native", name = trellis.grobname("ticks", type="colorkey"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd)), row = 3, col = 2) key.gf <- placeGrob(key.gf, labelsGrob, row = 3, col = 3) } } else if (key$space == "left") { labelsGrob <- if (do.labels) textGrob(label = labels, x = rep(1, length(labscat)), y = labscat, vp = viewport(yscale = atrange), default.units = "native", check.overlap = check.overlap, just = if (rot == 90) c("center", "bottom") else c("right", "center"), rot = rot, name = trellis.grobname("labels", type="colorkey"), gp = gpar(col = col, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), lineheight = lineheight)) else nullGrob() heights.x <- c(0.5 * (1 - key$height), key$height * c(open.upper, key.rect, open.lower), 0.5 * (1 - key$height)) heights.units <- rep("null", 5) widths.x <- c(do.labels * 1, do.labels * (0.3 + key$tck * 0.3), 0.6 * key$width) widths.units <- c("grobwidth", "lines", "lines") widths.data <- list(labelsGrob, NULL, NULL) key.layout <- grid.layout(nrow = 5, ncol = 3, heights = unit(heights.x, heights.units), widths = unit(widths.x, widths.units, data = widths.data), respect = TRUE) key.gf <- frameGrob(layout = key.layout, vp = vp, name = trellis.grobname("frame", type="colorkey")) if (key$raster) { key.gf <- placeGrob(key.gf, rasterGrob(matrix(rev(key$col), ncol = 1), width = 1, height = 1, vp = viewport(clip = "on"), name = trellis.grobname("raster", type="colorkey"), interpolate = key$interpolate), row = 3, col = 3) } else { key.gf <- placeGrob(key.gf, rectGrob(x = rep(.5, length(reccentre)), y = reccentre, default.units = "native", vp = viewport(yscale = atrange), height = recdim, name = trellis.grobname("image", type="colorkey"), gp = gpar(fill = key$col, col = "transparent", alpha = key$alpha)), row = 3, col = 3) } if (open.lower > 0) { key.gf <- placeGrob(key.gf, polygonGrob(x = c(0, 1, 0.5), y = c(1, 1, 0), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("lower.arrow", type="colorkey"), gp = gpar(fill = key$col[1], col = "transparent", alpha = key$alpha)), row = 4, col = 3) } if (open.upper > 0) { key.gf <- placeGrob(key.gf, polygonGrob(x = c(0, 1, 0.5), y = c(0, 0, 1), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("upper.arrow", type="colorkey"), gp = gpar(fill = key$col[length(key$col)], col = "transparent", alpha = key$alpha)), row = 2, col = 3) } ## borders key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(0, 0), c(0, 1), c(1, 1), default.units = "npc", name = trellis.grobname("border.sides", type="colorkey"), gp = gp.border), row = 3, col = 3) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(1, 1), c(0.5, 0.5), c(0, 0), default.units = "npc", name = trellis.grobname("border.lower", type="colorkey"), gp = gp.border), row = 4, col = 3) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 1), c(0, 0), c(0.5, 0.5), c(1, 1), default.units = "npc", name = trellis.grobname("border.upper", type="colorkey"), gp = gp.border), row = 2, col = 3) ## labels if (do.labels) { if (key$tck != 0) key.gf <- placeGrob(frame = key.gf, segmentsGrob(x0 = rep(1, length(labscat)), y0 = labscat, x1 = rep(1 - key$tck / (1 + key$tck), length(labscat)), y1 = labscat, vp = viewport(yscale = atrange), default.units = "native", name = trellis.grobname("ticks", type="colorkey"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd)), row = 3, col = 2) key.gf <- placeGrob(key.gf, labelsGrob, row = 3, col = 1) } } else if (key$space == "top") { labelsGrob <- if (do.labels) textGrob(label = labels, y = rep(0, length(labscat)), x = labscat, vp = viewport(xscale = atrange), default.units = "native", check.overlap = check.overlap, just = if (rot == 0) c("center","bottom") else c("left", "center"), rot = rot, name = trellis.grobname("labels", type="colorkey"), gp = gpar(col = col, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), lineheight = lineheight)) else nullGrob() widths.x <- c(0.5 * (1 - key$height), key$height * c(open.lower, key.rect, open.upper), 0.5 * (1 - key$height)) widths.units <- rep("null", 5) heights.x <- c(do.labels * 1, do.labels * (0.3 + key$tck * 0.3), 0.6 * key$width) heights.units <- c("grobheight", "lines", "lines") heights.data <- list(labelsGrob, NULL, NULL) key.layout <- grid.layout(nrow = 3, ncol = 5, heights = unit(heights.x, heights.units, data = heights.data), widths = unit(widths.x, widths.units), respect = TRUE) key.gf <- frameGrob(layout = key.layout, vp = vp, name = trellis.grobname("frame", type="colorkey")) if (key$raster) { key.gf <- placeGrob(key.gf, rasterGrob(matrix(key$col, nrow = 1), width = 1, height = 1, vp = viewport(clip = "on"), name = trellis.grobname("raster", type="colorkey"), interpolate = key$interpolate), row = 3, col = 3) } else { key.gf <- placeGrob(key.gf, rectGrob(y = rep(.5, length(reccentre)), x = reccentre, default.units = "native", vp = viewport(xscale = atrange), width = recdim, name = trellis.grobname("image", type="colorkey"), gp = gpar(fill = key$col, col = "transparent", alpha = key$alpha)), row = 3, col = 3) } if (open.lower > 0) { key.gf <- placeGrob(key.gf, polygonGrob(y = c(0, 1, 0.5), x = c(1, 1, 0), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("lower.arrow", type="colorkey"), gp = gpar(fill = key$col[1], col = "transparent", alpha = key$alpha)), row = 3, col = 2) } if (open.upper > 0) { key.gf <- placeGrob(key.gf, polygonGrob(y = c(0, 1, 0.5), x = c(0, 0, 1), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("upper.arrow", type="colorkey"), gp = gpar(fill = key$col[length(key$col)], col = "transparent", alpha = key$alpha)), row = 3, col = 4) } ## borders key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 0), c(0, 1), c(1, 1), c(0, 1), default.units = "npc", name = trellis.grobname("border.sides", type="colorkey"), gp = gp.border), row = 3, col = 3) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(1, 1), c(0, 1), c(0, 0), c(0.5, 0.5), default.units = "npc", name = trellis.grobname("border.lower", type="colorkey"), gp = gp.border), row = 3, col = 2) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 0), c(0, 1), c(1, 1), c(0.5, 0.5), default.units = "npc", name = trellis.grobname("border.upper", type="colorkey"), gp = gp.border), row = 3, col = 4) ## labels if (do.labels) { if (key$tck != 0) key.gf <- placeGrob(frame = key.gf, segmentsGrob(y0 = rep(0, length(labscat)), x0 = labscat, y1 = rep(key$tck / (1 + key$tck), length(labscat)), x1 = labscat, vp = viewport(xscale = atrange), default.units = "native", name = trellis.grobname("ticks", type="colorkey"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd)), row = 2, col = 3) key.gf <- placeGrob(key.gf, labelsGrob, row = 1, col = 3) } } else if (key$space == "bottom") { labelsGrob <- if (do.labels) textGrob(label = labels, y = rep(1, length(labscat)), x = labscat, vp = viewport(xscale = atrange), default.units = "native", check.overlap = check.overlap, just = if (rot == 0) c("center", "top") else c("right", "center"), rot = rot, name = trellis.grobname("labels", type="colorkey"), gp = gpar(col = col, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), lineheight = lineheight)) else nullGrob() widths.x <- c(0.5 * (1 - key$height), key$height * c(open.lower, key.rect, open.upper), 0.5 * (1 - key$height)) widths.units <- rep("null", 5) heights.x <- c(0.6 * key$width, do.labels * (0.3 + key$tck * 0.3), do.labels * 1) heights.units <- c("lines", "lines", "grobheight") heights.data <- list(NULL, NULL, labelsGrob) key.layout <- grid.layout(nrow = 3, ncol = 5, heights = unit(heights.x, heights.units, data = heights.data), widths = unit(widths.x, widths.units), respect = TRUE) key.gf <- frameGrob(layout = key.layout, vp = vp, name = trellis.grobname("frame", type="colorkey")) if (key$raster) { key.gf <- placeGrob(key.gf, rasterGrob(matrix(key$col, nrow = 1), width = 1, height = 1, vp = viewport(clip = "on"), name = trellis.grobname("raster", type="colorkey"), interpolate = key$interpolate), row = 1, col = 3) } else { key.gf <- placeGrob(key.gf, rectGrob(y = rep(.5, length(reccentre)), x = reccentre, default.units = "native", vp = viewport(xscale = atrange), width = recdim, name = trellis.grobname("image", type="colorkey"), gp = gpar(fill = key$col, col = "transparent", alpha = key$alpha)), row = 1, col = 3) } if (open.lower > 0) { key.gf <- placeGrob(key.gf, polygonGrob(y = c(0, 1, 0.5), x = c(1, 1, 0), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("lower.arrow", type="colorkey"), gp = gpar(fill = key$col[1], col = "transparent", alpha = key$alpha)), row = 1, col = 2) } if (open.upper > 0) { key.gf <- placeGrob(key.gf, polygonGrob(y = c(0, 1, 0.5), x = c(0, 0, 1), default.units = "npc", ## vp = viewport(yscale = atrange), name = trellis.grobname("upper.arrow", type="colorkey"), gp = gpar(fill = key$col[length(key$col)], col = "transparent", alpha = key$alpha)), row = 1, col = 4) } ## borders key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 0), c(0, 1), c(1, 1), c(0, 1), default.units = "npc", name = trellis.grobname("border.sides", type="colorkey"), gp = gp.border), row = 1, col = 3) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(1, 1), c(0, 1), c(0, 0), c(0.5, 0.5), default.units = "npc", name = trellis.grobname("border.lower", type="colorkey"), gp = gp.border), row = 1, col = 2) key.gf <- placeGrob(frame = key.gf, segmentsGrob(c(0, 0), c(0, 1), c(1, 1), c(0.5, 0.5), default.units = "npc", name = trellis.grobname("border.upper", type="colorkey"), gp = gp.border), row = 1, col = 4) ## labels if (do.labels) { if (key$tck != 0) key.gf <- placeGrob(frame = key.gf, segmentsGrob(y0 = rep(1, length(labscat)), x0 = labscat, y1 = rep(1 - key$tck / (1 + key$tck), length(labscat)), x1 = labscat, vp = viewport(xscale = atrange), default.units = "native", name = trellis.grobname("ticks", type="colorkey"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd)), row = 2, col = 3) key.gf <- placeGrob(key.gf, labelsGrob, row = 3, col = 3) } } if (!is.null(key$title)) { tside <- title.control$side tpadding <- title.control$padding if (getRversion() >= "4.0.1") { ## This is nicer, but only works with grid >= 4.0.1. ## Eventually make unconditional if we depend on R >= 4.0.1 ## padding unit is not customizable, but can be controlled ## by title$padding upad <- unit(tpadding * 0.5, "char") key.gf <- switch(tside, left = packGrob(packGrob(key.gf, nullGrob(), side = tside, width = upad), title.grob, side = tside), right = packGrob(packGrob(key.gf, nullGrob(), side = tside, width = upad), title.grob, side = tside), top = packGrob(packGrob(key.gf, nullGrob(), side = tside, height = upad), title.grob, side = tside), bottom = packGrob(packGrob(key.gf, nullGrob(), side = tside, height = upad), title.grob, side = tside)) } else { key.title.layout <- switch(tside, left = grid.layout(nrow = 1, ncol = 3, heights = unit(1, "grobheight", list(key.gf)), widths = unit(c(1, 0.5 * tpadding, 1), c("grobwidth", "char", "grobwidth"), list(title.grob, NULL, key.gf))), right = grid.layout(nrow = 1, ncol = 3, heights = unit(1, "grobheight", list(key.gf)), widths = unit(c(1, 0.5 * tpadding, 1), c("grobwidth", "char", "grobwidth"), list(key.gf, NULL, title.grob))), top = grid.layout(nrow = 3, ncol = 1, heights = unit(c(1, 0.5 * tpadding, 1), c("grobheight", "char", "grobheight"), list(title.grob, NULL, key.gf)), widths = unit(1, "grobwidth", list(key.gf))), bottom = grid.layout(nrow = 3, ncol = 1, heights = unit(c(1, 0.5 * tpadding, 1), c("grobheight", "char", "grobheight"), list(key.gf, NULL, title.grob)), widths = unit(1, "grobwidth", list(key.gf)))) key.title.gf <- frameGrob(layout = key.title.layout, vp = vp, name = trellis.grobname("titleframe", type="colorkey")) key.title.gf <- switch(tside, left = placeGrob(placeGrob(key.title.gf, key.gf, row = 1, col = 3), title.grob, row = 1, col = 1), right = placeGrob(placeGrob(key.title.gf, key.gf, row = 1, col = 1), title.grob, row = 1, col = 3), top = placeGrob(placeGrob(key.title.gf, key.gf, row = 3, col = 1), title.grob, row = 1, col = 1), bottom = placeGrob(placeGrob(key.title.gf, key.gf, row = 1, col = 1), title.grob, row = 3, col = 1)) key.gf <- key.title.gf } } if (draw) grid.draw(key.gf) key.gf } lattice/R/dataframe-methods.R0000644000176200001440000002065714576465132015637 0ustar liggesusers ## We want data frame methods that support calls like xyplot(data, ## formula, ...) by calling them as xyplot(formula, data, ...). This ## is a little tricky (in ways that I don't really understand) because ## of the need to handle NSE arguments like groups and subset. ## Here we _know_ that the first argument (or a named argument 'x') is ## a data.frame. We will try to identify the 'x' and 'formula' ## arguments, which may or may not be named, remove them (along with a ## 'data' argument if any), rename them to 'data' and 'x' ## respectively, and evaluate the call. .df2formula <- function(ccall) { ocall <- ccall n <- length(ccall) if (n == 2) stop("a formula must be specified for the 'data.frame' method") cnames <- names(ccall) if (is.null(cnames)) { ## No named arguments --- this is relatively easy if (n == 3) names(ccall) <- c("", "data", "x") else if (n > 3) { ## third argument is 'formula', and second argument 'data' ## is to be ignored ccall <- ccall[-3L] # second argument has index 3 names(ccall) <- rep("", n-1) # second argument is now the formula names(ccall)[c(2, 3)] <- c("data", "x") } } else { ## OK, we have names (so at least one named argument). Let's ## check how many unnamed arguments we have (excluding the ## function name), how many of 'x', 'data', and 'formula' are ## still missing, and match them accordingly w <- which(cnames[-1] == ""); nw <- length(w) have_args <- c("x", "data", "formula") %in% cnames need_match <- c("x", "data", "formula")[!have_args] nmatch <- min(nw, length(need_match)) if (nmatch > 0) { # match with missing args names(ccall)[ w[1:nmatch] + 1L ] <- need_match[1:nmatch] } ## We should be ready now to switch argument names and ## call. We assume that we have at least 'x' and either or ## both of 'data' and 'formula' formula <- if (is.null(ccall$formula)) ccall$data else ccall$formula ## The next line is highly questionable, but is needed to ## handle cases like ## xyplot(data, data = y ~ x, , col = 1) ## although it's not clear whether they need to be if (missing(formula)) formula <- ccall$data x <- ccall$x ccall$formula <- NULL # in case present ccall$x <- formula # switch ccall$data <- x } if (!inherits(eval(ccall$x), "formula")) stop("'formula' must be a formula object") ans <- eval.parent(ccall) ans$call <- ocall ans } dotplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) .df2formula(ocall) } barchart.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) .df2formula(ocall) } stripplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(stripplot) .df2formula(ocall) } bwplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(bwplot) .df2formula(ocall) } wireframe.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(wireframe) .df2formula(ocall) } cloud.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(cloud) .df2formula(ocall) } densityplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(densityplot) .df2formula(ocall) } histogram.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(histogram) .df2formula(ocall) } contourplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(contourplot) .df2formula(ocall) } levelplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(levelplot) .df2formula(ocall) } qq.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(qq) .df2formula(ocall) } qqmath.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(qqmath) .df2formula(ocall) } tmd.data.frame <- function(object, formula, ...) { ocall <- sys.call(); ocall[[1]] <- quote(tmd) if (!inherits(formula, "formula")) stop("'formula' must be a formula object") modifyList(tmd(formula, object, ...), list(call = ocall)) } xyplot.data.frame <- function(x, data = NULL, formula = data, ...) { ocall <- sys.call(); ocall[[1]] <- quote(xyplot) .df2formula(ocall) } ## barchart.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(barchart) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(barchart(formula, x, ...), list(call = ocall)) ## } ## stripplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(stripplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(stripplot(formula, x, ...), list(call = ocall)) ## } ## bwplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(bwplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(bwplot(formula, x, ...), list(call = ocall)) ## } ## wireframe.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(wireframe) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(wireframe(formula, x, ...), list(call = ocall)) ## } ## cloud.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(cloud) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(cloud(formula, x, ...), list(call = ocall)) ## } ## densityplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(densityplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(densityplot(formula, x, ...), list(call = ocall)) ## } ## histogram.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(histogram) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(histogram(formula, x, ...), list(call = ocall)) ## } ## contourplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(contourplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(contourplot(formula, x, ...), list(call = ocall)) ## } ## levelplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(levelplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(levelplot(formula, x, ...), list(call = ocall)) ## } ## qq.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(qq) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(qq(formula, x, ...), list(call = ocall)) ## } ## qqmath.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(qqmath) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(qqmath(formula, x, ...), list(call = ocall)) ## } ## tmd.data.frame <- function(object, formula, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(tmd) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(tmd(formula, object, ...), list(call = ocall)) ## } ## xyplot.data.frame <- function(x, data = NULL, formula = data, ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(xyplot) ## if (!inherits(formula, "formula")) stop("'formula' must be a formula object") ## modifyList(xyplot(formula, x, ...), list(call = ocall)) ## } lattice/R/panels.R0000644000176200001440000004121213320643633013510 0ustar liggesusers ### Copyright (C) 2001-2011 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## the following functions don't do much error checking yet panel.refline <- function(...) panel.abline(..., reference = TRUE) panel.abline <- function(a = NULL, b = 0, h = NULL, v = NULL, reg = NULL, coef = NULL, col, col.line = add.line$col, lty = add.line$lty, lwd = add.line$lwd, alpha = add.line$alpha, type, ..., reference = FALSE, identifier = "abline") { add.line <- if (reference) trellis.par.get("reference.line") else trellis.par.get("add.line") if (!missing(col) && missing(col.line)) col.line <- col ## mostly copied from abline if (!is.null(reg)) { if (!is.null(a)) warning("'a' is overridden by 'reg'") a <- reg } if (is.object(a) || is.list(a)) { p <- length(coefa <- as.vector(coef(a))) if (p > 2) warning(gettextf("only using the first two of %d regression coefficients", p)) islm <- inherits(a, "lm") noInt <- if (islm) !as.logical(attr(stats::terms(a), "intercept")) else p == 1 if (noInt) { a <- 0 b <- coefa[1] } else { a <- coefa[1] b <- if (p >= 2) coefa[2] else 0 } } if (!is.null(coef)) { if (!is.null(a)) warning("'a' and 'b' are overridden by 'coef'") a <- coef[1] b <- coef[2] } id <- identifier if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 ## draw y = a + bx if appropriate if (!is.null(a)) { coeff <- c(a, b) cpl <- current.panel.limits() xx <- cpl$xlim yy <- cpl$ylim ## There are six = choose(4, 2) possibilities (plus edge cases): ## I II III IV V VI ## 4----C----3 4---------3 4---------3 4---------3 4---------3 4---------3 ## | | | / | | | | \ | | \ | | | ## | ---| |/ | | | | \ | | \ | | | ## D --- B | | | /| | \ | | \ | | | ## |--- | | | | / | | \ | | \| |\ | ## | | | | | / | | \ | | | | \ | ## 1----A----2 1---------2 1---------2 1---------2 1---------2 1---------2 sign.dist.from.line <- function(x, y) { as.integer(sign(zapsmall(y - coeff[1] - coeff[2] * x))) } force(sign.dist.from.line) sign.corners <- with(cpl, sign.dist.from.line(c(xlim[1], xlim[2], xlim[2], xlim[1]), c(ylim[1], ylim[1], ylim[2], ylim[2]))) A <- prod(sign.corners[c(1, 2)]) <= 0 B <- prod(sign.corners[c(2, 3)]) <= 0 C <- prod(sign.corners[c(3, 4)]) <= 0 D <- prod(sign.corners[c(4, 1)]) <= 0 yfun <- function(x) coeff[1] + coeff[2] * x xfun <- function(y) (y - coeff[1]) / coeff[2] drawfun <- function(x0, y0, x1, y1, ...) { panel.segments(x0, y0, x1, y1, col = col.line, lty = lty, lwd = lwd, alpha = alpha, ..., identifier = id) } ## Do opposite sides first to make sure diagonal edge cases ## proceed along the correct branch if (D && B) # Case I drawfun(xx[1], yfun(xx[1]), xx[2], yfun(xx[2]), ...) else if (A && C) # Case IV drawfun(xfun(yy[1]), yy[1], xfun(yy[2]), yy[2], ...) else if (D && C) # Case II drawfun(xx[1], yfun(xx[1]), xfun(yy[2]), yy[2], ...) else if (A && B) # Case III drawfun(xfun(yy[1]), yy[1], xx[2], yfun(xx[2]), ...) else if (B && C) # Case V drawfun(xfun(yy[1]), yy[1], xfun(yy[2]), yy[2], ...) else if (A && D) # Case VI drawfun(xx[1], yfun(xx[1]), xfun(yy[1]), yy[1], ...) } if (length(h <- as.numeric(h)) > 0) grid.segments(y0 = h, y1 = h, default.units="native", name = trellis.grobname(paste(identifier, "h", sep="."), type = "panel", group = group), gp = gpar(col = col.line, lty = lty, lwd = lwd, alpha = alpha)) if (length(as.numeric(v)) > 0) grid.segments(x0 = v, x1 = v, default.units="native", name = trellis.grobname(paste(identifier, "v", sep="."), type = "panel", group = group), gp = gpar(col = col.line, lty = lty, lwd = lwd, alpha = alpha)) invisible() } ### old version of panel.abline ## panel.abline <- ## function (a, b = NULL, h = numeric(0), v = numeric(0), col, col.line = add.line$col, ## lty = add.line$lty, lwd = add.line$lwd, type, ...) ## { ## add.line <- trellis.par.get("add.line") ## if (!missing(col) && missing(col.line)) ## col.line <- col ## if (!missing(a)) { ## coeff <- if (inherits(a, "lm")) ## coef(a) ## else if (!is.null(coef(a))) ## coef(a) ## else c(a, b) ## if (length(coeff) == 1) ## coeff <- c(0, coeff) ## if (coeff[2] == 0) ## h <- c(h, coeff[1]) ## else if (!any(is.null(coeff))) { ## xx <- current.viewport()$xscale ## yy <- current.viewport()$yscale ## x <- numeric(0) ## y <- numeric(0) ## ll <- function(i, j, k, l) (yy[j] - coeff[1] - coeff[2] * ## xx[i]) * (yy[l] - coeff[1] - coeff[2] * xx[k]) ## if (ll(1, 1, 2, 1) <= 0) { ## y <- c(y, yy[1]) ## x <- c(x, (yy[1] - coeff[1])/coeff[2]) ## } ## if (ll(2, 1, 2, 2) <= 0) { ## x <- c(x, xx[2]) ## y <- c(y, coeff[1] + coeff[2] * xx[2]) ## } ## if (ll(2, 2, 1, 2) <= 0) { ## y <- c(y, yy[2]) ## x <- c(x, (yy[2] - coeff[1])/coeff[2]) ## } ## if (ll(1, 2, 1, 1) <= 0) { ## x <- c(x, xx[1]) ## y <- c(y, coeff[1] + coeff[2] * xx[1]) ## } ## panel.lines(x = x, y = y, col = col.line, lty = lty, ## lwd = lwd, ...) ## } ## } ## if (length(h <- as.numeric(h))) ## grid.segments(y0 = h, y1 = h, default.units = "native", ## gp = gpar(col = col.line, lty = lty, lwd = lwd)) ## if (length(as.numeric(v))) ## grid.segments(x0 = v, x1 = v, default.units = "native", ## gp = gpar(col = col.line, lty = lty, lwd = lwd)) ## } panel.curve <- function (expr, from, to, n = 101, curve.type = "l", col = add.line$col, lty = add.line$lty, lwd = add.line$lwd, type, ## ignored, to avoid type meant for panel.xyplot etc ..., identifier = "curve") ## curve has a log option. Unfortunately there is no easy way to ## read in the lattice log options (specified via scales) into the ## panel function. Maybe some day if grid natively supports log ## scales and lattice is redesigned to take advantage of that { add.line <- trellis.par.get("add.line") sexpr <- substitute(expr) if (is.name(sexpr)) { fcall <- paste(sexpr, "(x)") expr <- parse(text = fcall) } else { if (!(is.call(sexpr) && match("x", all.vars(sexpr), nomatch = 0))) stop("'expr' must be a function or an expression containing 'x'") expr <- sexpr } lims <- current.panel.limits()$xlim if (missing(from)) from <- min(lims) if (missing(to)) to <- max(lims) x <- seq(from, to, length.out = n) y <- eval(expr, envir = list(x = x), enclos = parent.frame()) if (hasGroupNumber()) id <- paste(identifier, "group", list(...)$group.number, sep=".") else id <- identifier panel.lines(x, y, type = curve.type, col = col, lty = lty, lwd = lwd, ..., identifier = id) } panel.rug <- function(x = NULL, y = NULL, regular = TRUE, start = if (regular) 0 else 0.97, end = if (regular) 0.03 else 1, x.units = rep("npc", 2), y.units = rep("npc", 2), col = plot.line$col, col.line = col, lty = plot.line$lty, lwd = plot.line$lwd, alpha = plot.line$alpha, ..., identifier = "rug") { if (!any(is.finite(x))) x <- NULL if (!any(is.finite(y))) y <- NULL plot.line <- trellis.par.get("plot.line") x.units <- rep(x.units, length.out = 2) y.units <- rep(y.units, length.out = 2) id <- identifier if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 if (!is.null(x)) { grid.segments(x0 = unit(x, "native"), x1 = unit(x, "native"), y0 = unit(start, x.units[1]), y1 = unit(end, x.units[2]), name = trellis.grobname(paste(id, "x", sep="."), type = "panel", group = group), gp = gpar(col = col.line, lty = lty, lwd = lwd, alpha = alpha)) } if (!is.null(y)) { grid.segments(y0 = unit(y, "native"), y1 = unit(y, "native"), x0 = unit(start, y.units[1]), x1 = unit(end, y.units[2]), name = trellis.grobname(paste(id, "y", sep="."), type = "panel", group = group), gp = gpar(col = col.line, lty = lty, lwd = lwd, alpha = alpha)) } } panel.fill <- function(col = trellis.par.get("background")$col, border = "transparent", ..., identifier = "fill") { if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 grid.rect(name = trellis.grobname(identifier, type = "panel", group = group), gp = gpar(fill = col, col = border, ...)) } panel.grid <- function(h = 3, v = 3, col, col.line = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, x = NULL, y = NULL, ..., identifier = "grid") { reference.line <- trellis.par.get("reference.line") if (!missing(col) && missing(col.line)) col.line <- col h <- as.integer(h) v <- as.integer(v) if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 if (h > 0) grid.segments(y0 = 1:h / (h+1), y1 = 1:h / (h+1), gp = gpar(col = col.line, lty = lty, lwd = lwd), default.units = "npc", name = trellis.grobname(paste(identifier, "h", sep="."), type = "panel", group = group)) if (v > 0) grid.segments(x0 = 1:v / (v+1), x1 = 1:v / (v+1), gp = gpar(col = col.line, lty = lty, lwd = lwd), default.units = "npc", name = trellis.grobname(paste(identifier, "v", sep="."), type = "panel", group = group)) ## Cheating here a bit for h=-1, v=-1. Can't think of any neat way to ## get the actual `at' values of the panel limits <- current.panel.limits() if (h < 0) { if (h == -1) n <- 5 else n <- -h scale <- limits$ylim if (!is.null(y)) { ## class() <- "factor" is an error if (inherits(y, "factor")) y <- as.character(y) mostattributes(scale) <- attributes(y) } #at <- pretty(scale, n = n) ## FIXME: use pretty eventually at <- formattedTicksAndLabels(scale, n = n)$at at <- at[at > min(scale) & at < max(scale)] grid.segments(y0 = at, y1 = at, gp = gpar(col = col.line, lty = lty, lwd = lwd), default.units = "native", name = trellis.grobname(paste(identifier, "h", sep="."), type = "panel", group = group)) } if (v < 0) { if (v == -1) n <- 5 else n <- -v scale <- limits$xlim if (!is.null(x)) { ## class() <- "factor" is an error if (inherits(x, "factor")) x <- as.character(y) mostattributes(scale) <- attributes(x) } #at <- pretty(scale, n = n) ## FIXME: use pretty eventually at <- formattedTicksAndLabels(scale, n = n)$at at <- at[at > min(scale) & at < max(scale)] grid.segments(x0 = at, x1 = at, gp = gpar(col = col.line, lty = lty, lwd = lwd), default.units = "native", name = trellis.grobname(paste(identifier, "v", sep="."), type = "panel", group = group)) } } panel.lmline <- function(x, y, ..., identifier = "lmline") { if (length(x) > 1) panel.abline(lm(as.numeric(y) ~ as.numeric(x)), ..., identifier = identifier) } prepanel.lmline <- function(x, y, ...) { x <- as.numeric(x) y <- as.numeric(y) if (length(x) > 1) { coeff <- coef(lm(y~x)) tem <- coeff[1] + coeff[2] * range(x, finite = TRUE) list(xlim = range(x, finite = TRUE), ylim = range(y, tem, finite = TRUE), dx = diff(range(x, finite = TRUE)), dy = diff(tem, finite = TRUE)) } else prepanel.null() } panel.linejoin <- panel.average <- function(x, y, fun = mean, horizontal = TRUE, lwd = reference.line$lwd, lty = reference.line$lty, col, col.line = reference.line$col, type = "l", ## ignored ..., identifier = "linejoin") { ## FIXME: pretty sure this can be made more readable using tapply (or aggregate) x <- as.numeric(x) y <- as.numeric(y) reference.line = trellis.par.get("reference.line") if (!missing(col)) { if (missing(col.line)) col.line <- col } if (horizontal) { vals <- unique(sort(y)) yy <- seq_along(vals) xx <- numeric(length(yy)) for (i in yy) xx[i] <- fun(x[y == vals[i]]) panel.lines(xx, vals[yy], col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } else { vals <- unique(sort(x)) xx <- seq_along(vals) yy <- numeric(length(xx)) for (i in xx) yy[i] <- fun(y[x == vals[i]]) panel.lines(vals[xx], yy, col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } } panel.mathdensity <- function(dmath = dnorm, args = list(mean = 0, sd = 1), n = 50, col, col.line = reference.line$col, lwd = reference.line$lwd, lty = reference.line$lty, type, ..., identifier = "mathdensity") { reference.line <- trellis.par.get("reference.line") if (!missing(col) && missing(col.line)) col.line <- col x <- do.breaks(endpoints = current.panel.limits()$xlim, nint = n) y <- do.call("dmath", c(list(x = x), args)) panel.lines(x = x, y = y, col = col.line, lwd = lwd, lty = lty, ..., identifier = identifier) } lattice/R/panel.smoothscatter.R0000644000176200001440000001000514424663420016221 0ustar liggesusers ## Moving from Bioconductor package geneplotter, in conjunction with ## the move of smoothScatter to package graphics. ## .smoothScatterCalcDensity() is also in graphics, but not exported. ## We will copy/paste rather than export it (and so not rely on ## graphics for it). The long-term plan is to reimplement the ## underlying density calculations, at which point this should be ## revamped. .smoothScatterCalcDensity <- function(x, nbin, bandwidth, range.x) { if (!("KernSmooth" %in% loadedNamespaces())) { ns <- try(loadNamespace("KernSmooth")) if (isNamespace(ns)) message("(loaded the KernSmooth namespace)") else stop("panel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespace") } if (length(nbin) == 1) nbin <- c(nbin, nbin) if (!is.numeric(nbin) || (length(nbin)!=2)) stop("'nbin' must be numeric of length 1 or 2") if (missing(bandwidth)) { bandwidth <- diff(apply(x, 2, quantile, probs=c(0.05, 0.95), na.rm=TRUE)) / 25 } else { if(!is.numeric(bandwidth)) stop("'bandwidth' must be numeric") } bandwidth[bandwidth==0] <- 1 ## create density map if(missing(range.x)) rv <- KernSmooth::bkde2D(x, gridsize=nbin, bandwidth=bandwidth) else rv <- KernSmooth::bkde2D(x, gridsize=nbin, bandwidth=bandwidth, range.x=range.x) rv$bandwidth <- bandwidth return(rv) } panel.smoothScatter <- function (x, y = NULL, nbin = 64, cuts = 255, bandwidth, col.regions, colramp, nrpoints = 100, transformation = function(x) x^0.25, pch = ".", cex = 1, col="black", range.x, ..., raster = FALSE, subscripts, identifier = "smoothScatter") ## subscripts is ignored (and recomputed), but the formal argument ## is necessary to catch another version passed in as ... ## If time permits, replacing the call to panel.levelplot by ## panel.rect might make the code more transparent (which would ## also make the subscripts thing unnecessary). The only drawback ## I can think of is that we will no longer get contourplots ## instead of levelplots, but I don't think this is the right ## place for that anyway. { if (missing(col.regions)) col.regions <- trellis.par.get("regions")$col if (missing(colramp)) { colramp <- if (is.function(col.regions)) col.regions else colorRampPalette(c("white", col.regions)) } x <- as.numeric(x) y <- as.numeric(y) if (!is.numeric(nrpoints) | (nrpoints < 0) | (length(nrpoints) != 1)) stop("'nrpoints' should be numeric scalar with value >= 0.") xy <- xy.coords(x, y) x <- cbind(xy$x, xy$y)[!(is.na(xy$x) | is.na(xy$y)), , drop = FALSE] if (nrow(x) < 1) return() map <- .smoothScatterCalcDensity(x, nbin, bandwidth, range.x) xm <- map$x1 ym <- map$x2 dens <- map$fhat dens <- array(transformation(dens), dim = dim(dens)) PFUN <- if (raster) panel.levelplot.raster else panel.levelplot PFUN(x = rep(xm, length(ym)), y = rep(ym, each = length(xm)), z = as.numeric(dens), subscripts = TRUE, at = seq(from = 0, to = 1.01 * max(dens), length.out = cuts + 2), col.regions = colramp(cuts + 1), ..., identifier = identifier) if (nrpoints != 0) { stopifnot(length(xm) == nrow(dens), length(ym) == ncol(dens)) ixm <- round((x[, 1] - xm[1])/(xm[length(xm)] - xm[1]) * (length(xm) - 1)) iym <- round((x[, 2] - ym[1])/(ym[length(ym)] - ym[1]) * (length(ym) - 1)) idens <- dens[1 + iym * length(xm) + ixm] nrpoints <- min(nrow(x), ceiling(nrpoints)) sel <- order(idens, decreasing = FALSE)[1:nrpoints] panel.points(x[sel, 1:2], pch = pch, cex = cex, col = col, identifier = identifier) } } lattice/R/bwplot.R0000644000176200001440000014645514576465132013566 0ustar liggesusers### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA stackedRange <- function(X, INDEX) { X[is.na(X)] <- 0 # missing values treated as 0 pos <- if (any(ID <- (X > 0))) tapply(X[ID], INDEX[ID, drop = TRUE], sum, na.rm = TRUE) else 0 neg <- if (any(ID <- (X < 0))) tapply(X[ID], INDEX[ID, drop = TRUE], sum, na.rm = TRUE) else 0 range(pos, neg, finite = TRUE) } prepanel.default.bwplot <- function(x, y, horizontal = TRUE, nlevels, origin = NULL, stack = FALSE, ...) { ## This function needs to work for all high level functions in the ## bwplot family, namely bwplot, dotplot, stripplot and ## barchart. For all but barchart, this is simply a question of ## getting the ranges. For stacked barcharts, things are slightly ## complicated: see stackedRange() above. if (any(!is.na(x) & !is.na(y))) { if (horizontal) { if (!is.factor(y)) ## y came from a shingle { if (missing(nlevels)) nlevels <- length(unique(y)) y <- factor(y, levels = 1:nlevels) } list(xlim = if (stack) stackedRange(x, y) else scale_limits(c(x, origin)), ylim = levels(y), yat = sort(unique(as.numeric(y))), dx = 1, dy = 1) } else { if (!is.factor(x)) ## x came from a shingle { if (missing(nlevels)) nlevels <- length(unique(x)) x <- factor(x, levels = 1:nlevels) } list(xlim = levels(x), xat = sort(unique(as.numeric(x))), ylim = if (stack) stackedRange(y, x) else scale_limits(c(y, origin)), dx = 1, dy = 1) } } else prepanel.null() } panel.barchart <- function(x, y, box.ratio = 1, box.width = box.ratio / (1 + box.ratio), horizontal = TRUE, origin = NULL, reference = TRUE, stack = FALSE, groups = NULL, col = if (is.null(groups)) plot.polygon$col else superpose.polygon$col, border = if (is.null(groups)) plot.polygon$border else superpose.polygon$border, lty = if (is.null(groups)) plot.polygon$lty else superpose.polygon$lty, lwd = if (is.null(groups)) plot.polygon$lwd else superpose.polygon$lwd, ..., identifier = "barchart") { plot.polygon <- trellis.par.get("plot.polygon") superpose.polygon <- trellis.par.get("superpose.polygon") reference.line <- trellis.par.get("reference.line") ## this function doesn't have a subscripts argument (which would ## have made barchart always pass the subscripts to the trellis ## object, which is unnecessary when groups = NULL). To work ## around this, we have to do some things that may seem a bit odd keep <- (function(x, y, groups, subscripts, ...) { !is.na(x) & !is.na(y) & if (is.null(groups)) TRUE else !is.na(groups[subscripts]) })(x = x, y = y, groups = groups, ...) if (!any(keep)) return() x <- as.numeric(x[keep]) y <- as.numeric(y[keep]) if (!is.null(groups)) { groupSub <- function(groups, subscripts, ...) groups[subscripts[keep]] ## This is to make sure `levels' are calculated based on the ## whole groups vector and not just the values represented in ## this particular panel (which might make the key ## inconsistent and/or cause other problems) if (!is.factor(groups)) groups <- factor(groups) nvals <- nlevels(groups) groups <- as.numeric(groupSub(groups, ...)) } if (horizontal) { ## No grouping if (is.null(groups)) { if (is.null(origin)) { origin <- current.panel.limits()$xlim[1] reference <- FALSE } height <- box.width # box.ratio / (1 + box.ratio) if (reference) panel.abline(v = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) panel.rect(x = rep(origin, length(y)), y = y, height = rep(height, length(y)), width = x - origin, border = border, col = col, lty = lty, lwd = lwd, just = c("left", "centre"), identifier = identifier) } else if (stack) # grouped, with stacked bars { if (!is.null(origin) && origin != 0) warning("'origin' forced to 0 for stacked bars") ## vals <- seq_len(nlevels(groups)) ## groups <- as.numeric(groupSub(groups, ...)) ## ## vals <- sort(unique(groups)) ## nvals <- length(vals) col <- rep(col, length.out = nvals) border <- rep(border, length.out = nvals) lty <- rep(lty, length.out = nvals) lwd <- rep(lwd, length.out = nvals) height <- # box.ratio / (1 + box.ratio) by default rep(box.width, length.out = length(x)) if (reference) panel.abline(v = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) for (i in unique(y)) { ok <- y == i ord <- sort.list(groups[ok]) pos <- x[ok][ord] > 0 nok <- sum(pos, na.rm = TRUE) if (nok > 0) panel.rect(x = cumsum(c(0, x[ok][ord][pos][-nok])), y = rep(i, nok), col = col[groups[ok][ord][pos]], border = border[groups[ok][ord][pos]], lty = lty[groups[ok][ord][pos]], lwd = lwd[groups[ok][ord][pos]], height = height[ok][ord][pos], width = x[ok][ord][pos], just = c("left", "centre"), identifier = paste(identifier, "pos", i, sep = ".")) neg <- x[ok][ord] < 0 nok <- sum(neg, na.rm = TRUE) if (nok > 0) panel.rect(x = cumsum(c(0, x[ok][ord][neg][-nok])), y = rep(i, nok), col = col[groups[ok][ord][neg]], border = border[groups[ok][ord][neg]], lty = lty[groups[ok][ord][neg]], lwd = lwd[groups[ok][ord][neg]], height = height[ok][ord][neg], width = x[ok][ord][neg], just = c("left", "centre"), identifier = paste(identifier, "neg", i, sep = ".")) } } else # grouped, with side by side bars { if (is.null(origin)) { origin <- current.panel.limits()$xlim[1] reference <- FALSE } ## vals <- seq_len(nlevels(groups)) ## groups <- as.numeric(groupSub(groups, ...)) ## ## vals <- sort(unique(groups)) ## nvals <- length(vals) col <- rep(col, length.out = nvals) border <- rep(border, length.out = nvals) lty <- rep(lty, length.out = nvals) lwd <- rep(lwd, length.out = nvals) height <- box.width / nvals # box.ratio/(1 + nvals * box.ratio) if (reference) panel.abline(v = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) for (i in unique(y)) { ok <- y == i nok <- sum(ok, na.rm = TRUE) panel.rect(x = rep(origin, nok), y = (i + height * (groups[ok] - (nvals + 1)/2)), col = col[groups[ok]], border = border[groups[ok]], lty = lty[groups[ok]], lwd = lwd[groups[ok]], height = rep(height, nok), # rep(height[i], nok), width = x[ok] - origin, just = c("left", "centre"), identifier = paste(identifier, "y", i, sep = ".")) } } } else # if not horizontal { ## No grouping if (is.null(groups)) { if (is.null(origin)) { origin <- current.panel.limits()$ylim[1] reference <- FALSE } width <- box.width # box.ratio / (1 + box.ratio) if (reference) panel.abline(h = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) panel.rect(x = x, y = rep(origin, length(x)), col = col, border = border, lty = lty, lwd = lwd, width = rep(width, length(x)), height = y - origin, just = c("centre", "bottom"), identifier = identifier) } else if (stack) # grouped, with stacked bars { if (!is.null(origin) && origin != 0) warning("'origin' forced to 0 for stacked bars") col <- rep(col, length.out = nvals) border <- rep(border, length.out = nvals) lty <- rep(lty, length.out = nvals) lwd <- rep(lwd, length.out = nvals) width <- # box.ratio / (1 + box.ratio) by default rep(box.width, length.out = length(y)) if (reference) panel.abline(h = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) for (i in unique(x)) { ok <- x == i ord <- sort.list(groups[ok]) pos <- y[ok][ord] > 0 nok <- sum(pos, na.rm = TRUE) if (nok > 0) panel.rect(x = rep(i, nok), y = cumsum(c(0, y[ok][ord][pos][-nok])), col = col[groups[ok][ord][pos]], border = border[groups[ok][ord][pos]], lty = lty[groups[ok][ord][pos]], lwd = lwd[groups[ok][ord][pos]], width = width[ok][ord][pos], height = y[ok][ord][pos], just = c("centre", "bottom"), identifier = paste(identifier, "pos", i, sep = ".")) neg <- y[ok][ord] < 0 nok <- sum(neg, na.rm = TRUE) if (nok > 0) panel.rect(x = rep(i, nok), y = cumsum(c(0, y[ok][ord][neg][-nok])), col = col[groups[ok][ord][neg]], border = border[groups[ok][ord][neg]], lty = lty[groups[ok][ord][neg]], lwd = lwd[groups[ok][ord][neg]], width = width[ok][ord][neg], height = y[ok][ord][neg], just = c("centre", "bottom"), identifier = paste(identifier, "neg", i, sep = ".")) } } else # grouped, with side by side bars { if (is.null(origin)) { origin <- current.panel.limits()$ylim[1] reference = FALSE } col <- rep(col, length.out = nvals) border <- rep(border, length.out = nvals) lty <- rep(lty, length.out = nvals) lwd <- rep(lwd, length.out = nvals) width <- box.width / nvals # box.ratio/(1 + nvals * box.ratio) if (reference) panel.abline(h = origin, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) for (i in unique(x)) { ok <- x == i nok <- sum(ok, na.rm = TRUE) panel.rect(x = (i + width * (groups[ok] - (nvals + 1)/2)), y = rep(origin, nok), col = col[groups[ok]], border = border[groups[ok]], lty = lty[groups[ok]], lwd = lwd[groups[ok]], width = rep(width, nok), height = y[ok] - origin, just = c("centre", "bottom"), identifier = paste(identifier, "x", i, sep = ".")) } } } } panel.dotplot <- function(x, y, horizontal = TRUE, pch = if (is.null(groups)) dot.symbol$pch else sup.symbol$pch, col = if (is.null(groups)) dot.symbol$col else sup.symbol$col, lty = dot.line$lty, lwd = dot.line$lwd, col.line = dot.line$col, levels.fos = if (horizontal) unique(y) else unique(x), groups = NULL, ..., grid = lattice.getOption("default.args")$grid, identifier = "dotplot") { x <- as.numeric(x) y <- as.numeric(y) dot.line <- trellis.par.get("dot.line") dot.symbol <- trellis.par.get("dot.symbol") sup.symbol <- trellis.par.get("superpose.symbol") if (horizontal) { if (!isFALSE(grid)) { if (!is.list(grid)) grid <- if (isTRUE(grid)) list(h = 0, v = -1, x = x) else list(h = 0, v = 0) do.call(panel.grid, grid) } panel.abline(h = levels.fos, col = col.line, lty = lty, lwd = lwd, identifier = paste(identifier, "abline", sep=".")) panel.xyplot(x = x, y = y, col = col, pch = pch, ## lty = lty, lwd = lwd, groups = groups, horizontal = horizontal, ..., grid = FALSE, identifier = identifier) } else { if (!isFALSE(grid)) { if (!is.list(grid)) grid <- if (isTRUE(grid)) list(h = -1, v = 0, y = y) else list(h = 0, v = 0) do.call(panel.grid, grid) } panel.abline(v = levels.fos, col = col.line, lty = lty, lwd = lwd, identifier = paste(identifier, "abline", sep=".")) panel.xyplot(x = x, y = y, col = col, pch = pch, ## lty = lty, lwd = lwd, groups = groups, horizontal = horizontal, ..., grid = FALSE, identifier = identifier) } } panel.stripplot <- function(x, y, jitter.data = FALSE, factor = 0.5, amount = NULL, horizontal = TRUE, groups = NULL, ..., grid = lattice.getOption("default.args")$grid, identifier = "stripplot") { if (!isFALSE(grid)) { if (!is.list(grid)) grid <- switch(as.character(grid), "TRUE" = list(h = -1, v = -1, x = x, y = y), "h" = list(h = -1, v = 0, y = y), "v" = list(h = 0, v = -1, x = x), list(h = 0, v = 0)) do.call(panel.grid, grid) } if (!any(is.finite(x) & is.finite(y))) return() panel.xyplot(x = x, y = y, jitter.x = jitter.data && !horizontal, jitter.y = jitter.data && horizontal, factor = factor, amount = amount, groups = groups, horizontal = horizontal, ..., grid = FALSE, identifier = identifier) } ## version that supports notches (based on patch from Mike Kay) panel.bwplot <- function(x, y, box.ratio = 1, box.width = box.ratio / (1 + box.ratio), horizontal = TRUE, pch = box.dot$pch, col = box.dot$col, alpha = box.dot$alpha, cex = box.dot$cex, font = box.dot$font, fontfamily = box.dot$fontfamily, fontface = box.dot$fontface, fill = box.rectangle$fill, varwidth = FALSE, notch = FALSE, notch.frac = 0.5, ..., levels.fos = if (horizontal) sort(unique(y)) else sort(unique(x)), stats = boxplot.stats, coef = 1.5, do.out = TRUE, identifier = "bwplot") { if (all(is.na(x) | is.na(y))) return() x <- as.numeric(x) y <- as.numeric(y) box.dot <- trellis.par.get("box.dot") box.rectangle <- trellis.par.get("box.rectangle") box.umbrella <- trellis.par.get("box.umbrella") plot.symbol <- trellis.par.get("plot.symbol") fontsize.points <- trellis.par.get("fontsize")$points ## cur.limits <- current.panel.limits() ## xscale <- cur.limits$xlim ## yscale <- cur.limits$ylim if (!notch) notch.frac <- 0 if (horizontal) { blist <- tapply(x, factor(y, levels = levels.fos), stats, coef = coef, do.out = do.out) blist.stats <- t(sapply(blist, "[[", "stats")) blist.out <- lapply(blist, "[[", "out") blist.height <- box.width # box.ratio / (1 + box.ratio) if (varwidth) { maxn <- max(table(y)) blist.n <- sapply(blist, "[[", "n") blist.height <- sqrt(blist.n / maxn) * blist.height } ## start of major changes to support notches blist.conf <- if (notch) t(sapply(blist, "[[", "conf")) else blist.stats[ , c(2,4), drop = FALSE] xbnd <- cbind(blist.stats[, 3], blist.conf[, 2], blist.stats[, 4], blist.stats[, 4], blist.conf[, 2], blist.stats[, 3], blist.conf[, 1], blist.stats[, 2], blist.stats[, 2], blist.conf[, 1], blist.stats[, 3]) ytop <- levels.fos + blist.height / 2 ybot <- levels.fos - blist.height / 2 ybnd <- cbind(ytop - notch.frac * blist.height / 2, ytop, ytop, ybot, ybot, ybot + notch.frac * blist.height / 2, ybot, ybot, ytop, ytop, ytop - notch.frac * blist.height / 2) ## xs <- matrix(NA_real_, nrow = nrow(xbnd) * 2, ncol = ncol(xbnd)) ## ys <- matrix(NA_real_, nrow = nrow(xbnd) * 2, ncol = ncol(xbnd)) ## xs[seq(along.with = levels.fos, by = 2), ] <- xbnd[seq(along.with = levels.fos), ] ## ys[seq(along.with = levels.fos, by = 2), ] <- ybnd[seq(along.with = levels.fos), ] ## box ## append NA-s to demarcate between boxes xs <- cbind(xbnd, NA_real_) ys <- cbind(ybnd, NA_real_) panel.polygon(t(xs), t(ys), lwd = box.rectangle$lwd, lty = box.rectangle$lty, col = fill, alpha = box.rectangle$alpha, border = box.rectangle$col, identifier = paste(identifier, "box", sep=".")) ## end of major changes to support notches ## whiskers panel.segments(c(blist.stats[, 2], blist.stats[, 4]), rep(levels.fos, 2), c(blist.stats[, 1], blist.stats[, 5]), rep(levels.fos, 2), col = box.umbrella$col, alpha = box.umbrella$alpha, lwd = box.umbrella$lwd, lty = box.umbrella$lty, identifier = paste(identifier, "whisker", sep=".")) panel.segments(c(blist.stats[, 1], blist.stats[, 5]), levels.fos - blist.height / 2, c(blist.stats[, 1], blist.stats[, 5]), levels.fos + blist.height / 2, col = box.umbrella$col, alpha = box.umbrella$alpha, lwd = box.umbrella$lwd, lty = box.umbrella$lty, identifier = paste(identifier, "cap", sep=".")) ## dot if (all(!is.na(pch) & pch == "|")) { mult <- if (notch) 1 - notch.frac else 1 panel.segments(blist.stats[, 3], levels.fos - mult * blist.height / 2, blist.stats[, 3], levels.fos + mult * blist.height / 2, lwd = box.rectangle$lwd, lty = box.rectangle$lty, col = box.rectangle$col, alpha = alpha, identifier = paste(identifier, "dot", sep=".")) } else { panel.points(x = blist.stats[, 3], y = levels.fos, pch = pch, col = col, alpha = alpha, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), fontsize = fontsize.points, identifier = paste(identifier, "dot", sep=".")) } ## outliers panel.points(x = unlist(blist.out), y = rep(levels.fos, sapply(blist.out, length)), pch = plot.symbol$pch, col = plot.symbol$col, alpha = plot.symbol$alpha, cex = plot.symbol$cex, fontfamily = plot.symbol$fontfamily, fontface = chooseFace(plot.symbol$fontface, plot.symbol$font), fontsize = fontsize.points, identifier = paste(identifier, "outlier", sep=".")) } else { blist <- tapply(y, factor(x, levels = levels.fos), stats, coef = coef, do.out = do.out) blist.stats <- t(sapply(blist, "[[", "stats")) blist.out <- lapply(blist, "[[", "out") blist.height <- box.width # box.ratio / (1 + box.ratio) if (varwidth) { maxn <- max(table(x)) blist.n <- sapply(blist, "[[", "n") blist.height <- sqrt(blist.n / maxn) * blist.height } blist.conf <- if (notch) sapply(blist, "[[", "conf") else t(blist.stats[ , c(2,4), drop = FALSE]) ybnd <- cbind(blist.stats[, 3], blist.conf[2, ], blist.stats[, 4], blist.stats[, 4], blist.conf[2, ], blist.stats[, 3], blist.conf[1, ], blist.stats[, 2], blist.stats[, 2], blist.conf[1, ], blist.stats[, 3]) xleft <- levels.fos - blist.height / 2 xright <- levels.fos + blist.height / 2 xbnd <- cbind(xleft + notch.frac * blist.height / 2, xleft, xleft, xright, xright, xright - notch.frac * blist.height / 2, xright, xright, xleft, xleft, xleft + notch.frac * blist.height / 2) ## xs <- matrix(NA_real_, nrow = nrow(xbnd) * 2, ncol = ncol(xbnd)) ## ys <- matrix(NA_real_, nrow = nrow(xbnd) * 2, ncol = ncol(xbnd)) ## xs[seq(along.with = levels.fos, by = 2), ] <- xbnd[seq(along.with = levels.fos), ] ## ys[seq(along.with = levels.fos, by = 2), ] <- ybnd[seq(along.with = levels.fos), ] ## box ## append NA-s to demarcate between boxes xs <- cbind(xbnd, NA_real_) ys <- cbind(ybnd, NA_real_) panel.polygon(t(xs), t(ys), lwd = box.rectangle$lwd, lty = box.rectangle$lty, col = fill, alpha = box.rectangle$alpha, border = box.rectangle$col, identifier = paste(identifier, "box", sep=".")) ## whiskers panel.segments(rep(levels.fos, 2), c(blist.stats[, 2], blist.stats[, 4]), rep(levels.fos, 2), c(blist.stats[, 1], blist.stats[, 5]), col = box.umbrella$col, alpha = box.umbrella$alpha, lwd = box.umbrella$lwd, lty = box.umbrella$lty, identifier = paste(identifier, "whisker", sep=".")) panel.segments(levels.fos - blist.height / 2, c(blist.stats[, 1], blist.stats[, 5]), levels.fos + blist.height / 2, c(blist.stats[, 1], blist.stats[, 5]), col = box.umbrella$col, alpha = box.umbrella$alpha, lwd = box.umbrella$lwd, lty = box.umbrella$lty, identifier = paste(identifier, "cap", sep=".")) ## dot if (all(!is.na(pch) & pch == "|")) { mult <- if (notch) 1 - notch.frac else 1 panel.segments(levels.fos - mult * blist.height / 2, blist.stats[, 3], levels.fos + mult * blist.height / 2, blist.stats[, 3], lwd = box.rectangle$lwd, lty = box.rectangle$lty, col = box.rectangle$col, alpha = alpha, identifier = paste(identifier, "dot", sep=".")) } else { panel.points(x = levels.fos, y = blist.stats[, 3], pch = pch, col = col, alpha = alpha, cex = cex, fontfamily = fontfamily, fontface = chooseFace(fontface, font), fontsize = fontsize.points, identifier = paste(identifier, "dot", sep=".")) } ## outliers panel.points(x = rep(levels.fos, sapply(blist.out, length)), y = unlist(blist.out), pch = plot.symbol$pch, col = plot.symbol$col, alpha = plot.symbol$alpha, cex = plot.symbol$cex, fontfamily = plot.symbol$fontfamily, fontface = chooseFace(plot.symbol$fontface, plot.symbol$font), fontsize = fontsize.points, identifier = paste(identifier, "outlier", sep=".")) } } panel.violin <- function(x, y, box.ratio = 1, box.width = box.ratio / (1 + box.ratio), horizontal = TRUE, alpha = plot.polygon$alpha, border = plot.polygon$border, lty = plot.polygon$lty, lwd = plot.polygon$lwd, col = plot.polygon$col, varwidth = FALSE, bw = NULL, adjust = NULL, kernel = NULL, window = NULL, width = NULL, n = 50, from = NULL, to = NULL, cut = NULL, na.rm = TRUE, ..., identifier = "violin") { if (all(is.na(x) | is.na(y))) return() x <- as.numeric(x) y <- as.numeric(y) ##reference.line <- trellis.par.get("reference.line") plot.polygon <- trellis.par.get("plot.polygon") ## density doesn't handle unrecognized arguments (not even to ## ignore it). A tedious but effective way to handle that is to ## have all arguments to density be formal arguments to this panel ## function, as follows: darg <- list() darg$bw <- bw darg$adjust <- adjust darg$kernel <- kernel darg$window <- window darg$width <- width darg$n <- n darg$from <- from darg$to <- to darg$cut <- cut darg$na.rm <- na.rm .density <- function(x, density.args) { if (stats::sd(x, na.rm = TRUE) > 0) do.call(stats::density, c(list(x = x), density.args)) else list(x = rep(x[1], 3), y = c(0, 1, 0)) } numeric.list <- if (horizontal) split(x, factor(y)) else split(y, factor(x)) # Recycle arguments # Add index to ensure that arguments are multiple of number of groups darg$index <- seq_along(numeric.list) darg <- tryCatch({ do.call(data.frame, darg) }, error = function(e) { darg$index <- NULL stop(gettextf("length of '%s' must be 1 or multiple of group length (%d)", paste0(names(darg), collapse = ', '), length(numeric.list))) }) darg$index <- NULL levels.fos <- as.numeric(names(numeric.list)) d.list <- lapply(seq_along(numeric.list), function(i) { .density(numeric.list[[i]], darg[i, ]) }) ## n.list <- sapply(numeric.list, length) UNNECESSARY dx.list <- lapply(d.list, "[[", "x") dy.list <- lapply(d.list, "[[", "y") max.d <- sapply(dy.list, max) if (varwidth) max.d[] <- max(max.d) ##str(max.d) # Plot arguments either 1 or multiple of number of groups plot.arg <- list() plot.arg$alpha <- alpha # Map fill = col, col = border for gpar call plot.arg$fill <- col plot.arg$col <- border plot.arg$lty <- lty plot.arg$lwd <- lwd plot.arg$index <- seq_along(numeric.list) plot.arg <- tryCatch({ do.call(data.frame, plot.arg) }, error = function(e) { plot.arg$index <- NULL stop(sprintf('%s must be length 1 or a vector of length multiple of group length (%d)', paste0(names(plot.arg), collapse = ', '), length(numeric.list))) }) plot.arg$index <- NULL cur.limits <- current.panel.limits() xscale <- cur.limits$xlim yscale <- cur.limits$ylim height <- box.width # box.ratio / (1 + box.ratio) if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 if (horizontal) { for (i in seq_along(levels.fos)) { if (is.finite(max.d[i])) { pushViewport(viewport(y = unit(levels.fos[i], "native"), height = unit(height, "native"), yscale = c(max.d[i] * c(-1, 1)), xscale = xscale)) grid.polygon(x = c(dx.list[[i]], rev(dx.list[[i]])), y = c(dy.list[[i]], -rev(dy.list[[i]])), default.units = "native", name = trellis.grobname(identifier, type = "panel", group = group), gp = do.call(gpar, plot.arg[i, ])) popViewport() } } } else { for (i in seq_along(levels.fos)) { if (is.finite(max.d[i])) { pushViewport(viewport(x = unit(levels.fos[i], "native"), width = unit(height, "native"), xscale = c(max.d[i] * c(-1, 1)), yscale = yscale)) grid.polygon(y = c(dx.list[[i]], rev(dx.list[[i]])), x = c(dy.list[[i]], -rev(dy.list[[i]])), default.units = "native", name = trellis.grobname(identifier, type = "panel", group = group), gp = do.call(gpar, plot.arg[i, ])) popViewport() } } } invisible() } ### dotplot, barchart and stripplot: essentially wrappers to bwplot dotplot <- function(x, data, ...) UseMethod("dotplot") ## dotplot.numeric <- ## function(formula, data = NULL, xlab = deparse(substitute(formula)), ...) ## { ## ## old version: ## ## nm <- deparse(substitute(formula)) ## ## formula <- as.formula(paste("~", nm)) ## ## or formula <- eval(substitute(~foo, list(foo = substitute(formula)))) ## ## both have the problem that they don't evaluate the formula ## this last attempt had problems with evaluations ## (e.g. dotplot(x, groups = a): ## if (!missing(data)) ## warning("explicit 'data' specification ignored") ## dotplot(~x, data = list(x = formula), ## xlab = xlab, ## ...) ## } dotplot.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::dotplot) ans <- eval.parent(ccall) ans$call <- ocall ans } dotplot.table <- function(x, data = NULL, groups = TRUE, ..., horizontal = TRUE) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) if (!is.null(data)) warning("explicit 'data' specification ignored") data <- as.data.frame(x) nms <- names(data) freq <- which(nms == "Freq") nms <- nms[-freq] form <- ## WAS paste(nms[1], "Freq", sep = "~") sprintf(if (horizontal) "%s ~ Freq" else "Freq ~ %s", nms[1]) nms <- nms[-1] len <- length(nms) if (is.logical(groups) && groups && len > 0) { groups <- as.name(nms[len]) nms <- nms[-len] len <- length(nms) } else groups <- NULL if (len > 0) { rest <- paste(nms, collapse = "+") form <- paste(form, rest, sep = "|") } modifyList(dotplot(as.formula(form), data, groups = eval(groups), ...), list(call = ocall)) } dotplot.default <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) modifyList(dotplot(table(x), data, ...), list(call = ocall)) } dotplot.array <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) modifyList(dotplot(as.table(x), data, ...), list(call = ocall)) } dotplot.matrix <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) modifyList(dotplot(as.table(x), data, ...), list(call = ocall)) } dotplot.formula <- function(x, data = NULL, panel = lattice.getOption("panel.dotplot"), default.prepanel = lattice.getOption("prepanel.default.dotplot"), ...) { ocall <- sys.call(); ocall[[1]] <- quote(dotplot) ccall <- match.call() ccall$data <- data ccall$panel <- panel ccall$default.prepanel <- default.prepanel ccall[[1]] <- quote(lattice::bwplot) ans <- eval.parent(ccall) ans$call <- ocall ans } barchart <- function(x, data, ...) UseMethod("barchart") barchart.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::barchart) ans <- eval.parent(ccall) ans$call <- ocall ans } barchart.table <- function(x, data = NULL, groups = TRUE, origin = 0, stack = TRUE, ..., horizontal = TRUE) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) if (!is.null(data)) warning("explicit 'data' specification ignored") data <- as.data.frame(x) nms <- names(data) freq <- which(nms == "Freq") nms <- nms[-freq] form <- ## WAS paste(nms[1], "Freq", sep = "~") sprintf(if (horizontal) "%s ~ Freq" else "Freq ~ %s", nms[1]) nms <- nms[-1] len <- length(nms) if (is.logical(groups) && groups && len > 0) { groups <- as.name(nms[len]) nms <- nms[-len] len <- length(nms) } else groups <- NULL if (len > 0) { rest <- paste(nms, collapse = "+") form <- paste(form, rest, sep = "|") } modifyList(barchart(as.formula(form), data, groups = eval(groups), ##groups = groups, origin = origin, stack = stack, ...), list(call = ocall)) } barchart.default <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) modifyList(barchart(table(x), data, ...), list(call = ocall)) } barchart.array <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) modifyList(barchart(as.table(x), data, ...), list(call = ocall)) } barchart.matrix <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) modifyList(barchart(as.table(x), data, ...), list(call = ocall)) } barchart.formula <- function(x, data = NULL, panel = lattice.getOption("panel.barchart"), default.prepanel = lattice.getOption("prepanel.default.barchart"), box.ratio = 2, ...) { ocall <- sys.call(); ocall[[1]] <- quote(barchart) ccall <- match.call() ccall$data <- data ccall$panel <- panel ccall$default.prepanel <- default.prepanel ccall$box.ratio <- box.ratio ccall[[1]] <- quote(lattice::bwplot) ans <- eval.parent(ccall) ans$call <- ocall ans } stripplot <- function(x, data, ...) UseMethod("stripplot") stripplot.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(stripplot) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::stripplot) ans <- eval.parent(ccall) ans$call <- ocall ans } stripplot.formula <- function(x, data = NULL, panel = lattice.getOption("panel.stripplot"), default.prepanel = lattice.getOption("prepanel.default.stripplot"), ...) { ocall <- sys.call(); ocall[[1]] <- quote(stripplot) ccall <- match.call() ccall$data <- data ccall$panel <- panel ccall$default.prepanel <- default.prepanel ccall[[1]] <- quote(lattice::bwplot) ans <- eval.parent(ccall) ans$call <- ocall ans } ### bwplot (the workhorse) bwplot <- function(x, data, ...) UseMethod("bwplot") bwplot.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(bwplot) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::bwplot) ans <- eval.parent(ccall) ans$call <- ocall ans } bwplot.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = FALSE, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.bwplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, box.ratio = 1, horizontal = NULL, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = if (horizontal) list(y = list(tck = 0, alternating = FALSE, rot = 0)) else list(x = list(tck = 0, alternating = FALSE)), default.prepanel = lattice.getOption("prepanel.default.bwplot"), subscripts = !is.null(groups), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## step 0: hack to get appropriate legend with auto.key = TRUE in ## barchart (default panel only). The usual default in bwplot is ## appropriate for dotplot and stripplot (groups is usually not ## meaningful in bwplot itself). is.standard.barchart <- is.character(panel) && panel == "panel.barchart" ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if (subscripts) subscr <- form$subscr cond <- form$condition x <- form$right y <- form$left if (is.null(y)) { y <- rep(if (is.null(names(x))) '' else names(x), length.out = length(x)) y <- factor(y, levels = unique(y)) } if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (is.null(horizontal)) { horizontal <- if ((is.factor(x) || is.shingle(x) || is.character(x)) && is.numeric(y)) FALSE else TRUE } if (horizontal) { ## if (!(is.numeric(x))) ## { ## warning("x should be numeric") ## } y <- as.factorOrShingle(y) is.f.y <- is.factor(y) # used throughout the rest of the code num.l.y <- nlevels(y) if (missing(xlab)) xlab <- form$right.name if (missing(ylab)) ylab <- if (is.f.y) NULL else form$left.name } else { ## if (!(is.numeric(y))) ## { ## warning("y should be numeric") ## } x <- as.factorOrShingle(x) is.f.x <- is.factor(x) # used throughout the rest of the code num.l.x <- nlevels(x) if (missing(ylab)) ylab <- form$left.name if (missing(xlab)) xlab <- if (is.f.x) NULL else form$right.name } ## create a skeleton trellis object with the ## less complicated components: foo <- do.call(trellis.skeleton, c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = form$right.name, ylab.default = form$left.name, lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(bwplot) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call(construct.scales, scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { ## warning("Are you sure you want log scale for y ?") ylog <- foo$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) y <- log(y, ybase) if (have.ylim) ylim <- logLimits(ylim, ybase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- dots foo$panel.args.common$box.ratio <- box.ratio foo$panel.args.common$horizontal <- horizontal if (subscripts) foo$panel.args.common$groups <- groups ## only used if shingle, important if some levels are missing if (horizontal) { if (!is.f.y) ## y shingle foo$panel.args.common$nlevels <- num.l.y } else { if (!is.f.x) ## x shingle foo$panel.args.common$nlevels <- num.l.x } npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) if (horizontal) { if (is.f.y) { foo$panel.args[[packet.number]] <- list(x = x[id], y = y[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] } else # shingle { panel.x <- numeric(0) panel.y <- numeric(0) if (subscripts) panel.subscr <- numeric(0) for (k in seq_len(num.l.y)) { tid <- id & (y >= levels(y)[[k]][1]) & (y <= levels(y)[[k]][2]) panel.x <- c(panel.x, x[tid]) panel.y <- c(panel.y, rep(k,length(tid[tid]))) if (subscripts) panel.subscr <- c(panel.subscr, subscr[tid]) } foo$panel.args[[packet.number]] <- list(x = panel.x, y = panel.y) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- panel.subscr } } else { if (is.f.x) { foo$panel.args[[packet.number]] <- list(x = x[id], y = y[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] } else # shingle { panel.x <- numeric(0) panel.y <- numeric(0) if (subscripts) panel.subscr <- numeric(0) for (k in seq_len(num.l.x)) { tid <- id & (x >= levels(x)[[k]][1]) & (x <= levels(x)[[k]][2]) panel.y <- c(panel.y, y[tid]) panel.x <- c(panel.x, rep(k,length(tid[tid]))) if (subscripts) panel.subscr <- c(panel.subscr, subscr[tid]) } foo$panel.args[[packet.number]] <- list(x = panel.x, y = panel.y) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- panel.subscr } } cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = if (is.standard.barchart) FALSE else TRUE, rectangles = if (is.standard.barchart) TRUE else FALSE, lines = FALSE), auto.key) } class(foo) <- "trellis" foo } lattice/R/interaction.R0000644000176200001440000006565714410535457014575 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### Copyright (C) 2007 Felix Andrews ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ### the code here deals with interacting (via grid viewports) with a ### lattice plot after it is made ## utility used in panel.identify getTextPosition <- function(x, y) ## returns position 1: below, 2: left, 3: above, 4: right (w.r.t ## origin). Used as a tool in panel.identify. { a <- abs(c(x, y)) if (y <= 0 && a[1] <= -y) 1 else if (x <= 0 && a[2] <= -x) 2 else if (y >= 0 && a[1] <= y) 3 else if (x >= 0 && a[2] <= x) 4 } panel.identify <- function(x, y = NULL, subscripts = seq_along(x), labels = subscripts, n = length(x), offset = 0.5, threshold = 18, ## in points, roughly 0.25 inches panel.args = trellis.panelArgs(), ...) ## ... goes to ltext { if (missing(x)) { x <- panel.args$x y <- panel.args$y if (missing(subscripts) && !is.null(panel.args$subscripts)) subscripts <- panel.args$subscripts } xy <- xy.coords(x, y, recycle = TRUE) x <- xy$x y <- xy$y px <- convertX(unit(x, "native"), "points", TRUE) py <- convertY(unit(y, "native"), "points", TRUE) labels <- as.character(labels) if (length(labels) > length(subscripts)) labels <- labels[subscripts] unmarked <- rep(TRUE, length(x)) count <- 0 while (count < n) { ll <- grid.locator(unit = "points") if (is.null(ll)) break ## non-left click lx <- convertX(ll$x, "points", TRUE) ly <- convertY(ll$y, "points", TRUE) pdists <- sqrt((px - lx)^2 + (py - ly)^2) if (min(pdists, na.rm = TRUE) > threshold) warning("no observations within ", threshold, " points") else { w <- which.min(pdists) if (unmarked[w]) { pos <- getTextPosition(x = lx - px[w], y = ly - py[w]) ltext(x[w], y[w], labels[w], pos = pos, offset = offset, ..., identifier = "identify") unmarked[w] <- FALSE count <- count + 1 } else warning("nearest observation already identified") } } subscripts[!unmarked] } ## identify for cloud(). This is a lot more complicated because we ## need to redo all the projection calculations. The first bit is a ## function that separates out the panel.identify() functionality. panel.3didentify <- function(x, y, z, rot.mat = diag(4), distance, xlim.scaled, ylim.scaled, zlim.scaled, subscripts = seq_along(x), labels = subscripts, n = length(x), offset = 0.5, threshold = 18, ## in points, roughly 0.25 inches ...) ## ... goes to ltext { ## 2-D projection id <- ((x >= xlim.scaled[1]) & (x <= xlim.scaled[2]) & (y >= ylim.scaled[1]) & (y <= ylim.scaled[2]) & (z >= zlim.scaled[1]) & (z <= zlim.scaled[2]) & !is.na(x) & !is.na(y) & !is.na(z)) m <- ltransform3dto3d(rbind(x, y, z), rot.mat, distance) x <- m[1, ] y <- m[2, ] ## rest is like panel.identify px <- convertX(unit(x, "native"), "points", TRUE) py <- convertY(unit(y, "native"), "points", TRUE) is.na(px) <- is.na(py) <- !id # make these unavailable labels <- as.character(labels) if (length(labels) > length(subscripts)) labels <- labels[subscripts] unmarked <- rep(TRUE, length(x)) count <- 0 while (count < n) { ll <- grid.locator(unit = "points") if (is.null(ll)) break ## non-left click lx <- convertX(ll$x, "points", TRUE) ly <- convertY(ll$y, "points", TRUE) pdists <- sqrt((px - lx)^2 + (py - ly)^2) if (min(pdists, na.rm = TRUE) > threshold) warning("no observations within ", threshold, " points") else { w <- which.min(pdists) if (unmarked[w]) { pos <- getTextPosition(x = lx - px[w], y = ly - py[w]) ltext(x[w], y[w], labels[w], pos = pos, offset = offset, ...) unmarked[w] <- FALSE count <- count + 1 } else warning("nearest observation already identified") } } subscripts[!unmarked] } ## The more involved part is the wrapper that computes the projections ## etc. panel.identify.cloud <- function(x = panel.args$x, y = panel.args$y, z = panel.args$z, subscripts = panel.args$subscripts, perspective = TRUE, distance = if (perspective) 0.2 else 0, xlim = panel.args$xlim, ylim = panel.args$ylim, zlim = panel.args$zlim, screen = list(z = 40, x = -60), R.mat = diag(4), aspect = c(1, 1), scales.3d = panel.args$scales.3d, ..., panel.3d.identify = panel.3didentify, n = length(subscripts), offset = 0.5, threshold = 18, ## in points, roughly 0.25 inches labels = subscripts, panel.args = trellis.panelArgs()) { argOrDefault <- function(arg) { if (is.null(panel.args[[arg]])) get(arg) # default else panel.args[[arg]] } if (missing(perspective)) perspective <- argOrDefault("perspective") if (missing(distance)) distance <- argOrDefault("distance") if (missing(screen)) screen <- argOrDefault("screen") if (missing(R.mat)) R.mat <- argOrDefault("R.mat") if (missing(aspect)) aspect <- argOrDefault("aspect") ## if (missing()) <- argOrDefault("") if (is.factor(x)) x <- as.numeric(x) if (is.factor(y)) y <- as.numeric(y) if (is.factor(z)) z <- as.numeric(z) ## calculate rotation matrix: rot.mat <- ltransform3dMatrix(screen = screen, R.mat = R.mat) if (length(subscripts) == 0) ## nothing to do return (integer(0)) xlabelinfo <- calculateAxisComponents(xlim, at = scales.3d$x$at, num.limit = NULL, labels = scales.3d$x$labels, logsc = scales.3d$x$log, abbreviate = scales.3d$x$abbreviate, minlength = scales.3d$x$minlength, format.posixt = scales.3d$x$format, n = scales.3d$x$tick.number) ylabelinfo <- calculateAxisComponents(ylim, at = scales.3d$y$at, num.limit = NULL, labels = scales.3d$y$labels, logsc = scales.3d$y$log, abbreviate = scales.3d$y$abbreviate, minlength = scales.3d$y$minlength, format.posixt = scales.3d$y$format, n = scales.3d$y$tick.number) zlabelinfo <- calculateAxisComponents(zlim, at = scales.3d$z$at, num.limit = NULL, labels = scales.3d$z$labels, logsc = scales.3d$z$log, abbreviate = scales.3d$z$abbreviate, minlength = scales.3d$z$minlength, format.posixt = scales.3d$z$format, n = scales.3d$z$tick.number) xlim <- xlabelinfo$num.limit ylim <- ylabelinfo$num.limit zlim <- zlabelinfo$num.limit aspect <- rep(aspect, length.out = 2) x <- x[subscripts] y <- y[subscripts] z <- z[subscripts] corners <- data.frame(x = c(-1, 1, 1,-1,-1, 1, 1,-1), y = c(-1,-1,-1,-1, 1, 1, 1, 1) * aspect[1], z = c(-1,-1, 1, 1,-1,-1, 1, 1) * aspect[2]) corners <- corners / (2 * max(corners)) ## contain in [-.5, .5] cube xlim.scaled <- range(corners$x) ylim.scaled <- range(corners$y) zlim.scaled <- range(corners$z) ## box ranges and lengths cmin <- lapply(corners, min) ## cmax <- lapply(corners, max) clen <- lapply(corners, function(x) diff(range(x, finite = TRUE))) ## scaled (to bounding box) data x <- cmin$x + clen$x * (x-xlim[1])/diff(xlim) y <- cmin$y + clen$y * (y-ylim[1])/diff(ylim) z <- cmin$z + clen$z * (z-zlim[1])/diff(zlim) panel.3d.identify(x, y, z, rot.mat = rot.mat, distance = distance, xlim.scaled = xlim.scaled, ylim.scaled = ylim.scaled, zlim.scaled = zlim.scaled, subscripts = subscripts, labels = labels, n = length(x), offset = 0.5, threshold = 18, ...) } trellis.vpname <- function(name = c("position", "split", "split.location", "toplevel", "figure", "panel", "strip", "strip.left", "legend", "legend.region", "main", "sub", "xlab", "ylab", "xlab.top", "ylab.right", "page"), column = lattice.getStatus("current.focus.column", prefix = prefix), row = lattice.getStatus("current.focus.row", prefix = prefix), side = c("left", "top", "right", "bottom", "inside"), clip.off = FALSE, prefix = lattice.getStatus("current.prefix")) { name <- match.arg(name) side <- match.arg(side) paste(prefix, switch(name, position = "position.vp", split = "split.vp", split.location = "split.location.vp", toplevel = "toplevel.vp", figure = "figure.vp", xlab = "xlab.vp", ylab = "ylab.vp", main = "main.vp", sub = "sub.vp", xlab.top = "xlab.top.vp", ylab.right = "ylab.right.vp", panel = if (clip.off) paste("panel", column, row, "off", "vp", sep = ".") else paste("panel", column, row, "vp", sep = "."), strip = if (clip.off) paste("strip", column, row, "off", "vp", sep = ".") else paste("strip", column, row, "vp", sep = "."), strip.left = if (clip.off) paste("strip.left", column, row, "off", "vp", sep = ".") else paste("strip.left", column, row, "vp", sep = "."), legend = paste("legend", side, "vp", sep = "."), legend.region = "legend.region.vp"), sep = ".") } trellis.grobname <- function(name, type = c("", "panel", "strip", "strip.left", "key", "colorkey"), group = 0, which.given = lattice.getStatus("current.which.given", prefix = prefix), which.panel = lattice.getStatus("current.which.panel", prefix = prefix), column = lattice.getStatus("current.focus.column", prefix = prefix), row = lattice.getStatus("current.focus.row", prefix = prefix), prefix = lattice.getStatus("current.prefix")) { stripname <- function(striplab, name, column, row, which.given, which.panel) { if (length(which.panel) > 1) { paste(name, "given", which.given, striplab, column, row, sep=".") } else { paste(name, striplab, column, row, sep=".") } } if (group > 0) name <- paste(name, "group", group, sep=".") paste(prefix, switch(type, panel=paste(name, type, column, row, sep="."), strip=, strip.left=stripname(type, name, column, row, which.given, which.panel), key=, colorkey=paste(type, name, sep="."), name), sep = ".") } ### Primary user-level interface to `focus' on viewports created by ### plot.trellis(), so that existing plots can be augmented. Multiple ### plots can exist on a given page, and all of them are usually ### accessible using different 'prefix' argument. To keep code ### simple, many utility functions related to interaction assume that ### lattice.getStatus("current.prefix") gives the correct prefix when ### they are called. Only trellis.focus() allows an explicit 'prefix' ### argument, and sets 'current.prefix' to 'prefix' when it is called. ### To switch to a not-currently-active trellis plot, one must thus ### use trellis.focus() before any other functions. trellis.focus <- function(name, column = stop("column must be specified"), row = stop("row must be specified"), side = NULL, clip.off = FALSE, highlight = interactive(), ..., prefix, guess = TRUE, verbose = getOption("verbose")) { trellis.unfocus() if (!missing(prefix)) lattice.setStatus(current.prefix = prefix) else prefix <- lattice.getStatus("current.prefix") if (missing(name) && missing(column) && missing(row)) return(trellis.clickFocus(clip.off = clip.off, highlight = highlight, ..., guess = guess, verbose = verbose)) if (name %in% c("panel", "strip", "strip.left")) { ll <- lattice.getStatus("current.panel.positions", prefix = prefix) if (column > 0 && row > 0 && column <= ncol(ll) && row <= nrow(ll) && ll[row, column] > 0) ## to disallow empty positions { lattice.setStatus(current.focus.column = column, current.focus.row = row, prefix = prefix) } else stop("panel position unspecified or invalid") } else ## this is for calls from trellis.switchFocus { if (!missing(row)) lattice.setStatus(current.focus.row = row, prefix = prefix) if (!missing(column)) lattice.setStatus(current.focus.column = column, prefix = prefix) } lattice.setStatus(vp.depth = downViewport(trellis.vpname(name, side = side, clip.off = clip.off, prefix = prefix)), prefix = prefix) if (highlight) { lattice.setStatus(vp.highlighted = TRUE, prefix = prefix) gp <- do.call("gpar", updateList(lattice.getOption("highlight.gpar"), list(...))) lvp <- rectGrob(name = "lvp.highlight", gp = gp) grid.draw(lvp) } else { lattice.setStatus(vp.highlighted = FALSE, prefix = prefix) } invisible() } trellis.switchFocus <- function(name, side = NULL, clip.off = FALSE, highlight, ..., prefix) { if (!missing(prefix) && prefix != lattice.getStatus("current.prefix")) stop("'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first") prefix <- lattice.getStatus("current.prefix") row <- lattice.getStatus("current.focus.row", prefix = prefix) column <- lattice.getStatus("current.focus.column", prefix = prefix) if (missing(highlight)) highlight <- lattice.getStatus("vp.highlighted", prefix = prefix) ## have to evaluate these explicitly to avoid lazy evaluation ## inside trellis.focus trellis.focus(name = name, row = row, column = column, side = side, clip.off = clip.off, highlight = highlight, ...) } trellis.unfocus <- function() ## mainly, undo highlighting { prefix <- lattice.getStatus("current.prefix") if (lattice.getStatus("vp.highlighted", prefix = prefix)) { grid.remove("lvp.highlight", warn = FALSE) lattice.setStatus(vp.highlighted = FALSE, prefix = prefix) } lattice.setStatus(current.focus.column = 0, current.focus.row = 0, prefix = prefix) if (lattice.getStatus("vp.depth", prefix = prefix) > 0) upViewport(lattice.getStatus("vp.depth", prefix = prefix)) lattice.setStatus(vp.depth = 0, prefix = prefix) invisible() } trellis.panelArgs <- function(x, packet.number) { if (missing(x)) { x <- trellis.last.object() if (is.null(x)) stop("Plot object was not saved, cannot retrieve panel data") if (lattice.getStatus("current.plot.multipage", prefix = lattice.getStatus("current.prefix"))) warning("Plot spans multiple pages, only last page can be updated") } if (missing(packet.number)) { ## FIXME: workaround for unfortunate choice of names. May ## require more extensive changes ## pn <- get("packet.number", mode = "function") ## packet.number <- pn() ## How about this? packet.number <- lattice::packet.number() } if (!length(packet.number)) ## should be 0x0 matrix otherwise stop("You have to first select a panel using trellis.focus()") c(x$panel.args[[packet.number]], x$panel.args.common) } ### trellis.clickFocus() and panel.identify.qqmath() are based on ### contributions by Felix Andrews (2007/06/21) ### Click on a panel to focus on it. trellis.clickFocus() is not ### exported, but used by trellis.focus() when 'name' etc. is missing. trellis.clickFocus <- function(clip.off = FALSE, highlight = interactive(), ..., guess = TRUE, verbose = TRUE) { layoutMatrix <- trellis.currentLayout() if (guess && sum(layoutMatrix > 0) == 1) { ## there's only one panel, so just select it w <- which(layoutMatrix > 0) focusRow <- row(layoutMatrix)[w] focusCol <- col(layoutMatrix)[w] if (verbose) message(sprintf("Selecting panel at position (%g, %g)", focusRow, focusCol)) } else if (all(layoutMatrix == 0)) { warning("No panels available") return() } else { if (verbose) message("Click on panel to focus") trellis.focus("figure", highlight = FALSE) clickLoc <- grid.locator("npc") if (is.null(clickLoc)) return() focusCol <- ceiling(as.numeric(clickLoc$x) * ncol(layoutMatrix)) focusRow <- ceiling(as.numeric(clickLoc$y) * nrow(layoutMatrix)) if (lattice.getStatus("as.table", prefix = lattice.getStatus("current.prefix"))) focusRow <- nrow(layoutMatrix) - focusRow + 1 trellis.unfocus() } if ((focusCol >= 1) && (focusCol <= ncol(layoutMatrix)) && (focusRow >= 1) && (focusRow <= nrow(layoutMatrix)) && layoutMatrix[focusRow, focusCol] > 0) { trellis.focus("panel", column = focusCol, row = focusRow, clip.off = clip.off, highlight = highlight, ...) } else { focusCol <- focusRow <- 0 } invisible(list(col=focusCol, row=focusRow)) } ## old version: doesn't work with aspect != "fill" ## trellis.clickFocus <- ## function(clip.off = FALSE, ## highlight = interactive(), ## ..., ## guess = TRUE, ## verbose = TRUE) ## { ## layoutMatrix <- trellis.currentLayout() ## if (guess && sum(layoutMatrix > 0) == 1) ## { ## ## there's only one panel, so just select it ## w <- which(layoutMatrix > 0) ## focusRow <- row(layoutMatrix)[w] ## focusCol <- col(layoutMatrix)[w] ## if (verbose) message(sprintf("Selecting panel at position (%g, %g)", focusRow, focusCol)) ## } ## else if (all(layoutMatrix == 0)) ## { ## warning("No panels available") ## return() ## } ## else ## { ## if (verbose) message("Click on panel to focus") ## ## trellis.focus("toplevel", highlight = FALSE) ## glayout <- lattice.getStatus("layout.details") ## rowRange <- range(glayout$pos.heights$panel, glayout$pos.heights$strip) ## colRange <- range(glayout$pos.widths$panel, glayout$pos.widths$strip.left) ## layCols <- glayout$page.layout$ncol ## layRows <- glayout$page.layout$nrow ## leftPad <- convertX(sum(glayout$page.layout$widths[1:(colRange[1]-1)]), "npc", valueOnly = TRUE) ## rightPad <- convertX(sum(glayout$page.layout$widths[(colRange[2]+1):layCols]), "npc", valueOnly = TRUE) ## topPad <- convertY(sum(glayout$page.layout$heights[1:(rowRange[1]-1)]), "npc", valueOnly = TRUE) ## botPad <- convertY(sum(glayout$page.layout$heights[(rowRange[2]+1):layRows]), "npc", valueOnly = TRUE) ## clickLoc <- grid.locator("npc") ## if (is.null(clickLoc)) return() ## clickXScaled <- (as.numeric(clickLoc$x) - leftPad) / (1 - leftPad - rightPad) ## focusCol <- ceiling(clickXScaled * ncol(layoutMatrix)) ## clickYScaled <- (as.numeric(clickLoc$y) - botPad) / (1 - botPad - topPad) ## focusRow <- ceiling(clickYScaled * nrow(layoutMatrix)) ## if (lattice.getStatus("as.table")) focusRow <- nrow(layoutMatrix) - focusRow + 1 ## } ## if ((focusCol >= 1) && (focusCol <= ncol(layoutMatrix)) && ## (focusRow >= 1) && (focusRow <= nrow(layoutMatrix)) && ## layoutMatrix[focusRow, focusCol] > 0) ## { ## trellis.focus("panel", column = focusCol, row = focusRow, ## clip.off = clip.off, highlight = highlight, ## ...) ## } ## else ## { ## focusCol <- focusRow <- 0 ## } ## invisible(list(col=focusCol, row=focusRow)) ## } ### wrapper around panel.identify meant to work with qqmath. panel.identify.qqmath <- function(x = panel.args$x, distribution = panel.args$distribution, groups = panel.args$groups, subscripts = panel.args$subscripts, labels = subscripts, panel.args = trellis.panelArgs(), ...) { x <- as.numeric(x) if (is.null(subscripts)) subscripts <- seq_along(x) labels <- as.character(labels) if (length(labels) > length(subscripts)) labels <- labels[subscripts] if (!is.null(panel.args$f.value)) warning("'f.value' not supported; ignoring") distribution <- getFunctionOrName(distribution) ## compute quantiles corresponding to given vector, possibly ## containing NA's. The return value must correspond to the ## original order getq <- function(x) { ans <- x id <- !is.na(x) ord <- order(x[id]) if (any(id)) ans[id] <- distribution(ppoints(sum(id)))[order(ord)] ans } if (is.null(groups)) { ## panel.points(x = getq(x), y = x, pch = ".", col = "red", cex = 3) panel.identify(x = getq(x), y = x, labels = labels, ...) } else { allq <- rep(NA_real_, length(x)) subg <- groups[subscripts] vals <- if (is.factor(groups)) levels(groups) else sort(unique(groups)) for (i in seq_along(vals)) { ok <- !is.na(subg) & (subg == vals[i]) allq[ok] <- getq(x[ok]) } panel.identify(x = allq, y = x, labels = labels, ...) } } ### `link' for splom panel.link.splom <- function(threshold = 18, verbose = getOption("verbose"), ...) { ans <- numeric(0) repeat { new <- splom_linkPoint(threshold = threshold, verbose = verbose, ...) if (is.null(new)) break else ans[length(ans) + 1] <- new } ans } panel.brush.splom <- panel.link.splom # for back-compatibility splom_linkPoint <- function(pargs = trellis.panelArgs(), threshold = 18, col = 'black', pch = 16, cex = 0.8, ..., verbose = getOption("verbose")) { if (verbose) message("Click to choose one point to highlight") ll <- grid.locator(unit = "npc") if (is.null(ll)) return(NULL) nvars <- length(pargs$z) ## which subpanel colpos <- ceiling(convertUnit(ll$x, "npc", valueOnly = TRUE) * nvars) rowpos <- ceiling(convertUnit(ll$y, "npc", valueOnly = TRUE) * nvars) if (rowpos == colpos) return(numeric(0)) subpanel.name <- paste("subpanel", colpos, rowpos, sep = ".") ## coordinates of click in subpanel ll$x <- nvars * (ll$x - unit((colpos-1) / nvars, "npc")) ll$y <- nvars * (ll$y - unit((rowpos-1) / nvars, "npc")) ## get to that viewport, so we can convert units depth <- downViewport(subpanel.name) xnative <- convertX(ll$x, "native", TRUE) ynative <- convertY(ll$y, "native", TRUE) ## find nearest point in data (replicate steps in panel.identify) xpoints <- convertX(unit(xnative, "native"), "points", TRUE) ypoints <- convertY(unit(ynative, "native"), "points", TRUE) data.xp <- convertX(unit(pargs$z[, colpos], "native"), "points", TRUE) data.yp <- convertY(unit(pargs$z[, rowpos], "native"), "points", TRUE) pdists <- sqrt((data.xp - xpoints)^2 + (data.yp - ypoints)^2) if (min(pdists, na.rm = TRUE) > threshold) { if (verbose) warning("no points within ", threshold, " points of click") upViewport(depth) return(numeric(0)) } else { w <- which.min(pdists) if (verbose) print(pargs$z[w,]) upViewport(depth) for (row in 1:nvars) for (column in 1:nvars) if (row != column) { subpanel.name <- paste("subpanel", column, row, sep = ".") depth <- downViewport(subpanel.name) panel.points(x = pargs$z[w, column], y = pargs$z[w, row], pch = pch, col = col, cex = cex, ..., identifier = "link") upViewport(depth) } return(w) } } lattice/R/update.trellis.R0000644000176200001440000005063014413020055015160 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## retrieve trellis object saved during plotting trellis.last.object <- function(..., prefix = lattice.getStatus("current.prefix")) { ## if (warn && (!lattice.getStatus("current.plot.saved", prefix = prefix))) ## warning("Requested object was not saved") if (!lattice.getStatus("current.plot.saved", prefix = prefix)) { warning("Requested 'trellis' object was not saved") return(invisible(NULL)) } ans <- lattice.getStatus("last.object", prefix = prefix) ## FIXME: remove, as should not be needed any more ## if (is.null(ans)) { ## warning("Could not retrieve saved trellis object") ## return(invisible()) ## } update(ans, ...) } ## Not all arguments to xyplot etc can be supplied to ## update.trellis. Generally speaking, anything that needs to change ## the data within each panel is a no-no. Everything else is ## technically game, though implementation might be ## problematic. Here's a list of arguments that should work (list ## currently based on xyplot, may need to be updated later) ## panel ## aspect = "fill", ## as.table = FALSE, ## between, ## key, ## auto.key = FALSE, ## layout, ## main, ## page, ## par.strip.text, ## prepanel, ## scales, one of the problematic ones ## skip, ## strip, ## strip.left, ## sub, ## xlab, ## xlim, ## ylab, ## ylim, ## par.settings, ## ..., these should probably be added to the list of common panel arguments ## There is also the possibility of some update arguments that may not ## necessarily be valid arguments to xyplot etc (although we might ## change that). Currently these would be the perm and index arguments ## controlling reordering of conditioning variables and their levels. update.trellis <- function(object, panel, aspect, as.table, between, key, auto.key, legend, layout, main, page, par.strip.text, prepanel, scales, #one of the problematic ones skip, strip, strip.left, sub, xlab, ylab, xlab.top, ylab.right, xlim, ylim, xscale.components, yscale.components, axis, par.settings, plot.args, lattice.options, index.cond, perm.cond, ...) { ## modify call to reflect update upcall <- match.call() nm <- names(upcall) if (!is.null(nm)) { nm <- nm[nm != "" & nm != "object"] if (length(nm) == 0) { ## FIXME: drop this message before release ## cat("nothing to update with") return(object) } object$call[nm] <- upcall[nm] } have.xlim <- !missing(xlim) ## needed later have.ylim <- !missing(ylim) have.axs <- FALSE ## deal with the non-problematic stuff first if (!missing(as.table)) { if (is.logical(as.table)) object$as.table <- as.table else warning("Inappropriate value of 'as.table'") } if (!missing(between)) { if ("x" %in% names(between)) object$x.between <- between$x if ("y" %in% names(between)) object$y.between <- between$y } if (!missing(layout)) { object$layout <- layout } if (!missing(main)) object$main <- main if (!missing(sub)) object$sub <- sub if (!missing(xlab)) object$xlab <- xlab if (!missing(ylab)) object$ylab <- ylab if (!missing(xlab.top)) object$xlab.top <- xlab.top if (!missing(ylab.right)) object$ylab.right <- ylab.right if (!missing(page)) object$page <- page if (!missing(xscale.components)) object$xscale.components <- xscale.components if (!missing(yscale.components)) object$yscale.components <- yscale.components if (!missing(axis)) object$axis <- axis if (!missing(par.strip.text)) { ## this only overwrites earlier things, leaves alone those ## that are not specified explicitly if (is.list(par.strip.text)) object$par.strip.text <- updateList(object$par.strip.text, par.strip.text) else warning("'par.strip.text' must be a list") } if (!missing(skip)) object$skip <- skip if (!missing(strip)) { if (is.logical(strip)) { if (strip) object$strip <- strip.default else object$strip <- FALSE } else object$strip <- strip } if (!missing(strip.left)) { if (is.logical(strip.left)) { if (strip.left) object$strip.left <- strip.custom(horizontal = FALSE) else object$strip.left <- FALSE } else object$strip.left <- strip.left } if (!missing(par.settings)) { ## this only overwrites earlier things, leaves alone those ## that are not specified explicitly if (is.list(par.settings)) object$par.settings <- updateList(object$par.settings, par.settings) else warning("'par.settings' must be a list") } if (!missing(plot.args)) { ## this only overwrites earlier things, leaves alone those ## that are not specified explicitly if (is.list(plot.args)) object$plot.args <- updateList(object$plot.args, plot.args) else warning("'plot.args' must be a list") } if (!missing(lattice.options)) { ## this only overwrites earlier things, leaves alone those ## that are not specified explicitly if (is.list(lattice.options)) object$lattice.options <- updateList(object$lattice.options, lattice.options) else warning("'lattice.options' must be a list") } ## during construction of trellis objects, perm.cond and ## index.cond are calculated by the cond.orders function. We could ## do that here as well, but the perm.cond is really too trivial ## to bother. cond.orders() is called is index.cond is ## non-missing, and then it becomes important that perm.cond is ## processed first (in case it it non-missing as well). if (!missing(perm.cond)) { if (is.null(perm.cond)) object$perm.cond <- seq_len(length(object$condlevels)) else if (all(sort(perm.cond) == object$perm.cond)) object$perm.cond <- perm.cond else stop("Invalid value of 'perm.cond'") } if (!missing(index.cond)) { object$index.cond <- index.cond cond.ord <- cond.orders(object) object[names(cond.ord)] <- cond.ord } dots <- list(...) if (length(dots) > 0) { ##print(dots) ## for debugging, remove later object$panel.args.common <- updateList(object$panel.args.common, dots) } if (!missing(panel)) { panel <- getFunctionOrName(panel) ## if (as.character(object$call[[1]]) == "splom") if ("panel" %in% names(object$panel.args.common)) object$panel.args.common$panel <- panel else object$panel <- panel } ## the slightly complicated stuff if (!missing(legend)) { if (is.null(legend)) object$legend <- NULL else { ## Used to be: ## object$legend <- updateList(object$legend, legend) ## but that does not handle multiple components with same ## name, which can happen when there are multiple 'inside' ## components (lattice bug #2587). ## What should happen in that case? If there is one or ## more 'inside' in old, but none in new, retain all in ## the old. If there is one in the replacement, and one ## in the original, then the new should replace the old. ## If there are multiple, remove all in the old and retain ## all in the new. [One might argue that there should be ## the option of retaining the old, but in that case the ## user could add that manually to the new 'legend'. ] ## other components (left, right, top, bottom) are simply replaced winside <- which(names(legend) == "inside") if (length(winside) == 0L) # none in new { for (space in names(legend)) object$legend[[space]] <- legend[[space]] } else { object$legend <- object$legend[ names(object$legend) != "inside" ] new.insides <- legend[winside] legend <- legend[-winside] object$legend <- updateList(object$legend, legend) object$legend <- c(object$legend, new.insides) } } } if (!missing(key)) { object$legend <- updateList(object$legend, construct.legend(legend = NULL, key = key)) } if (!missing(auto.key)) { if (!is.null(object$legend)) message("Note: 'auto.key' ignored since legend already present.\nUse 'update(..., legend = NULL)' to remove existing legend(s)") else { groups <- object$panel.args.common$groups if (needAutoKey(auto.key, groups)) { ## Default is points = TRUE, lines = FALSE, rectangles ## = FALSE. Try harder if high-level function is ## xyplot / splom / barchart / histogram simpleKeyArgs <- c( list(text = levels(as.factor(groups))), switch(as.character(object$call[[1]]), barchart = , histogram = { list(points = FALSE, lines = FALSE, rectangles = TRUE) }, splom = , xyplot = { type <- dots$type if (is.null(type)) type <- object$panel.args.common$type if (is.character(type) && length(type) > 0) { points <- any(type %in% "p") lines <- any(type %in% c("l", "b", "o", "h", "s", "S", "a", "smooth", "spline", "r")) keytype <- if (any(type %in% c("b", "o"))) "o" else "l" } else { points <- TRUE lines <- FALSE keytype <- "l" } list(points = points, rectangles = FALSE, lines = lines, type = keytype) }, list(points = TRUE, lines = FALSE, rectangles = FALSE)) ) object$legend <- autoKeyLegend(simpleKeyArgs, auto.key) } } } relationChanged <- FALSE if (!missing(scales)) ## FIXME: this needs special handling for cloud, but leave that for later { if (is.character(scales)) scales <- list(relation = scales) xscales <- scales$x yscales <- scales$y zscales <- scales$z scales$x <- NULL scales$y <- NULL scales$z <- NULL if (is.character(xscales)) xscales <- list(relation = xscales) if (is.character(yscales)) yscales <- list(relation = yscales) if (is.character(zscales)) zscales <- list(relation = zscales) if (!is.null(scales$log) || !is.null(xscales$log) || !is.null(yscales$log) || !is.null(zscales$log)) { warning("log scales cannot be changed via 'update'") scales$log <- NULL xscales$log <- NULL yscales$log <- NULL zscales$log <- NULL } if (!is.null(scales$axs) || !is.null(xscales$axs) || !is.null(yscales$axs)) have.axs <- TRUE if (is.logical(scales$alternating)) scales$alternating <- if (scales$alternating) c(1,2) else 1 if (is.logical(xscales$alternating)) xscales$alternating <- if (xscales$alternating) c(1,2) else 1 if (is.logical(yscales$alternating)) yscales$alternating <- if (yscales$alternating) c(1,2) else 1 ## cannot possibly make sense for z rep2IfNotNULL <- function(x) { if (is.null(x)) NULL else rep(x, length.out = 2) } for (nm in c("tck", "cex", "rot")) { scales[[nm]] <- rep2IfNotNULL(scales[[nm]]) xscales[[nm]] <- rep2IfNotNULL(xscales[[nm]]) yscales[[nm]] <- rep2IfNotNULL(yscales[[nm]]) zscales[[nm]] <- rep2IfNotNULL(zscales[[nm]]) } if (!is.null(scales$limits)) { have.xlim <- TRUE have.ylim <- TRUE ##have.zlim <- TRUE xlim <- scales$limits ylim <- scales$limits ##zlim <- scales$limits } if (!is.null(xscales$limits)) { have.xlim <- TRUE xlim <- xscales$limits } if (!is.null(yscales$limits)) { have.ylim <- TRUE ylim <- yscales$limits } if (!is.null(scales$relation) || !is.null(xscales$relation) || !is.null(yscales$relation)) relationChanged <- TRUE object$x.scales[names(scales)] <- scales object$y.scales[names(scales)] <- scales object$z.scales[names(scales)] <- scales object$x.scales[names(xscales)] <- xscales object$y.scales[names(yscales)] <- yscales object$z.scales[names(zscales)] <- zscales if (object$x.scales$relation == "same" && (is.list(object$x.scales$at) || is.list(object$x.scales$labels))) stop("the at and labels components of scales may not be lists when relation = same") if (object$y.scales$relation == "same" && (is.list(object$y.scales$at) || is.list(object$y.scales$labels))) stop("the at and labels components of scales may not be lists when relation = same") } ## difficult stuff # aspect # prepanel, # scales, #one of the problematic ones # xlim, # ylim, ## stuff that may need recalculation of limits and aspect ratio recalculateLimits <- have.xlim || have.ylim || relationChanged || have.axs if (!missing(aspect)) { if (is.numeric(aspect)) { object$aspect.ratio <- aspect object$aspect.fill <- FALSE } else if (is.character(aspect)) { if (aspect == "fill") object$aspect.fill <- TRUE else if (aspect == "xy") { object$aspect.fill <- FALSE object$aspect.ratio <- "xy" ## guaranteed to be modified below recalculateLimits <- TRUE } else if (aspect == "iso") { object$aspect.fill <- FALSE object$aspect.ratio <- "iso" ## guaranteed to be modified below recalculateLimits <- TRUE } else warning(gettextf("Unrecognized value of 'aspect': '%s'", as.character(aspect))) } else warning("Invalid value of 'aspect'") } if (!missing(prepanel)) { recalculateLimits <- TRUE ## prepanel <- getFunctionOrName(prepanel) } else prepanel <- object$prepanel if (recalculateLimits) { prepanel.def <- object$prepanel.default laa <- limits.and.aspect(prepanel.def, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = object$x.scales$relation, y.relation = object$y.scales$relation, panel.args.common = object$panel.args.common, panel.args = object$panel.args, aspect = object$aspect.ratio, x.axs = object$x.scales$axs, y.axs = object$y.scales$axs) ##...) ## extra arguments for prepanel (for qqmathline) object[names(laa)] <- laa } object } ## `subsetting': shortcut to updating index.cond "[.trellis" <- function(x, i, j, ..., drop = FALSE) { ## call update.trellis with a suitable 'index.cond' argument ocall <- match.call()[-2] # removes 'x' ocall[[1]] <- quote(base::list) if (!missing(drop)) { if (drop) warning("'drop=TRUE' ignored") ocall$drop <- NULL } indices <- rep(list(TRUE), length.out = length(x$condlevels)) if (!missing(i)) { indices[[1]] <- i ocall$i <- NULL } if (!missing(j)) { indices[[2]] <- j ocall$j <- NULL } ## set missing args in ocall to TRUE before evaluating if (length(ocall) > 1) { emptyArgs <- sapply(as.list(ocall[-1]), function(x) (typeof(x) == "symbol" && as.character(x) == "")) ocall[1L + which(emptyArgs)] <- quote(TRUE) dots <- eval.parent(ocall) indices[-c(1, 2)] <- dots } original.levs <- lapply(sapply(x$condlevels, length), seq) stopifnot(length(original.levs) == length(indices)) current.levs <- mapply("[", original.levs, x$index.cond, SIMPLIFY = FALSE) new.levs <- mapply("[", current.levs, indices, SIMPLIFY = FALSE) if (any(sapply(new.levs, function(x) any(is.na(x))))) stop("Invalid indices") update(x, index.cond = new.levs) } ## ## Old version. Failed with ## ## bar <- function(i) { foo[,,,i] } ## ## bar(1) ## "[.trellis" <- function(x, i, j, ..., drop = FALSE) ## { ## ## index.cond <- ## ocall <- match.call() ## tmp <- as.list(ocall)[-(1:2)] ## isj <- "j" %in% names(tmp) ## isi <- "i" %in% names(tmp) ## if (drop) ## { ## warning("'drop=TRUE' ignored") ## tmp$drop <- NULL ## } ## len <- ## if (length(dim(x)) == 1) 1 ## else length(tmp) + (1 - isj) + (1 - isi) ## indices <- rep(list(TRUE), length.out = len) ## if (isi) ## { ## indices[[1]] <- tmp$i ## tmp <- tmp[-1] ## } ## if (isj) ## { ## indices[[2]] <- tmp$j ## tmp <- tmp[-1] ## } ## if (len > 2) ## { ## keep <- ## sapply(tmp, ## function(x) ## typeof(x) == "symbol" && as.character(x) == "") ## tmp[keep] <- list(TRUE) ## indices[-(1:2)] <- tmp ## } ## indices <- lapply(indices, eval) ## original.levs <- lapply(sapply(x$condlevels, length), seq) ## stopifnot(length(original.levs) == len) ## current.levs <- ## mapply("[", original.levs, x$index.cond, ## SIMPLIFY = FALSE) ## new.levs <- ## mapply("[", current.levs, indices, ## SIMPLIFY = FALSE) ## if (any(sapply(new.levs, function(x) any(is.na(x))))) ## stop("Invalid indices") ## update(x, index.cond = new.levs) ## } t.trellis <- function(x) { stopifnot(length(dim(x)) == 2) update(x, perm.cond = rev(x$perm.cond)) } lattice/R/qq.R0000644000176200001440000002200714576465132012662 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.qq <- function(x, y, ...) { ## if (!is.numeric(x)) x <- as.numeric(x) ## if (!is.numeric(y)) y <- as.numeric(y) list(xlim = scale_limits(c(x, y)), # range(x, y), ylim = scale_limits(c(x, y)), # range(x, y), dx = 1, dy = 1) } panel.qq <- function(..., identifier = "qq") { reference.line <- trellis.par.get("reference.line") panel.abline(0,1, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline", sep = ".")) panel.xyplot(..., identifier = identifier) } qq <- function(x, data, ...) UseMethod("qq") qq.formula <- function(x, data = NULL, aspect = "fill", panel = lattice.getOption("panel.qq"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, f.value = NULL, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, qtype = 7, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.qq"), subscripts = !is.null(groups), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if(subscripts) subscr <- form$subscr cond <- form$condition y <- form$left x <- form$right if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } ##x <- as.numeric(x) y <- as.factorOrShingle(y) is.f.y <- is.factor(y) num.l.y <- nlevels(y) if (num.l.y!=2) stop("y must have exactly 2 levels") if(missing(xlab)) xlab <- if (is.f.y) unique(levels(y))[1] else paste("y:", as.character(unique(levels(y)[[1]]))) if(missing(ylab)) ylab <- if (is.f.y) unique(levels(y))[2] else paste("y:", as.character(unique(levels(y)[[2]]))) ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = if (is.f.y) unique(levels(y))[1] else paste("y:", as.character(unique(levels(y)[[1]]))), ylab.default = if (is.f.y) unique(levels(y))[y] else paste("y:", as.character(unique(levels(y)[[2]]))), lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(qq) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: completed later have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) ## x <- log(x, xbase) later, in panel.args if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { ylog <- foo$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) ## y <- log(y, ybase) if (have.ylim) ylim <- logLimits(ylim, ybase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- dots if (subscripts) foo$panel.args.common$groups <- groups npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) if (any(id)) { if (is.f.y) { tx <- x[id] ty <- as.numeric(y[id]) x.val <- tx[ty==1] y.val <- tx[ty==2] } else { tx <- x[id] ty <- y[id] ly <- levels(y) x.val <- tx[ty>=ly[[1]][1] & ty <=ly[[1]][2]] y.val <- tx[ty>=ly[[2]][1] & ty <=ly[[2]][2]] } n <- max(length(x.val), length(y.val)) ## changed from S-PLUS, where f.value = ppoints is default p <- if (is.null(f.value)) { if (n == 1) 0.5 else ppoints(n, a = 1) } else if (is.numeric(f.value)) f.value else f.value(n) foo$panel.args[[packet.number]] <- list(x = quantile(x = x.val, probs = p, # was fast.quantile type = qtype, na.rm = TRUE), y = quantile(x = y.val, probs = p, # was fast.quantile type = qtype, na.rm = TRUE)) } else foo$panel.args[[packet.number]] <- list(x = numeric(0), y = numeric(0)) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp class(foo) <- "trellis" foo } lattice/R/rfs.R0000644000176200001440000000337314145160206013022 0ustar liggesusers ### Copyright (C) 2001-2020 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA rfs <- function(model, layout = c(2,1), xlab = "f-value", ylab = NULL, distribution = qunif, panel = function(...) { panel.grid(h = -1, v = -1) panel.qqmath(...) }, prepanel = NULL, strip = TRUE, ...) { ocall <- sys.call(); ocall[[1]] <- quote(rfs) if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) fitval <- fitted.values(model) - mean(fitted.values(model)) resids <- residuals(model) nf <- length(fitval) nr <- length(resids) data <- list(y = c( fitval, resids), f = c( rep(gettext("Fitted Values minus Mean"), nf), rep(gettext("Residuals"), nr))) modifyList(qqmath(~ y | f, data = data, layout = layout, xlab = xlab, ylab = ylab, distribution = distribution, panel = panel, prepanel = prepanel, strip = strip, ...), list(call = ocall)) } lattice/R/xyplot.ts.R0000644000176200001440000002742114424663220014220 0ustar liggesusers ### Copyright (C) 2001-2020 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## overplot groups, but use default plot.* style rather than superpose.* style panel.superpose.plain <- function(..., col = NA, col.line = plot.line$col, col.symbol = plot.symbol$col, pch = plot.symbol$pch, cex = plot.symbol$cex, fill = plot.symbol$fill, font = plot.symbol$font, fontface = plot.symbol$fontface, fontfamily = plot.symbol$fontfamily, lty = plot.line$lty, lwd = plot.line$lwd, alpha = plot.symbol$alpha) { plot.line <- trellis.par.get("plot.line") plot.symbol <- trellis.par.get("plot.symbol") if (!missing(col)) { if (missing(col.line)) col.line <- col if (missing(col.symbol)) col.symbol <- col } panel.superpose(..., col.line = col.line, col.symbol = col.symbol, pch = pch, cex = cex, fill = fill, font = font, fontfamily = fontfamily, lty = lty, lwd = lwd, alpha = alpha) } xyplot.ts <- function(x, data = NULL, screens = if (superpose) 1 else colnames(x), ..., superpose = FALSE, ## not used directly cut = FALSE, type = "l", col = NULL, lty = NULL, lwd = NULL, pch = NULL, cex = NULL, fill = NULL, auto.key = superpose, panel = if (superpose) "panel.superpose" else "panel.superpose.plain", par.settings = list(), layout = NULL, as.table = TRUE, xlab = "Time", ylab = NULL, default.scales = list(y = list(relation = if (missing(cut)) "free" else "same"))) { ocall <- sys.call(); ocall[[1]] <- quote(xyplot) ## fix up some default settings; ## these are too obscure to put in as default arguments if (NCOL(x) == 1) { ## only one series, so use the more standard "panel.superpose" if (missing(superpose)) superpose <- TRUE if (missing(auto.key)) auto.key <- FALSE } stopifnot(is.null(data)) timex <- time(x) x <- as.matrix(x) if (is.null(colnames(x))) colnames(x) <- paste("V", seq_len(NCOL(x)), sep = "") cn <- colnames(x) ## set up shingle for cut-and-stack plot ## (may not work well with irregular series) time <- NULL if (is.numeric(cut)) cut <- list(number = cut) if (isTRUE(cut)) { ## calculate optimum aspect ratio using banking (as for aspect = "xy") timediff <- diff(timex) asp <- apply(x, 2, function(y) banking(timediff, diff(y)) * diff(range(y)) / diff(range(timex)) ) asp <- median(asp) ## work out aspect ratio of n panels in vertical layout on a square nasp <- 1 / (1:6) ## choose number of cuts so that the "xy" aspect matches layout number <- which.min(abs(1 - (asp * 1:6) / nasp)) cut <- list(number = number) if (number == 1) cut <- FALSE } if (is.list(cut)) { ecargs <- list(x = timex) ecargs <- modifyList(ecargs, cut) time <- do.call(equal.count, ecargs) default.scales <- modifyList(list(x = list(relation = "sliced")), default.scales) } ## 'screens' defines which panels to draw series in ## if 'screens' was given as a readable value then always show strips screensgiven <- !missing(screens) && !is.numeric(screens) screens <- make.par.list(cn, screens, NROW(x), NCOL(x), 1) screens <- unlist(screens, use.names = FALSE) screens <- factor(screens, levels = unique(screens)) screens <- rep(screens, length.out = NCOL(x)) fac <- factor(rep(screens, each = NROW(x))) ## formula tt <- rep(timex, NCOL(x)) fo <- if ((nlevels(fac) > 1) || screensgiven) { if (!is.null(time)) x ~ tt | time * fac else x ~ tt | fac } else { if (!is.null(time)) x ~ tt | time else x ~ tt } if (is.null(layout)) { npanels <- max(1, nlevels(fac)) * max(1, nlevels(time)) nc <- ceiling(npanels/6) nr <- ceiling(npanels/nc) layout <- c(nc, nr) } ## set lines, not points, as default for key if (is.logical(auto.key) && auto.key) auto.key <- list() if (is.list(auto.key)) auto.key <- modifyList(list(lines = TRUE, points = FALSE), auto.key) ## The original approach (e.g. in 0.18-4) was to update par.settings ## with the col, lty etc for each series, and let this be picked up by ## panel.superpose as well as auto.key. ## ## However, that causes problems: further drawing in the panels ## (e.g. with layer()) can appear to be broken because it uses the same ## par.settings, and this has a constant color for all superposed series ## by default. ## ## So now we avoid updating par.settings unless necessary for auto.key: needStyles <- (any(sapply(list(col, lty, lwd, pch, cex, fill), length) > 1)) ## If all series are plotted in separate panels AND ## all have the same style, then we don't need 'groups'. ## (this avoids using spurious styles when 'panel' is overridden) needGroups <- ((length(unique(screens)) < NCOL(x)) || (needStyles) || (is.list(type) && (length(type) > 1))) if (needGroups) groups <- factor(col(x), labels = cn) else groups <- rep(factor(1), length(x)) if (is.list(type)) type <- make.par.list(cn, type, NROW(x), NCOL(x), "l") ## To make R CMD check happy force(tt) force(fo) force(groups) tmpcall <- quote(xyplot(fo, groups = groups, ..., panel = panel, type = type, distribute.type = is.list(type), auto.key = auto.key, par.settings = par.settings, layout = layout, as.table = as.table, xlab = xlab, ylab = ylab, default.scales = default.scales)) ## Include style arguments (col, lty, etc) in the call only if specified. ## (Originally they were not, and were picked up only from par.settings) if (length(par.settings) > 0) { ## apply settings here before we look up plot.line etc opar <- trellis.par.get() trellis.par.set(par.settings) on.exit(trellis.par.set(opar)) } plot.line <- trellis.par.get("plot.line") plot.symbol <- trellis.par.get("plot.symbol") unlistIfSimple <- function(z) if (all(sapply(z, length) == 1)) unlist(z) else z if (!is.null(col)) { col <- make.par.list(cn, col, NROW(x), NCOL(x), plot.line$col) tmpcall$col <- unlistIfSimple(col) } if (!is.null(lty)) { lty <- make.par.list(cn, lty, NROW(x), NCOL(x), plot.line$lty) tmpcall$lty <- unlistIfSimple(lty) } if (!is.null(lwd)) { lwd <- make.par.list(cn, lwd, NROW(x), NCOL(x), plot.line$lwd) tmpcall$lwd <- unlistIfSimple(lwd) } if (!is.null(pch)) { pch <- make.par.list(cn, pch, NROW(x), NCOL(x), plot.symbol$pch) tmpcall$pch <- unlistIfSimple(pch) } if (!is.null(cex)) { cex <- make.par.list(cn, cex, NROW(x), NCOL(x), plot.symbol$cex) tmpcall$cex <- unlistIfSimple(cex) } if (!is.null(fill)) { fill <- make.par.list(cn, fill, NROW(x), NCOL(x), plot.symbol$fill) tmpcall$fill <- unlistIfSimple(fill) } if (needStyles) { ## set 'superpose' styles to be picked up by auto.key if (identical(panel, "panel.superpose.plain")) { ## (one alternative would be to define a new simplePlainKey(), ## but that would not work if the user called update(auto.key=)) if (is.null(col)) col <- plot.line$col if (is.null(lty)) lty <- plot.line$lty if (is.null(lwd)) lwd <- plot.line$lwd if (is.null(pch)) pch <- plot.symbol$pch if (is.null(cex)) cex <- plot.symbol$cex if (is.null(fill)) fill <- plot.symbol$fill } if (!is.null(col)) { par.settings <- modifyList(list(superpose.line = list(col = unlist(col)), superpose.symbol = list(col = unlist(col))), par.settings) } if (!is.null(lty)) { par.settings <- modifyList(list(superpose.line = list(lty = unlist(lty))), par.settings) } if (!is.null(lwd)) { par.settings <- modifyList(list(superpose.line = list(lwd = unlist(lwd))), par.settings) } if (!is.null(pch)) { par.settings <- modifyList(list(superpose.symbol = list(pch = unlist(pch))), par.settings) } if (!is.null(cex)) { par.settings <- modifyList(list(superpose.symbol = list(cex = unlist(cex))), par.settings) } if (!is.null(fill)) { par.settings <- modifyList(list(superpose.symbol = list(fill = unlist(fill))), par.settings) } } obj <- eval(tmpcall) obj$call <- ocall obj } ## COPIED FROM ZOO ## http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/zoo/R/plot.zoo.R?rev=609&root=zoo&view=markup make.par.list <- function(nams, x, n, m, def, recycle = sum(unnamed) > 0) { ## if nams are the names of our variables and x is a parameter ## specification such as list(a = c(1,2), c(3,4)) then ## create a new list which uses the named variables from x ## and assigns the unnamed in order. For the remaining variables ## assign them the default value if recycle = FALSE or recycle the ## unnamed variables if recycle = TRUE. The default value for ## recycle is TRUE if there is at least one unnamed variable ## in x and is false if there are only named variables in x. ## n is the length of the series and m is the total number of series ## It only needs to know whether m is 1 or greater than m. ## def is the default value used when recycle = FALSE ## recycle = TRUE means recycle unspecified values ## recycle = FALSE means replace values for unspecified series with def ## Within series recycling is done even if recycle=FALSE. ## Should we allow arbirary names in 1d case? ## if (m > 1) stopifnot(all(names(x) %in% c("", nams))) if (!is.list(x)) x <- if (m == 1) list(x) else as.list(x) y <- vector(mode = "list", length = length(nams)) names(y) <- nams in.x <- nams %in% names(x) unnamed <- if (is.null(names(x))) rep(TRUE, length(x)) else names(x) == "" if (!recycle) y[] <- def y[in.x] <- x[nams[in.x]] if (recycle) { stopifnot(sum(unnamed) > 0) y[!in.x] <- rep(x[unnamed], length.out = sum(!in.x)) ## CHECK, this was: x[unnamed] } else { y[which(!in.x)[seq_len(sum(unnamed))]] <- x[unnamed] } lapply(y, function(y) if (length(y)==1) y else rep(y, length.out = n)) } lattice/R/cloud.R0000644000176200001440000021164514576465132013357 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## Plan: to make things more modular than they are now. As a first ## step, get a function that does a 3d transformation. Probably a good ## idea to do things in terms of homogeneous coordinates ltransform3dMatrix <- function(screen, R.mat = diag(4)) { rot.mat <- diag(3) screen.names <- names(screen) screen <- lapply(screen, "*", pi/180) for(i in seq_along(screen.names)) { th <- screen[[i]] cth <- cos(th) sth <- sin(th) tmp.mat <- (if (screen.names[i]=="x") matrix(c(1, 0, 0, 0, cth, sth, 0, -sth, cth), 3, 3) else if (screen.names[i]=="y") matrix(c(cth, 0, -sth, 0, 1, 0, sth, 0, cth), 3, 3) else if (screen.names[i]=="z") matrix(c(cth, sth, 0, -sth, cth, 0, 0, 0, 1), 3, 3)) rot.mat <- tmp.mat %*% rot.mat } rot.mat <- cbind(rot.mat, c(0,0,0)) rot.mat <- rbind(rot.mat, c(0,0,0,1)) if (!missing(R.mat)) rot.mat <- rot.mat %*% R.mat rot.mat } ltransform3dto3d <- function(x, R.mat, dist = 0) { if (length(x) == 0) return(x) tdata <- R.mat %*% rbind(x, 1) ## back to 3d tdata[1,] <- tdata[1,]/tdata[4,] tdata[2,] <- tdata[2,]/tdata[4,] tdata[3,] <- tdata[3,]/tdata[4,] ## now 'perspective' x,y coordinates. z remains unmodified if (dist != 0) ## 1/dist = distance of eye from center { tdata[1,] <- tdata[1,] / (1/dist - tdata[3,]) tdata[2,] <- tdata[2,] / (1/dist - tdata[3,]) } tdata[1:3, , drop = FALSE] } prepanel.default.cloud <- function(perspective = TRUE, distance = if (perspective) 0.2 else 0, xlim, ylim, zlim, screen = list(z = 40, x = -60), R.mat = diag(4), aspect = c(1, 1), panel.aspect = 1, ..., zoom = 0.8) { rot.mat <- ltransform3dMatrix(screen = screen, R.mat = R.mat) aspect <- rep(aspect, length.out = 2) corners <- rbind(x = c(-1,1,1,-1,-1,1,1,-1), y = c(-1,-1,-1,-1,1,1,1,1) * aspect[1], z = c(-1,-1,1,1,-1,-1,1,1) * aspect[2]) corners <- corners / (2 * max(corners)) ## contain in [-.5, .5] cube corners <- ltransform3dto3d(corners, rot.mat, dist = distance) xrng <- range(corners[1,]) yrng <- range(corners[2,]) slicelen <- max(diff(xrng), diff(yrng)/ panel.aspect) list(xlim = extend.limits(xrng, length = slicelen) / zoom, ylim = extend.limits(yrng, length = panel.aspect * slicelen) / zoom, dx = 1, dy = 1) } panel.3dscatter <- function(x, y, z, rot.mat = diag(4), distance, groups = NULL, type = "p", xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, zero.scaled, col, ## eventually make all these cloud.3d$col etc (or not) col.point = if (is.null(groups)) plot.symbol$col else superpose.symbol$col, col.line = if (is.null(groups)) plot.line$col else superpose.line$col, lty = if (is.null(groups)) plot.line$lty else superpose.line$lty, lwd = if (is.null(groups)) plot.line$lwd else superpose.line$lwd, cex = if (is.null(groups)) plot.symbol$cex else superpose.symbol$cex, pch = if (is.null(groups)) "+" else superpose.symbol$pch, fill = if (is.null(groups)) plot.symbol$fill else superpose.symbol$fill, cross, ..., .scale = FALSE, subscripts = TRUE, identifier = "3dscatter") { if (.scale) { ## x, y, z, are usually already scaled to lie within a ## bounding box. However, setting .scale=TRUE will do the ## scaling here; this may be helpful for calls to ## panel.3dscatter() in user-supplied panel functions. x <- xlim.scaled[1] + diff(xlim.scaled) * (x-xlim[1])/diff(xlim) y <- ylim.scaled[1] + diff(ylim.scaled) * (y-ylim[1])/diff(ylim) z <- zlim.scaled[1] + diff(zlim.scaled) * (z-zlim[1])/diff(zlim) } ##cloud.3d <- list(col=1, cex=1, lty=1, lwd=1, pch=1) plot.symbol <- trellis.par.get("plot.symbol") plot.line <- trellis.par.get("plot.line") superpose.symbol <- trellis.par.get("superpose.symbol") superpose.line <- trellis.par.get("superpose.line") if (!missing(col)) { col.point <- col col.line <- col } n <- length(x) if (n > 0) { if (is.null(groups)) { col.point <- rep(col.point, length.out = n) col.line <- rep(col.line, length.out = n) lty <- rep(lty, length.out = n) lwd <- rep(lwd, length.out = n) cex <- rep(cex, length.out = n) pch <- rep(pch, length.out = n) fill <- rep(fill, length.out = n) } else { nvals <- nlevels(as.factor(groups)) groups <- as.numeric(as.factor(groups))[subscripts] col.point <- rep(col.point, length.out = nvals)[groups] col.line <- rep(col.line, length.out = nvals)[groups] lty <- rep(lty, length.out = nvals)[groups] lwd <- rep(lwd, length.out = nvals)[groups] cex <- rep(cex, length.out = nvals)[groups] pch <- rep(pch, length.out = nvals)[groups] fill <- rep(fill, length.out = nvals)[groups] } ## The following code deals with different 'type's. (We allow ## for multiple types, but do them sequentially, so ## overplotting may happen. The amount of work required to fix ## this is too much to make it worth the effort.) ## 'points' type if (any(c("p", "b", "o") %in% type)) { id <- ((x >= xlim.scaled[1]) & (x <= xlim.scaled[2]) & (y >= ylim.scaled[1]) & (y <= ylim.scaled[2]) & (z >= zlim.scaled[1]) & (z <= zlim.scaled[2]) & !is.na(x) & !is.na(y) & !is.na(z)) m <- ltransform3dto3d(rbind(x, y, z), rot.mat, distance) ord <- sort.list(m[3,]) ord <- ord[id[ord]] if (missing(cross)) cross <- all(pch == "+") if (cross) ## plot symbols are 3d cross hairs { tmpx0 <- rep(x[ord], each = 3) - rep(cex[ord], each = 3) * c(0.02, 0, 0) tmpx1 <- rep(x[ord], each = 3) + rep(cex[ord], each = 3) * c(0.02, 0, 0) tmpy0 <- rep(y[ord], each = 3) - rep(cex[ord], each = 3) * c(0, 0.02, 0) tmpy1 <- rep(y[ord], each = 3) + rep(cex[ord], each = 3) * c(0, 0.02, 0) tmpz0 <- rep(z[ord], each = 3) - rep(cex[ord], each = 3) * c(0, 0, 0.02) tmpz1 <- rep(z[ord], each = 3) + rep(cex[ord], each = 3) * c(0, 0, 0.02) m0 <- ltransform3dto3d(rbind(tmpx0, tmpy0, tmpz0), rot.mat, distance) m1 <- ltransform3dto3d(rbind(tmpx1, tmpy1, tmpz1), rot.mat, distance) lsegments(x0 = m0[1,], y0 = m0[2,], x1 = m1[1,], y1 = m1[2,], col = rep(col.line[ord], each = 3), ..., identifier = paste(identifier, "points", sep = ".")) } else { lpoints(x = m[1, ord], y = m[2, ord], col = col.point[ord], pch = pch[ord], cex = cex[ord], fill = fill[ord], ..., identifier = identifier) } } ## 'lines' type if (any(c("l", "b", "o") %in% type)) { ord <- if (is.null(groups)) TRUE else sort.list(groups) tmplen <- length(x) tmpx0 <- x[ord][-1] tmpx1 <- x[ord][-tmplen] tmpy0 <- y[ord][-1] tmpy1 <- y[ord][-tmplen] tmpz0 <- z[ord][-1] tmpz1 <- z[ord][-tmplen] tmpcol0 <- col.line[ord][-1] ## tmpcol1 <- col.line[ord][-tmplen] ## segments shouldn't join points in different groups tmpcol0[ groups[ord][-1] != groups[ord][-tmplen] ] <- "transparent" m0 <- ltransform3dto3d(rbind(tmpx0, tmpy0, tmpz0), rot.mat, distance) m1 <- ltransform3dto3d(rbind(tmpx1, tmpy1, tmpz1), rot.mat, distance) ## a collection of line segments in 3d space is not well ## ordered. This is just a naive heuristic: ord <- sort.list(pmax(m0[3,], m1[3,])) lsegments(x0 = m0[1, ord], y0 = m0[2, ord], x1 = m1[1, ord], y1 = m1[2, ord], col = tmpcol0[ord], lwd = lwd[ord], lty = lty[ord], ..., identifier = paste(identifier, "lines", sep = ".")) } ## 'histogram' type if ("h" %in% type) { id <- ((x >= xlim.scaled[1]) & (x <= xlim.scaled[2]) & (y >= ylim.scaled[1]) & (y <= ylim.scaled[2]) & !is.na(x) & !is.na(y) & !is.na(z)) m <- ltransform3dto3d(rbind(x, y, z), rot.mat, distance) ord <- sort.list(m[3,]) ord <- ord[id[ord]] zero.scaled <- if (zero.scaled < zlim.scaled[1]) zlim.scaled[1] else if (zero.scaled > zlim.scaled[2]) zlim.scaled[2] else zero.scaled other.end <- ltransform3dto3d(rbind(x, y, zero.scaled), rot.mat, distance) lsegments(m[1,ord], m[2,ord], other.end[1,ord], other.end[2,ord], col = col.line[ord], lty = lty[ord], lwd = lwd[ord], ..., identifier = paste(identifier, "hist", sep = ".")) } if (any(!(type %in% c("p", "h", "l", "b", "o")))) { warning("'type' has unsupported values") } } } #################################################################### ## Interface to C code ## #################################################################### ## the following is now part of the settings # palette.shade <- # function(irr, ref, height, saturation = .9) # { # hsv(h = height, # s = 1 - saturation * (1 - (1-ref)^0.5), # v = irr) # } panel.3dwire <- function(x, y, z, rot.mat = diag(4), distance, shade = FALSE, shade.colors.palette = trellis.par.get("shade.colors")$palette, light.source = c(0, 0, 1000), xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, col = if (shade) "transparent" else "black", lty = 1, lwd = 1, alpha, col.groups = superpose.polygon$col, polynum = 100, ..., .scale = FALSE, drape = FALSE, at, col.regions = regions$col, alpha.regions = regions$alpha, identifier = "3dwire") { ## a faster version of panel.3dwire that takes advantage of grid ## in R >= 1.8.1's multiple polygon drawing capabilities. The ## solution is a bit hackish, it basically keeps track of the ## polygons to be drawn in a 'global' variable and draws them all ## at once when 'sufficiently many' have been collected. ## x, y, z are in a special form here (compared to most other ## places in lattice). x and y are short ascending, describing the ## grid, and z is the corresponding z values in the order (x1,y1), ## (x1,y2), ... . length(z) == length(x) * length(y). Sometimes, z ## might be a matrix, which indicates multiple surfaces. Above ## description true for each column in that case. ## things are slightly different depending on whether shading is ## being done. If not, things are relatively simple, and in ## particular polygons are drawn one quadrilateral at a ## time. However, if shade=T, facets are drawn triangles at a ## time. The difference is mostly in C code, but some distinctions ## need to be made here as well if (.scale) { ## x, y, z, are usually already scaled to lie within a ## bounding box. However, setting .scale=TRUE will do the ## scaling here; this may be helpful for calls to ## panel.3dscatter() in user-supplied panel functions. x[] <- xlim.scaled[1] + diff(xlim.scaled) * (x-xlim[1])/diff(xlim) y[] <- ylim.scaled[1] + diff(ylim.scaled) * (y-ylim[1])/diff(ylim) z[] <- zlim.scaled[1] + diff(zlim.scaled) * (z-zlim[1])/diff(zlim) } if (shade) drape <- FALSE ## shade overrides drape regions <- if (drape) trellis.par.get("regions") else { bg <- trellis.par.get("background") if (bg[["col"]] == "transparent") bg[["col"]] <- "white" bg } numcol <- length(at) - 1 numcol.r <- length(col.regions) col.regions <- if (numcol.r <= numcol) rep(col.regions, length.out = numcol) else col.regions[floor(1+(1:numcol-1)*(numcol.r-1)/(numcol-1))] ## 2004-03-12 new experimental stuff: when x, y, z are all ## matrices of the same dimension, they represent a 3-D surface ## parametrized on a 2-D grid (the details of the parametrizing ## grid are unimportant). isParametrizedSurface <- is.matrix(x) && is.matrix(y) && is.matrix(z) if (isParametrizedSurface) { is.na(x) <- (x < xlim.scaled[1] | x > xlim.scaled[2]) is.na(y) <- (y < ylim.scaled[1] | y > ylim.scaled[2]) is.na(z) <- (z < zlim.scaled[1] | z > zlim.scaled[2]) htrange <- extend.limits(sqrt(range(x^2 + y^2 + z^2, finite = TRUE)), prop = 0.01) ngroups <- 1 } else { ngroups <- if (is.matrix(z)) ncol(z) else 1 superpose.polygon <- trellis.par.get("superpose.polygon") col.groups <- rep(col.groups, length.out = ngroups) if (length(col) > 1) col <- rep(col, length.out = ngroups) ## remove things outside xlim and ylim bounds id.x <- x >= xlim.scaled[1] & x <= xlim.scaled[2] id.y <- y >= ylim.scaled[1] & y <= ylim.scaled[2] id.z <- rep(id.y, length(id.x)) & rep(id.x, each = length(id.y)) x <- x[id.x] y <- y[id.y] z <- z[id.z] htrange <- zlim.scaled } if (shade) { shade.colors.palette <- getFunctionOrName(shade.colors.palette) pol.x <- numeric(polynum * 3) pol.y <- numeric(polynum * 3) pol.fill <- character(polynum) pol.col <- col pol.alpha <- trellis.par.get("shade.colors")$alpha if (!missing(alpha)) pol.alpha <- alpha count <- 0 ## counts number of polygons stacked up so far ## counts number of times grid.polygon has been called gridpolycount <- 0 wirePolygon <- function(xx, yy, misc) { ## misc: ## 1: cos angle between normal and incident light ## 2: cos angle between reflected light and eye ## 3: z-height averaged ## 4: group indicator height <- (misc[3] - htrange[1]) / diff(htrange) invalid <- (is.na(height) || any(is.na(xx)) || any(is.na(yy)) || height > 1 || height < 0) if (!invalid) { pol.x[3 * count + 1:3] <<- xx pol.y[3 * count + 1:3] <<- yy count <<- count + 1 pol.fill[count] <<- shade.colors.palette(misc[1], misc[2], height) if (count == polynum) { gridpolycount <<- gridpolycount + 1 grid.polygon(x = pol.x, y = pol.y, id.lengths = rep(3, polynum), default.units = "native", name = trellis.grobname(paste(identifier, "polygons", gridpolycount, sep = "."), type = "panel"), gp = gpar(fill = pol.fill, col = pol.col, lty = lty, lwd = lwd, alpha = pol.alpha)) count <<- 0 } } } force(wirePolygon) .Call(wireframePanelCalculations, as.double(x), as.double(y), as.double(z), as.double(rot.mat), as.double(distance), if (isParametrizedSurface) as.integer(ncol(x)) else as.integer(length(x)), if (isParametrizedSurface) as.integer(nrow(x)) else as.integer(length(y)), as.integer(ngroups), as.double(light.source), environment(), as.integer(shade), as.integer(isParametrizedSurface)) if (count > 0) { grid.polygon(x = pol.x[1:(count * 3)], y = pol.y[1:(count * 3)], default.units = "native", id.lengths = rep(3, count), name = trellis.grobname(paste(identifier, "polygons", gridpolycount + 1, sep = "."), type = "panel"), gp = gpar(fill = rep(pol.fill, length.out = count), col = rep(pol.col, length.out = count), lty = lty, lwd = lwd, alpha = pol.alpha)) } } else ## no shade { pol.x <- numeric(polynum * 4) pol.y <- numeric(polynum * 4) if (length(col.regions) > 1) { pol.fill <- vector(mode(col.regions), polynum) pol.col <- if (ngroups == 1 || length(col) == 1) col[1] else vector(mode(col), polynum) pol.alpha <- alpha.regions } else if (ngroups == 1) { pol.fill <- col.regions[1] pol.col <- col[1] pol.alpha <- alpha.regions } else { pol.fill <- vector(mode(col.groups), polynum) pol.col <- if (length(col) == 1) col[1] else vector(mode(col), polynum) pol.alpha <- superpose.polygon$alpha } ## FIXME: should alpha override alpha.regions? NO. ## if (!missing(alpha)) pol.alpha <- alpha count <- 0 ## counts number of polygons stacked up so far ## counts number of times grid.polygon has been called gridpolycount <- 0 wirePolygon <- function(xx, yy, misc) { ## misc: ## 3: z-height averaged ## 4: group indicator height <- (misc[3] - htrange[1]) / diff(htrange) invalid <- (is.na(height) || any(is.na(xx)) || any(is.na(yy)) || height > 1 || height < 0) if (!invalid) { pol.x[4 * count + 1:4] <<- xx pol.y[4 * count + 1:4] <<- yy count <<- count + 1 if (length(col.regions) > 1) { pol.fill[count] <<- col.regions[(seq_along(at)[at > misc[3]])[1] - 1 ] if (ngroups > 1 && length(col) > 1) pol.col[count] <<- col[as.integer(misc[4])] } ## nothing to do if ngroups == 1 else if (ngroups > 1) { pol.fill[count] <<- col.groups[as.integer(as.integer(misc[4]))] if (length(col) > 1) pol.col[count] <<- col[as.integer(misc[4])] } if (count == polynum) { gridpolycount <<- gridpolycount + 1 grid.polygon(x = pol.x, y = pol.y, id.lengths = rep(4, polynum), default.units = "native", name = trellis.grobname(paste(identifier, "polygons", gridpolycount, sep = "."), type = "panel"), gp = gpar(fill = pol.fill, col = pol.col, ## FIXME: should be adjustcolor(col, alpha.f = alpha) lty = lty, lwd = lwd, alpha = pol.alpha)) count <<- 0 } } } force(wirePolygon) .Call(wireframePanelCalculations, as.double(x), as.double(y), as.double(z), as.double(rot.mat), as.double(distance), if (isParametrizedSurface) as.integer(ncol(x)) else as.integer(length(x)), if (isParametrizedSurface) as.integer(nrow(x)) else as.integer(length(y)), as.integer(ngroups), as.double(light.source), environment(), as.integer(shade), as.integer(isParametrizedSurface)) if (count > 0) { grid.polygon(x = pol.x[1:(count * 4)], y = pol.y[1:(count * 4)], default.units = "native", id.lengths = rep(4, count), name = trellis.grobname(paste(identifier, "polygons", gridpolycount + 1, sep = "."), type = "panel"), gp = gpar(fill = rep(pol.fill, length.out = count), col = rep(pol.col, length.out = count), lty = lty, lwd = lwd, alpha = pol.alpha)) } } } panel.cloud <- function(x, y, subscripts, z, groups = NULL, perspective = TRUE, distance = if (perspective) 0.2 else 0, xlim, ylim, zlim, panel.3d.cloud = "panel.3dscatter", panel.3d.wireframe = "panel.3dwire", screen = list(z = 40, x = -60), R.mat = diag(4), aspect = c(1, 1), par.box = NULL, xlab, ylab, zlab, xlab.default, ylab.default, zlab.default, scales.3d, proportion = 0.6, wireframe = FALSE, ## zoom = 0.8, ## ignored in panel.cloud ## The main problem with scales is that it is difficult ## to figure out the best way to place the scales. They ## can be specified explicitly using scpos if default is ## not OK scpos, ..., at, ## this is same as 'at' in wireframe identifier = "cloud") { ## x, y, z can be matrices and we want to retain them as matrices. ## The only reasonable things (other than already numeric) are ## factors. Other things will hopefully cause an error down the ## road, and we may want to catch them here some day. if (is.factor(x)) x <- as.numeric(x) if (is.factor(y)) y <- as.numeric(y) if (is.factor(z)) z <- as.numeric(z) ## calculate rotation matrix: rot.mat <- ltransform3dMatrix(screen = screen, R.mat = R.mat) ## 2004-03-12 new experimental stuff: when x, y, z are all ## matrices of the same dimension, they represent a 3-D surface ## parametrized on a 2-D grid (the details of the parametrizing ## grid are unimportant). This is meant only for wireframe ## In this case, subscripts will be ignored, because it's not ## clear how they should interact isParametrizedSurface <- wireframe && is.matrix(x) && is.matrix(y) && is.matrix(z) if (isParametrizedSurface) zrng <- extend.limits(sqrt(range(x^2 + y^2 + z^2, finite = TRUE))) if (length(subscripts) > 0) ## otherwise nothing to draw (not even box ?) { ## figure out data ranges and tick locations / labels ## Information needed: *lim, scales.3d ## For now, keep *lim as they are, since in cloud / wireframe ## extend.limits type adjustments don't happen by ## default. Even if that's done, this may not be the place to ## do it (shouldn't really need anything more than *lim and ## *axs) ## So, get tick labels, and then convert *lim to numeric ## Although, this is all unnecessary if arrows = TRUE xlabelinfo <- calculateAxisComponents(xlim, at = scales.3d$x.scales$at, num.limit = NULL, labels = scales.3d$x.scales$labels, logsc = scales.3d$x.scales$log, abbreviate = scales.3d$x.scales$abbreviate, minlength = scales.3d$x.scales$minlength, format.posixt = scales.3d$x.scales$format, n = scales.3d$x.scales$tick.number) ylabelinfo <- calculateAxisComponents(ylim, at = scales.3d$y.scales$at, num.limit = NULL, labels = scales.3d$y.scales$labels, logsc = scales.3d$y.scales$log, abbreviate = scales.3d$y.scales$abbreviate, minlength = scales.3d$y.scales$minlength, format.posixt = scales.3d$y.scales$format, n = scales.3d$y.scales$tick.number) zlabelinfo <- calculateAxisComponents(zlim, at = scales.3d$z.scales$at, num.limit = NULL, labels = scales.3d$z.scales$labels, logsc = scales.3d$z.scales$log, abbreviate = scales.3d$z.scales$abbreviate, minlength = scales.3d$z.scales$minlength, format.posixt = scales.3d$z.scales$format, n = scales.3d$z.scales$tick.number) x.at <- xlabelinfo$at y.at <- ylabelinfo$at z.at <- zlabelinfo$at x.at.lab <- xlabelinfo$labels y.at.lab <- ylabelinfo$labels z.at.lab <- zlabelinfo$labels xlim <- xlabelinfo$num.limit ylim <- ylabelinfo$num.limit zlim <- zlabelinfo$num.limit par.box.final <- trellis.par.get("box.3d") if (!is.null(par.box)) par.box.final[names(par.box)] <- par.box aspect <- rep(aspect, length.out = 2) if (!isParametrizedSurface) { x <- x[subscripts] y <- y[subscripts] z <- z[subscripts] } corners <- data.frame(x = c(-1, 1, 1,-1,-1, 1, 1,-1), y = c(-1,-1,-1,-1, 1, 1, 1, 1) * aspect[1], z = c(-1,-1, 1, 1,-1,-1, 1, 1) * aspect[2]) corners <- corners / (2 * max(corners)) ## contain in [-.5, .5] cube xlim.scaled <- range(corners$x) ylim.scaled <- range(corners$y) zlim.scaled <- range(corners$z) ## denotes scaled ranges of bounding box. passed to ## panel.3dscatter and panel.3dwire in case they are useful ## center of bounding box: box.center <- matrix(unlist(lapply(corners, mean)), 3, 1) ## these are box boundaries: pre <- c(1,2,4,1,2,3,4,1,5,6,8,5) nxt <- c(2,3,3,4,6,7,8,5,6,7,7,8) ## The corners are defined in terms of coordinates in 3-D ## space as above. The actual choice of coordinates ideally ## should not affect anything, but I haven't checked. Box ## boundaries are defined as pairs of corners. The numbers of ## the corners and boundaries are helpful in keeping track of ## things, and are described in the diagram below. ## 1, 2, ..., 8 are the corners, L-1, ..., L-12 the boundaries ## ## L-11 ## 8------------------------7 ## / | / | ## / | / | ## L-7/ |L-12 L-6/ | ## / | / | ## / | / | ## / | L-3 / |L-10 ## 4-------------------------3 | ## | | | | ## | | | | ## | | | | ## | | L-9 | | ## L-4| 5-----------------|-------6 ## | / | / ## | / | / ## | / L-2| /L-5 ## | / | / ## | /L-8 | / ## | / | / ## |/ |/ ## 1-------------------------2 ## (0,0,0) L-1 ## ## ## Also the 6 FACES are defined in terms of corners (lines) ## as follows: ## ## F-1 : 1,2,3,4 (1,2,3,4) ## F-2 : 2,6,7,3 (5,10,6,2) ## F-3 : 6,5,8,7 (9,12,11,10) ## F-4 : 5,1,4,8 (8,4,7,12) ## F-5 : 1,2,6,5 (1,5,9,8) ## F-6 : 4,3,7,8 (3,6,11,7) face.corners <- list(c(1,2,3,4), c(2,6,7,3), c(6,5,8,7), c(5,1,4,8), c(1,2,6,5), c(4,3,7,8)) face.lines <- list(c(1,2,3,4), c(5,10,6,2), c(9,12,11,10), c(8,4,7,12), c(1,5,9,8), c(3,6,11,7)) ## SCALES : very beta tmp <- ltransform3dto3d(t(as.matrix(corners)), rot.mat) farthest <- 1 ## used later also farval <- tmp[3,1] for (i in 2:8) if (tmp[3,i] < farval) { farthest <- i farval <- tmp[3,i] } ## not foolproof, need to revisit this later scale.position <- if (farthest == 1) list(x = 3, y = 7, z = 2) else if (farthest == 2) list(x = 9, y = 8, z = 10) else if (farthest == 3) list(x = 11, y = 7, z = 10) else if (farthest == 4) list(x = 11, y = 6, z = 2) else if (farthest == 5) list(x = 1, y = 5, z = 4) else if (farthest == 6) list(x = 1, y = 8, z = 12) else if (farthest == 7) list(x = 3, y = 7, z = 2) else if (farthest == 8) list(x = 3, y = 6, z = 10) ##original: #if (farthest == 1) list(x = 9, y = 5, z = 2) #else if (farthest == 2) list(x = 9, y = 8, z = 10) #else if (farthest == 3) list(x = 11, y = 7, z = 10) #else if (farthest == 4) list(x = 11, y = 6, z = 2) #else if (farthest == 5) list(x = 1, y = 5, z = 4) #else if (farthest == 6) list(x = 1, y = 8, z = 12) #else if (farthest == 7) list(x = 3, y = 7, z = 2) #else if (farthest == 8) list(x = 3, y = 6, z = 10) if (!missing(scpos)) scale.position[names(scpos)] <- scpos scpos <- scale.position labs <- rbind(x = c(0, corners$x[pre[scpos$y]], corners$x[pre[scpos$z]]), y = c(corners$y[pre[scpos$x]], 0, corners$y[pre[scpos$z]]), z = c(corners$z[pre[scpos$x]], corners$z[pre[scpos$y]], 0)) labs[,1] <- labs[,1] * (1 + scales.3d$x.scales$distance/3) labs[,2] <- labs[,2] * (1 + scales.3d$y.scales$distance/3) labs[,3] <- labs[,3] * (1 + scales.3d$z.scales$distance/3) axes <- rbind(x = c(proportion * corners$x[c(pre[scpos$x], nxt[scpos$x])], corners$x[c(pre[scpos$y], nxt[scpos$y])], corners$x[c(pre[scpos$z], nxt[scpos$z])]), y = c(corners$y[c(pre[scpos$x], nxt[scpos$x])], proportion * corners$y[c(pre[scpos$y], nxt[scpos$y])], corners$y[c(pre[scpos$z], nxt[scpos$z])]), z = c(corners$z[c(pre[scpos$x], nxt[scpos$x])], corners$z[c(pre[scpos$y], nxt[scpos$y])], proportion * corners$z[c(pre[scpos$z], nxt[scpos$z])])) axes[,1:2] <- axes[,1:2] * (1 + scales.3d$x.scales$distance/10) axes[,3:4] <- axes[,3:4] * (1 + scales.3d$y.scales$distance/10) axes[,5:6] <- axes[,5:6] * (1 + scales.3d$z.scales$distance/10) ## box ranges and lengths cmin <- lapply(corners, min) ## cmax <- lapply(corners, max) clen <- lapply(corners, function(x) diff(range(x, finite = TRUE))) ## scaled (to bounding box) data x <- cmin$x + clen$x * (x-xlim[1])/diff(xlim) y <- cmin$y + clen$y * (y-ylim[1])/diff(ylim) z <- cmin$z + clen$z * (z-zlim[1])/diff(zlim) at <- if (isParametrizedSurface) { zrng.scaled <- extend.limits(sqrt(range(x^2 + y^2 + z^2, finite = TRUE))) zrng.scaled[1] + diff(zrng.scaled) * (at - zrng[1])/diff(zrng) } else cmin$z + clen$z * (at - zlim[1])/diff(zlim) ## same?: zero.scaled <- cmin$z + clen$z * (0 - zlim[1])/diff(zlim) ## yes. cmin$z - clen$z * zlim[1]/diff(zlim) zero.scaled <- cmin$z - clen$z * zlim[1]/diff(zlim) ## needed in panel.3dscatter for type = 'h' x.at <- cmin$x + clen$x * (x.at-xlim[1])/diff(xlim) y.at <- cmin$y + clen$y * (y.at-ylim[1])/diff(ylim) z.at <- cmin$z + clen$z * (z.at-zlim[1])/diff(zlim) at.len <- length(x.at) x.at <- rbind(x = x.at, y = rep(corners$y[pre[scpos$x]], at.len), z = rep(corners$z[pre[scpos$x]], at.len)) at.len <- length(y.at) y.at <- rbind(x = rep(corners$x[pre[scpos$y]], at.len), y = y.at, z = rep(corners$z[pre[scpos$y]], at.len)) at.len <- length(z.at) z.at <- rbind(x = rep(corners$x[pre[scpos$z]], at.len), y = rep(corners$y[pre[scpos$z]], at.len), z = z.at) x.at.end <- x.at + scales.3d$x.scales$tck * .05 * labs[,1] y.at.end <- y.at + scales.3d$y.scales$tck * .05 * labs[,2] z.at.end <- z.at + scales.3d$z.scales$tck * .05 * labs[,3] x.labs <- x.at + 2 * scales.3d$x.scales$tck * .05 * labs[,1] y.labs <- y.at + 2 * scales.3d$y.scales$tck * .05 * labs[,2] z.labs <- z.at + 2 * scales.3d$z.scales$tck * .05 * labs[,3] corners <- ltransform3dto3d(t(as.matrix(corners)), rot.mat, distance) taxes <- ltransform3dto3d(axes, rot.mat, distance) x.at <- ltransform3dto3d(x.at, rot.mat, distance) x.labs <- ltransform3dto3d(x.labs, rot.mat, distance) x.at.end <- ltransform3dto3d(x.at.end, rot.mat, distance) y.at <- ltransform3dto3d(y.at, rot.mat, distance) y.labs <- ltransform3dto3d(y.labs, rot.mat, distance) y.at.end <- ltransform3dto3d(y.at.end, rot.mat, distance) z.at <- ltransform3dto3d(z.at, rot.mat, distance) z.labs <- ltransform3dto3d(z.labs, rot.mat, distance) z.at.end <- ltransform3dto3d(z.at.end, rot.mat, distance) tlabs <- ltransform3dto3d(labs, rot.mat, distance) box.center <- ltransform3dto3d(box.center, rot.mat, distance) ## Shall now determine which bounding lines should be 'hidden' ## (by the data, and hence need to be drawn before the data), ## and which should be 'visible'. Will actually consider each ## face (one at a time), determine if it is 'visible' (had the ## bounding cube been opaque), and if so, mark the lines ## forming that face as 'visible' ## The logical vector 'mark' will correspond to the 12 lines ## (indexing explained in the diagram above). mark = TRUE will ## mean that the line will be drawn AFTER the data is ## drawn. Start off with all mark = FALSE. ## The idea is that for visible faces, the z-value of the ## center of the face will be greater than the z-value of the ## center of the whole box. This doesn't always work for ## perspective plots. ##print(box.center) mark <- rep(FALSE, 12) box.center.z <- box.center[3] for (face in 1:6) if (mean(corners[3, face.corners[[face]] ]) > box.center.z) ## i.e., face visible mark[1:12 %in% face.lines[[face]] ] <- TRUE #for (j in 1:12) # if (pre[j]==farthest || nxt[j]==farthest) # mark[j] <- FALSE ## This draws the 'back' of the box, i.e., the portion that ## should be hidden by the data. This doesn't always work ## properly lsegments(corners[1, pre[!mark]], corners[2, pre[!mark]], corners[1, nxt[!mark]], corners[2, nxt[!mark]], col = par.box.final$col, lwd = par.box.final$lwd, lty = 2, identifier = paste(identifier, "back.box", sep = ".")) ## The following portion of code is responsible for drawing ## the part of the plot driven by the data. The modus operandi ## will be different for cloud and wireframe, since they have ## essentially different purpose. For cloud, the data is ## unstructured, and x, y and z are all passed to the ## panel.3d.cloud function. For wireframe, on the other hand, ## x and y must form a regular grid, which sort(unique()) ## is enough to describe (o.w., greater chances of memory ## problems). z would then have to be supplied in a very ## particular order. All this is fine, but a problem arises if ## we want to allow groups -- multiple surfaces. One option is ## to supply a matrix (nx * ny by no.of.groups) for z. This is ## OK, but it precludes the posibility of supplying x and y as ## only their unique values from the very beginning. So that's ## not allowed for grouped displays if (wireframe) { if (isParametrizedSurface) { ## FIXME: unnecessary copy tmp <- z } else if (is.null(groups)) { nx <- length(unique(x)) ny <- length(unique(y)) len <- length(z) if (nx * ny == len) { ord <- order(x, y) tmp <- z[ord] x <- sort(unique(x[!is.na(x)])) y <- sort(unique(y[!is.na(y)])) } else { ## which means some rows missing, should be NA ## convert z into a (conceptual) matrix, with NA ## entries for those 'missing' from data ## frame. There's scope for ambiguity here, which ## can be avoided by the user. tmp <- rep(NA_real_, nx * ny) ux <- sort(unique(x[!is.na(x)])) uy <- sort(unique(y[!is.na(y)])) idx <- match(x, ux) idy <- match(y, uy) tmp[(idx - 1) * length(uy) + idy] <- z x <- ux y <- uy } } else { ## all surfaces have to be on the same regular ## grid. No row can be missing, though some z-values ## can be NA. Needs a lot of change otherwise vals <- sort(unique(groups)) ## nvals <- length(vals) tmp <- numeric(0) for (i in seq_along(vals)) { id <- (groups[subscripts] == vals[i]) if (any(id)) { ord <- order(x[id], y[id]) tmp <- cbind(tmp, z[id][ord]) } } x <- sort(unique(x)) y <- sort(unique(y)) } z <- list(NULL) ## hopefully becomes garbage, collected if necessary panel.3d.wireframe <- getFunctionOrName(panel.3d.wireframe) pargs <- list(x = x, y = y, z = tmp, rot.mat = rot.mat, distance = distance, at = at, ## col.regions = col.regions, xlim = xlim, ylim = ylim, zlim = zlim, xlim.scaled = xlim.scaled, ylim.scaled = ylim.scaled, zlim.scaled = zlim.scaled, zero.scaled = zero.scaled, ...) if (!("..." %in% names(formals(panel.3d.wireframe)))) pargs <- pargs[intersect(names(pargs), names(formals(panel.3d.wireframe)))] do.call(panel.3d.wireframe, pargs, quote = TRUE) } else { panel.3d.cloud <- getFunctionOrName(panel.3d.cloud) pargs <- list(x = x, y = y, z = z, rot.mat = rot.mat, distance = distance, groups = groups, subscripts = subscripts, xlim = xlim, ylim = ylim, zlim = zlim, xlim.scaled = xlim.scaled, ylim.scaled = ylim.scaled, zlim.scaled = zlim.scaled, zero.scaled = zero.scaled, ...) if (!("..." %in% names(formals(panel.3d.cloud)))) pargs <- pargs[intersect(names(pargs), names(formals(panel.3d.cloud)))] do.call(panel.3d.cloud, pargs, quote = TRUE) } ## This draws the front of the bounding box lsegments(corners[1, pre[mark]], corners[2, pre[mark]], corners[1, nxt[mark]], corners[2, nxt[mark]], col = par.box.final$col, lty = par.box.final$lty, lwd = par.box.final$lwd, identifier = paste(identifier, "front.box", sep = ".")) ## Next part for axes. FIXME: ignoring axis.text$lineheight ## because seems overkill, but could add that too. axis.text <- trellis.par.get("axis.text") axis.line <- trellis.par.get("axis.line") xaxis.col.line <- if (is.logical(scales.3d$x.scales$col.line)) axis.line$col else scales.3d$x.scales$col.line xaxis.lty <- if (is.logical(scales.3d$x.scales$lty)) axis.line$lty else scales.3d$x.scales$lty xaxis.lwd <- if (is.logical(scales.3d$x.scales$lwd)) axis.line$lwd else scales.3d$x.scales$lwd xaxis.col.text <- if (is.logical(scales.3d$x.scales$col)) axis.text$col else scales.3d$x.scales$col xaxis.font <- if (is.logical(scales.3d$x.scales$font)) axis.text$font else scales.3d$x.scales$font xaxis.fontface <- if (is.logical(scales.3d$x.scales$fontface)) axis.text$fontface else scales.3d$x.scales$fontface xaxis.fontfamily <- if (is.logical(scales.3d$x.scales$fontfamily)) axis.text$fontfamily else scales.3d$x.scales$fontfamily xaxis.cex <- if (is.logical(scales.3d$x.scales$cex)) rep(axis.text$cex, length.out = 1) else scales.3d$x.scales$cex xaxis.rot <- if (is.logical(scales.3d$x.scales$rot)) 0 else scales.3d$x.scales$rot yaxis.col.line <- if (is.logical(scales.3d$y.scales$col.line)) axis.line$col else scales.3d$y.scales$col.line yaxis.lty <- if (is.logical(scales.3d$y.scales$lty)) axis.line$lty else scales.3d$y.scales$lty yaxis.lwd <- if (is.logical(scales.3d$y.scales$lwd)) axis.line$lwd else scales.3d$y.scales$lwd yaxis.col.text <- if (is.logical(scales.3d$y.scales$col)) axis.text$col else scales.3d$y.scales$col yaxis.font <- if (is.logical(scales.3d$y.scales$font)) axis.text$font else scales.3d$y.scales$font yaxis.fontface <- if (is.logical(scales.3d$y.scales$fontface)) axis.text$fontface else scales.3d$y.scales$fontface yaxis.fontfamily <- if (is.logical(scales.3d$y.scales$fontfamily)) axis.text$fontfamily else scales.3d$y.scales$fontfamily yaxis.cex <- if (is.logical(scales.3d$y.scales$cex)) rep(axis.text$cex, length.out = 1) else scales.3d$y.scales$cex yaxis.rot <- if (is.logical(scales.3d$y.scales$rot)) 0 else scales.3d$y.scales$rot zaxis.col.line <- if (is.logical(scales.3d$z.scales$col.line)) axis.line$col else scales.3d$z.scales$col.line zaxis.lty <- if (is.logical(scales.3d$z.scales$lty)) axis.line$lty else scales.3d$z.scales$lty zaxis.lwd <- if (is.logical(scales.3d$z.scales$lwd)) axis.line$lwd else scales.3d$z.scales$lwd zaxis.col.text <- if (is.logical(scales.3d$z.scales$col)) axis.text$col else scales.3d$z.scales$col zaxis.font <- if (is.logical(scales.3d$z.scales$font)) axis.text$font else scales.3d$z.scales$font zaxis.fontface <- if (is.logical(scales.3d$z.scales$fontface)) axis.text$fontface else scales.3d$z.scales$fontface zaxis.fontfamily <- if (is.logical(scales.3d$z.scales$fontfamily)) axis.text$fontfamily else scales.3d$z.scales$fontfamily zaxis.cex <- if (is.logical(scales.3d$z.scales$cex)) rep(axis.text$cex, length.out = 1) else scales.3d$z.scales$cex zaxis.rot <- if (is.logical(scales.3d$z.scales$rot)) 0 else scales.3d$z.scales$rot if (scales.3d$x.scales$draw) { if (scales.3d$x.scales$arrows) { larrows(x0 = taxes[1, 1], y0 = taxes[2, 1], x1 = taxes[1, 2], y1 = taxes[2, 2], length = 0.02, unit = "npc", lty = xaxis.lty, lwd = xaxis.lwd, col = xaxis.col.line, identifier = paste(identifier, "x.axis.arrow", sep = ".")) } else { lsegments(x0 = x.at[1,], y0 = x.at[2,], x1 = x.at.end[1,], y1 = x.at.end[2,], lty = xaxis.lty, col = xaxis.col.line, lwd = xaxis.lwd, identifier = paste(identifier, "x.axis.ticks", sep = ".")) ltext(x.at.lab, x = x.labs[1,], y = x.labs[2,], cex = xaxis.cex, srt = xaxis.rot, font = xaxis.font, fontfamily = xaxis.fontfamily, fontface = xaxis.fontface, col = xaxis.col.text, identifier = paste(identifier, "x.axis.labels", sep = ".")) } } if (scales.3d$y.scales$draw) { if (scales.3d$y.scales$arrows) { larrows(x0 = taxes[1, 3], y0 = taxes[2, 3], x1 = taxes[1, 4], y1 = taxes[2, 4], length = 0.02, unit = "npc", lty = yaxis.lty, lwd = yaxis.lwd, col = yaxis.col.line, identifier = paste(identifier, "y.axis.arrow", sep = ".")) } else { lsegments(x0 = y.at[1,], y0 = y.at[2,], x1 = y.at.end[1,], y1 = y.at.end[2,], lty = yaxis.lty, col = yaxis.col.line, lwd = yaxis.lwd, identifier = paste(identifier, "y.axis.ticks", sep = ".")) ltext(y.at.lab, x = y.labs[1,], y = y.labs[2,], cex = yaxis.cex, srt = yaxis.rot, font = yaxis.font, fontfamily = yaxis.fontfamily, fontface = yaxis.fontface, col = yaxis.col.text, identifier = paste(identifier, "y.axis.labels", sep = ".")) } } if (scales.3d$z.scales$draw) { if (scales.3d$z.scales$arrows) { larrows(x0 = taxes[1, 5], y0 = taxes[2, 5], x1 = taxes[1, 6], y1 = taxes[2, 6], length = 0.02, unit = "npc", lty = zaxis.lty, lwd = zaxis.lwd, col = zaxis.col.line, identifier = paste(identifier, "z.axis.arrow", sep = ".")) } else { lsegments(x0 = z.at[1,], y0 = z.at[2,], x1 = z.at.end[1,], y1 = z.at.end[2,], lty = zaxis.lty, col = zaxis.col.line, lwd = zaxis.lwd, identifier = paste(identifier, "z.axis.ticks", sep = ".")) ltext(z.at.lab, x = z.labs[1,], y = z.labs[2,], cex = zaxis.cex, srt = zaxis.rot, font = zaxis.font, fontfamily = zaxis.fontfamily, fontface = zaxis.fontface, col = zaxis.col.text, identifier = paste(identifier, "z.axis.labels", sep = ".")) } } xlab <- getLabelList(xlab, trellis.par.get("par.xlab.text"), xlab.default) ylab <- getLabelList(ylab, trellis.par.get("par.ylab.text"), ylab.default) zlab <- getLabelList(zlab, trellis.par.get("par.zlab.text"), zlab.default) ## slightly different frm xyplot etc, in that rot can be ## supplied in the *lab lists xlab <- grobFromLabelList(xlab, name = trellis.grobname("xlab", type="")) # rot = if (is.null(xlab$rot)) 0 else xlab$rot) ylab <- grobFromLabelList(ylab, name = trellis.grobname("ylab", type="")) # rot = if (is.null(ylab$rot)) 0 else ylab$rot) zlab <- grobFromLabelList(zlab, name = trellis.grobname("zlab", type="")) # rot = if (is.null(zlab$rot)) 0 else zlab$rot) if (!is.null(xlab)) { pushViewport(viewport(x = tlabs[1, 1], y = tlabs[2, 1], default.units = "native")) grid.draw(xlab) upViewport() } if (!is.null(ylab)) { pushViewport(viewport(x = tlabs[1, 2], y = tlabs[2, 2], default.units = "native")) grid.draw(ylab) upViewport() } if (!is.null(zlab)) { pushViewport(viewport(x = tlabs[1, 3], y = tlabs[2, 3], default.units = "native")) grid.draw(zlab) upViewport() } } } panel.wireframe <- function(...) panel.cloud(..., wireframe = TRUE) wireframe <- function(x, data, ...) UseMethod("wireframe") wireframe.matrix <- function(x, data = NULL, zlab = deparse(substitute(x)), aspect, ..., xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) { stopifnot(length(row.values) == nrow(x), length(column.values) == ncol(x)) ocall <- sys.call(); ocall[[1]] <- quote(wireframe) if (!is.null(data)) warning("explicit 'data' specification ignored") form <- eval(z ~ row * column) if (missing(aspect)) aspect <- pmin(ncol(x) / nrow(x), c(Inf, 1)) data <- expand.grid(row = row.values, column = column.values) data$z <- as.vector(as.numeric(x)) ## if rownames/colnames are non-null, use them to label if (missing(xlim)) xlim <- if (!is.null(rownames(x))) rownames(x) else range(row.values, finite = TRUE) if (missing(ylim)) ylim <- if (!is.null(colnames(x))) colnames(x) else range(column.values, finite = TRUE) modifyList(wireframe(form, data, zlab = zlab, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } wireframe.formula <- function(x, data = NULL, panel = lattice.getOption("panel.wireframe"), default.prepanel = lattice.getOption("prepanel.default.wireframe"), ...) { ocall <- sys.call(); ocall[[1]] <- quote(wireframe) ccall <- match.call() ccall$data <- data ccall$panel <- panel ccall$default.prepanel <- default.prepanel ccall[[1]] <- quote(lattice::cloud) ans <- eval.parent(ccall) ans$call <- ocall ans } ## FIXME: need settings for wireframe line colors (wires), cloud ## points/cross lines (cloud.3d), cloud <- function(x, data, ...) UseMethod("cloud") ## FIXME: made xlim/ylim similar to levelplot.matrix? What about ## cloud.table? cloud.matrix <- function(x, data = NULL, type = 'h', zlab = deparse(substitute(x)), aspect, ..., xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) { ocall <- sys.call(); ocall[[1]] <- quote(cloud) stopifnot(length(row.values) == nrow(x), length(column.values) == ncol(x)) if (!is.null(data)) warning("explicit 'data' specification ignored") form <- eval(z ~ row * column) if (missing(aspect)) aspect <- pmin(ncol(x) / nrow(x), c(Inf, 1)) data <- expand.grid(row = seq_len(nrow(x)), column = seq_len(ncol(x))) data$z <- as.vector(as.numeric(x)) ## if rownames/colnames are non-null, use them to label if (missing(xlim)) xlim <- if (!is.null(rownames(x))) rownames(x) else range(row.values, finite = TRUE) if (missing(ylim)) ylim <- if (!is.null(colnames(x))) colnames(x) else range(column.values, finite = TRUE) modifyList(cloud(form, data, type = type, zlab = zlab, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } cloud.table <- function(x, data = NULL, groups = FALSE, zlab = deparse(substitute(x)), type = "h", ...) { stopifnot(length(dim(x)) > 1) ocall <- sys.call(); ocall[[1]] <- quote(cloud) data <- as.data.frame(x) nms <- names(data) freq <- which(nms == "Freq") nms <- nms[-freq] form <- sprintf("Freq ~ %s * %s", nms[1], nms[2]) nms <- nms[-c(1, 2)] len <- length(nms) if (is.logical(groups) && groups && len > 0) { groups <- as.name(nms[len]) nms <- nms[-len] len <- length(nms) } else groups <- NULL if (len > 0) { rest <- paste(nms, collapse = "+") form <- paste(form, rest, sep = "|") } modifyList(cloud(as.formula(form), data, groups = eval(groups), zlab = zlab, type = type, ..., default.scales = list(x = list(arrows = FALSE), y = list(arrows = FALSE))), list(call = ocall)) } cloud.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = FALSE, auto.key = lattice.getOption("default.args")$auto.key, aspect = c(1,1), panel.aspect = 1, panel = lattice.getOption("panel.cloud"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, ylab, zlab, xlim = if (is.factor(x)) levels(x) else range(x, finite = TRUE), ylim = if (is.factor(y)) levels(y) else range(y, finite = TRUE), zlim = if (is.factor(z)) levels(z) else range(z, finite = TRUE), at, drape = FALSE, pretty = FALSE, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(distance = c(1, 1, 1), arrows = TRUE, axs = axs.default), default.prepanel = lattice.getOption("prepanel.default.cloud"), colorkey = any(drape), col.regions, alpha.regions, cuts = 70, subset = TRUE, axs.default = "r") ## the axs.default is to (by default) enable scale extension for ## cloud, but not for wireframe. Needs work to be actually ## implemented. { stopifnot(is.numeric(panel.aspect)) formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, z etc. and do some preprocessing form <- latticeParseFormula(formula, data, dimension = 3, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) ## We need to be careful with subscripts here. It HAS to be there, ## and it's to be used to index x, y, z (and not only groups, ## unlike in xyplot etc). This means we have to subset groups as ## well, which is about the only use for the subscripts calculated ## in latticeParseFormula, after which subscripts is regenerated ## as a straight sequence indexing the variables if (!is.null(form$groups)) groups <- if (is.matrix(form$groups)) as.vector(form$groups)[form$subscr] else if (is.data.frame(form$groups)) as.vector(as.matrix(form$groups))[form$subscr] else form$groups[form$subscr] subscr <- seq_len(length(form$left)) if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) cond <- form$condition z <- form$left x <- form$right.x y <- form$right.y ## (2004-03-12) experimental stuff: when x, y, z are all matrices ## of the same dimension, they represent a 3-D surface ## parametrized on a 2-D grid (the details of the parametrizing ## grid are unimportant). This is meant only for wireframe isParametrizedSurface <- is.matrix(x) && is.matrix(y) && is.matrix(z) if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (missing(xlab)) xlab <- form$right.x.name if (missing(ylab)) ylab <- form$right.y.name if (missing(zlab)) zlab <- form$left.name zrng <- if (isParametrizedSurface) extend.limits(sqrt(range(x^2 + y^2 + z^2, finite = TRUE))) else extend.limits(range(as.numeric(z), finite = TRUE)) if (missing(at)) at <- if (drape) { if (pretty) pretty(zrng, cuts) else seq(zrng[1], zrng[2], length.out = cuts+2) } else zrng ## create a skeleton trellis object with the ## less complicated components: foo <- do.call(trellis.skeleton, c(list(formula = formula, cond = cond, aspect = panel.aspect, strip = strip, panel = panel, xlab = NULL, ylab = NULL, lattice.options = lattice.options), dots), quote = TRUE) ##----------------------------------------------------------------+ ## xlab, ylab, zlab have special meaning in cloud / wireframe, and| ## need to be passed to the panel function to be processed. These | ## xlab / ylab are dummies to satisfy the usual processing | ## routines ------------------------------------------------------+ dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(cloud) ## Step 2: Compute scales.common (leaving out limits for now) foo <- c(foo, do.call(construct.scales, list(draw=FALSE))) ## scales has to be interpreted differently. Nothing needs to be ## done for the usual scales, but need a scales for panel.cloud ## S-PLUS probably doesn't allow x-y-z-specific scales, but I see ## no reason not to allow that (will not allow limits, though) scales <- updateList(default.scales, scales) scales.3d <- do.call(construct.3d.scales, scales) ## Step 3: Decide if limits were specified in call ## Here, always FALSE (in the 2d panel sense) have.xlim <- FALSE have.ylim <- FALSE ## Step 4: Decide if log scales are being used: !!! have.xlog <- !is.logical(scales.3d$x.scales$log) || scales.3d$x.scales$log have.ylog <- !is.logical(scales.3d$y.scales$log) || scales.3d$y.scales$log have.zlog <- !is.logical(scales.3d$z.scales$log) || scales.3d$z.scales$log if (have.xlog) { xlog <- scales.3d$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (!missing(xlim)) xlim <- logLimits(xlim, xbase) } if (have.ylog) { ylog <- scales.3d$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) y <- log(y, ybase) if (!missing(ylim)) ylim <- logLimits(ylim, ybase) } if (have.zlog) { zlog <- scales.3d$z.scales$log zbase <- if (is.logical(zlog)) 10 else if (is.numeric(zlog)) zlog else if (zlog == "e") exp(1) z <- log(z, zbase) if (!missing(zlim)) zlim <- logLimits(zlim, zbase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) if (is.logical(colorkey)) { if (colorkey) { colorkey <- list(at = at, space = "right") if (!missing(col.regions)) colorkey$col <- col.regions if (!missing(alpha.regions)) colorkey$alpha <- alpha.regions } else colorkey <- NULL } else if (is.list(colorkey)) { tmp <- ## FIXME: does the inside thing work? probably not list(space = if (any(c("x", "y", "corner") %in% names(colorkey))) "inside" else "right", at = at) if (!missing(col.regions)) tmp$col <- col.regions if (!missing(alpha.regions)) tmp$alpha <- alpha.regions colorkey <- updateList(tmp, colorkey) } foo$legend <- construct.legend(foo$legend, colorkey, fun = "draw.colorkey") #################################### # if (!drape) col.regions <- trellis.par.get("background")$col # ## region # numcol <- length(at) - 1 # numcol.r <- length(col.regions) # col.regions <- # if (numcol.r <= numcol) # rep(col.regions, length.out = numcol) # else col.regions[floor(1+(1:numcol-1)*(numcol.r-1)/(numcol-1))] # if (is.logical(colorkey)) # { # if (colorkey) colorkey <- # list(space = "right", col = col.regions, # at = at, tick.number = 7) # else colorkey <- NULL # } # else if (is.list(colorkey)) # { # ##foo$colorkey <- colorkey # if (is.null(colorkey$col)) colorkey$col <- col.regions # if (is.null(colorkey$at)) colorkey$at <- at # if (is.null(colorkey$space)) colorkey$space <- # if (any(c("x", "y", "corner") %in% names(colorkey))) "inside" else "right" # } # foo$legend <- # construct.legend(foo$legend, # colorkey, # fun = "draw.colorkey") ################################# ## maybe *lim = NULL with relation = "free" ? ## Process limits here ? Needs some thought ## Step 6: Determine packets foo$panel.args.common <- c(list(x = x, y = y, z = z, ## rot.mat = rot.mat, ## zoom = zoom, xlim = xlim, ylim = ylim, zlim = zlim, xlab = xlab, ylab = ylab, zlab = zlab, xlab.default = form$right.x.name, ylab.default = form$right.y.name, zlab.default = form$left.name, ##distance = if (perspective) distance else 0, aspect = aspect, panel.aspect = panel.aspect, drape = drape, scales.3d = scales.3d, at = at), dots) if (!missing(col.regions)) foo$panel.args.common$col.regions <- col.regions if (!missing(alpha.regions)) foo$panel.args.common$alpha.regions <- alpha.regions if (!is.null(groups)) foo$panel.args.common$groups <- groups npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(subscripts = subscr[id]) cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = panel.aspect, npackets = npackets), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = TRUE, rectangles = FALSE, lines = FALSE), auto.key) } class(foo) <- "trellis" foo } lattice/R/imports.R0000644000176200001440000001345614411502706013731 0ustar liggesusers ### Copyright (C) 2017-2018 Zhijian (Jason) Wen and Paul Murrell ### Copyright (C) 2019 Johan Larsson ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## The following functions are modified versions of functions from the ## R package gridGraphics; see ## https://github.com/pmur002/gridgraphics/blob/master/R/filled.contour.R ## vectorization version (main in used) FindPolygonVertices <- function(low, high, x1, x2, y1, y2, z11, z21, z12, z22, colrep) { v1 = FindCutPoints(low, high, x1, y1, x2, y1, z11, z21) v2 = FindCutPoints(low, high, y1, x2, y2, x2, z21, z22) v3 = FindCutPoints(low, high, x2, y2, x1, y2, z22, z12) v4 = FindCutPoints(low, high, y2, x1, y1, x1, z12, z11) vx = cbind(v1[[1]], v2[[2]], v3[[1]], v4[[2]]) vy = cbind(v1[[2]], v2[[1]], v3[[2]], v4[[1]]) ## track the coordinate for x and y( if non-NA's) index = rowSums(!is.na(vx) ) ## keep if non-NAs row >= 2 (npt >= 2) vx = t(vx) vy = t(vy) xcoor.na = as.vector(vx[, index > 2]) ycoor.na = as.vector(vy[, index > 2]) ## delete all NA's, xcoor = xcoor.na[!is.na(xcoor.na)] ycoor = ycoor.na[!is.na(ycoor.na)] id.length = index[index > 2] cols = colrep[index > 2] out = list(x = xcoor, y = ycoor, id.length = id.length, cols = cols) out } FindCutPoints <- function(low, high, x1, y1, x2, y2, z1, z2) { ## inner condiction begin ## first ocndiction c = (z1 - high) / (z1 - z2) cond1 = z1 < high cond2 = z1 == Inf cond3 = z2 > high | z1 < low x.1 = ifelse(cond1, x1, ifelse(cond2, x2, x1 + c * (x2 - x1))) x.1 = ifelse(cond3, NA, x.1) y.1 = ifelse(cond1, y1, ifelse(cond2, y1, y1)) y.1 = ifelse(cond3, NA, y.1) cond4 = z2 == -Inf cond5 = z2 <= low cond6 = z2 > high | z1 < low c = (z2 -low) / (z2 - z1) x.2 = ifelse(cond4, x1, ifelse(cond5, x2 - c * (x2 - x1), NA)) x.2 = ifelse(cond6, NA, x.2) y.2 = ifelse(cond4, y1, ifelse(cond5, y1, NA)) y.2 = ifelse(cond6, NA, y.2) ## second condiction cond7 = z1 > low cond8 = z1 == -Inf cond9 = z2 < low | z1 > high c = (z1 - low) / (z1 - z2) x_1 = ifelse(cond7, x1, ifelse(cond8, x2, x1 + c * (x2 - x1))) x_1 = ifelse(cond9, NA, x_1) y_1 = ifelse(cond7, y1, ifelse(cond8, y1, y1)) y_1 = ifelse(cond9, NA, y_1) cond10 = z2 < high cond11 = z2 == Inf cond12 = z2 < low | z1 > high c = (z2 - high) / (z2 - z1) x_2 = ifelse(cond10, NA, ifelse(cond11, x1, x2 - c * (x2 - x1))) x_2 = ifelse(cond12, NA, x_2) y_2 = ifelse(cond10, NA, ifelse(cond11, y1, y1)) y_2 = ifelse(cond12, NA, y_2) ## third condiction cond13 = low <= z1 & z1 <= high x..1 = ifelse(cond13, x1, NA) y..1 = ifelse(cond13, y1, NA) ## inner condiction end ## outer condiction cond14 = z1 > z2 cond15 = z1 < z2 xout.1 = ifelse(cond14, x.1, ifelse(cond15, x_1, x..1)) xout.2 = ifelse(cond14, x.2, ifelse(cond15, x_2, NA)) yout.1 = ifelse(cond14, y.1, ifelse(cond15, y_1, y..1)) yout.2 = ifelse(cond14, y.2, ifelse(cond15, y_2, NA)) ## outer condiction end ## return x1, x2, y1, y2 xout = cbind(xout.1, xout.2) yout = cbind(yout.1, yout.2) list(xout, yout) } filledContour <- function(x, y, z, s, cols, name, border, lwd, lty, alpha) { ns = length(s) nx = length(x) ny = length(y) x1 = rep(x[-nx], each = ny - 1) x2 = rep(x[-1], each = ny - 1) y1 = rep(y[-ny], nx - 1) y2 = rep(y[-1], nx - 1) z11 = as.numeric(t(z[-nx, -ny])) z21 = as.numeric(t(z[-1, -ny ])) z12 = as.numeric(t(z[-nx, -1])) z22 = as.numeric(t(z[-1, -1])) x1 = rep(x1, each = ns - 1) x2 = rep(x2, each = ns - 1) y1 = rep(y1, each = ns - 1) y2 = rep(y2, each = ns - 1) z11 = rep(z11, each = ns - 1) z12 = rep(z12, each = ns - 1) z21 = rep(z21, each = ns - 1) z22 = rep(z22, each = ns - 1) low = rep(s[-ns], (nx - 1) * (ny - 1)) high = rep(s[-1], (nx - 1) * (ny - 1)) ## rep color until the same length of x, then subsetting if (length(cols) > ns) { cols = cols[1:(ns - 1)] } else { cols = rep_len(cols, ns - 1) } colrep = rep(cols[1:(ns - 1)], nx * ny) ## feed color as well as subseeting as x and y out = FindPolygonVertices( low = low, high = high, x1 = x1, x2 = x2, y1 = y1, y2 = y2, z11 = z11, z21 = z21, z12 = z12, z22 = z22, colrep = colrep) ## actual drawing grid.polygon(out$x, out$y, default.units = 'native', id.lengths = out$id.length, gp = gpar(fill = out$cols, col = border, lwd = lwd, lty = lty, alpha = alpha), name = name) } lattice/R/miscellaneous.R0000644000176200001440000006102414576262623015106 0ustar liggesusers ### Copyright (C) 2001-2009 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## For historical reasons (i.e., S-compatibility) there are several ## places in lattice where an argument that is supposed to be a ## function may be specified as a character string. It is not ## entirely clear how namespace ambiguity is resolved, but it appears ## that bindings in the lattice namespace are preferred over the ## global environment. getFunctionOrName <- function(FUN) ## Try lattice namespace first? Does that happen automatically? { if (is.function(FUN)) FUN else if (is.character(FUN)) get(FUN) else eval(FUN) } checkArgsAndCall <- function(FUN, args) ## unnamed arguments not allowed { if (!is.null(FUN)) { if (!("..." %in% names(formals(FUN)))) args <- args[intersect(names(args), names(formals(FUN)))] do.call(FUN, args, quote = TRUE) ## FIXME: Is this risky? } } ## Modified from methods::hasArg. hasGroupNumber <- function() { aname <- "group.number" fnames <- names(formals(sys.function(sys.parent()))) if (is.na(match(aname, fnames))) { if (is.na(match("...", fnames))) FALSE else { dotsCall <- eval(quote(substitute(list(...))), sys.parent()) !is.na(match(aname, names(dotsCall))) } } else FALSE } logLimits <- function(lim, base) { if (is.list(lim)) lapply(lim, log, base) else log(lim, base) } chooseFace <- function(fontface = NULL, font = 1) { if (is.null(fontface)) font else fontface } lpretty <- function(x, ...) { eps <- 1e-10 at <- pretty(x[is.finite(x)], ...) ifelse(abs(at-round(at, 3)) 1) { xx <- numeric(2*n-1) yy <- numeric(2*n-1) xx[2*1:n-1] <- x[ord] yy[2*1:n-1] <- y[ord] xx[2*1:(n-1)] <- x[ord][if (type=="s") -1 else -n] yy[2*1:(n-1)] <- y[ord][if (type=="s") -n else -1] grid.lines(x = xx, y = yy, name = primName("lines", identifier, name.type, group), gp = gpar(lty = lty, col = col.line, lwd = lwd, alpha = alpha, ...), default.units="native") } }, h = { ylim <- current.viewport()$yscale zero <- if (min(ylim) > origin) min(ylim) else if (max(ylim) < origin) max(ylim) else origin grid.segments(x0 = x, x1 = x, y0 = y, y1 = zero, name = primName("segments", identifier, name.type, group), gp = gpar(lty = lty, col = col.line, lwd = lwd, alpha = alpha, ...), default.units="native") }, H = { xlim <- current.viewport()$xscale zero <- if (min(xlim) > origin) min(xlim) else if (max(xlim) < origin) max(xlim) else origin grid.segments(x0 = x, x1 = zero, y0 = y, y1 = y, name = primName("segments", identifier, name.type, group), gp = gpar(lty = lty, col = col.line, lwd = lwd, alpha = alpha, ...), default.units="native") }) ## if (type %in% c("l", "o", "b", "c")) ## grid.lines(x = x, y = y, ## gp = gpar(lty = lty, col = col.line, lwd = lwd, alpha = alpha), ## default.units = "native") ## else if (type %in% c("p", "o", "b", "c")) ## grid.points(x = x, y = y, ## gp = ## gpar(col = col, cex = cex, ## alpha = alpha, fill = fill, ## fontsize = fontsize.points, ## fontfamily = fontfamily, ## fontface = chooseFace(fontface, font)), ## pch = pch, ## default.units = "native") ## else if (type %in% c("s", "S")) ## { ## ord <- sort.list(x) ## n <- length(x) ## xx <- numeric(2*n-1) ## yy <- numeric(2*n-1) ## xx[2*1:n-1] <- x[ord] ## yy[2*1:n-1] <- y[ord] ## xx[2*1:(n-1)] <- x[ord][if (type=="s") -1 else -n] ## yy[2*1:(n-1)] <- y[ord][if (type=="s") -n else -1] ## grid.lines(x=xx, y=yy, ## gp = gpar(lty=lty, col=col.line, lwd=lwd, alpha = alpha), ## default.units="native") ## } ## else if (type == "h") ## { ## ylim <- current.viewport()$yscale ## zero <- ## if (ylim[1] > 0) ylim[1] ## else if (ylim[2] < 0) ylim[2] ## else 0 ## grid.segments(x0 = x, x1 = x, ## y0 = y, y1 = zero, ## gp = ## gpar(lty = lty, col = col.line, ## lwd = lwd, alpha = alpha), ## default.units="native") ## } ## else if (type == "H") ## { ## xlim <- current.viewport()$xscale ## zero <- ## if (xlim[1] > 0) xlim[1] ## else if (xlim[2] < 0) xlim[2] ## else 0 ## grid.segments(x0 = x, x1 = zero, ## y0 = y, y1 = y, ## gp = ## gpar(lty = lty, col = col.line, ## lwd = lwd, alpha = alpha), ## default.units="native") ## } return() } lattice/R/panel.superpose.R0000644000176200001440000002557314413020055015354 0ustar liggesusers ### Copyright (C) 2001-2012 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## previously part of panels.R (r676) panel.superpose <- function(x, y = NULL, subscripts, groups, panel.groups = "panel.xyplot", ..., col = "black", col.line = superpose.line$col, col.symbol = superpose.symbol$col, pch = superpose.symbol$pch, cex = superpose.symbol$cex, fill = superpose.symbol$fill, font = superpose.symbol$font, fontface = superpose.symbol$fontface, fontfamily = superpose.symbol$fontfamily, lty = superpose.line$lty, lwd = superpose.line$lwd, alpha = superpose.symbol$alpha, type = "p", grid = lattice.getOption("default.args")$grid, distribute.type = FALSE) { if (distribute.type) { ## This implies a slightly different behaviour: the 'type' ## argument behaves like other graphical parameters, i.e., it ## is repeated to be as long as the number of groups, and one ## used for each group. This is the default behaviour of ## panel.superpose in S-PLUS. The lattice default ## (!distribute.type) is to use all type values concurrently ## for each group. We accomplish this by transforming 'type' ## to a list in either case (but in different ways) and then ## use common code. ## have.type <- FALSE type <- as.list(type) } else { ## this is something of a hack, needed because without this, ## grouped displays with 'g' %in% type may draw a grid ## (courtesy of panel.groups) for each group, overwriting ## earlier ones. ## have.type <- TRUE type <- unique(type) wg <- match('g', type, nomatch = NA_character_) if (!is.na(wg)) { if (missing(grid)) grid <- TRUE type <- type[-wg] } type <- list(type) } if (grid) panel.grid(h = -1, v = -1, x = x, y = y) x <- as.numeric(x) if (!is.null(y)) y <- as.numeric(y) if (length(x) > 0) { if (!missing(col)) { if (missing(col.line)) col.line <- col if (missing(col.symbol)) col.symbol <- col } superpose.symbol <- trellis.par.get("superpose.symbol") superpose.line <- trellis.par.get("superpose.line") vals <- if (is.factor(groups)) levels(groups) else sort(unique(groups)) nvals <- length(vals) col <- rep(col, length.out = nvals) col.line <- rep(col.line, length.out = nvals) col.symbol <- rep(col.symbol, length.out = nvals) pch <- rep(pch, length.out = nvals) fill <- rep(fill, length.out = nvals) lty <- rep(lty, length.out = nvals) lwd <- rep(lwd, length.out = nvals) alpha <- rep(alpha, length.out = nvals) cex <- rep(cex, length.out = nvals) font <- rep(font, length.out = nvals) ## The next two may be NULL (in fact, are so by default) if (!is.null(fontface)) fontface <- rep(fontface, length.out = nvals) if (!is.null(fontfamily)) fontfamily <- rep(fontfamily, length.out = nvals) type <- rep(type, length.out = nvals) panel.groups <- getFunctionOrName(panel.groups) subg <- groups[subscripts] ok <- !is.na(subg) for (i in seq_along(vals)) { id <- ok & (subg == vals[i]) if (any(id)) { args <- list(x = x[id], ## groups = groups, subscripts = subscripts[id], pch = pch[[i]], cex = cex[[i]], font = font[[i]], fontface = fontface[[i]], fontfamily = fontfamily[[i]], col = col[[i]], col.line = col.line[[i]], col.symbol = col.symbol[[i]], fill = fill[[i]], lty = lty[[i]], lwd = lwd[[i]], alpha = alpha[[i]], type = type[[i]], group.number = i, group.value = vals[i], grid = FALSE, ...) ## if (have.type) args$type <- type if (!is.null(y)) args$y <- y[id] do.call(panel.groups, args) } } } } panel.superpose.2 <- function(..., distribute.type = TRUE) { panel.superpose(..., distribute.type = distribute.type) } ## panel.superpose.2 <- ## function(x, y = NULL, subscripts, groups, ## panel.groups = "panel.xyplot", ## col, ## col.line = superpose.line$col, ## col.symbol = superpose.symbol$col, ## pch = superpose.symbol$pch, ## cex = superpose.symbol$cex, ## font = superpose.symbol$font, ## fontface = superpose.symbol$fontface, ## fontfamily = superpose.symbol$fontfamily, ## lty = superpose.line$lty, ## lwd = superpose.line$lwd, ## alpha = superpose.symbol$alpha, ## type = "p", ## ...) ## { ## ## This is a slightly different version of panel.superpose. It ## ## has an explicit type argument which behaves like other ## ## graphical parameters, i.e., it is repeated to be as long as the ## ## number of groups, and one used for each group. This is the ## ## default behaviour of panel.superpose in S-PLUS. ## ## Original version contributed by Neil Klepeis ## type <- as.list(type) ## x <- as.numeric(x) ## if (!is.null(y)) y <- as.numeric(y) ## if (length(x)>0) ## { ## if (!missing(col)) ## { ## if (missing(col.line)) col.line <- col ## if (missing(col.symbol)) col.symbol <- col ## } ## superpose.symbol <- trellis.par.get("superpose.symbol") ## superpose.line <- trellis.par.get("superpose.line") ## vals <- ## if (is.factor(groups)) levels(groups) ## else sort(unique(groups)) ## nvals <- length(vals) ## col.line <- rep(col.line, length.out = nvals) ## col.symbol <- rep(col.symbol, length.out = nvals) ## pch <- rep(pch, length.out = nvals) ## lty <- rep(lty, length.out = nvals) ## lwd <- rep(lwd, length.out = nvals) ## alpha <- rep(alpha, length.out = nvals) ## cex <- rep(cex, length.out = nvals) ## font <- rep(font, length.out = nvals) ## fontface <- rep(fontface, length.out = nvals) ## fontfamily <- rep(fontfamily, length.out = nvals) ## type <- rep(type, length.out = nvals) ## panel.groups <- ## if (is.function(panel.groups)) panel.groups ## else if (is.character(panel.groups)) get(panel.groups) ## else eval(panel.groups) ## subg <- groups[subscripts] ## ok <- !is.na(subg) ## for (i in seq_along(vals)) ## { ## id <- ok & (subg == vals[i]) ## if (any(id)) ## { ## args <- ## list(x=x[id], ## groups = groups, ## subscripts = subscripts[id], ## pch = pch[i], cex = cex[i], ## font = font[i], ## fontface = fontface[i], ## fontfamily = fontfamily[i], ## col.line = col.line[i], ## col.symbol = col.symbol[i], ## lty = lty[i], ## lwd = lwd[i], ## alpha = alpha[i], ## type = type[[i]], ...) ## if (!is.null(y)) args$y <- y[id] ## do.call(panel.groups, args) ## } ## } ## } ## } # panel.superpose.2 <- # function(x, y, subscripts, groups, # col, col.line = superpose.line$col, # col.symbol = superpose.symbol$col, # pch = superpose.symbol$pch, # cex = superpose.symbol$cex, # lty = superpose.line$lty, # lwd = superpose.line$lwd, type="p", ...) # { # ## `panel.superpose.2' : This is a version of the # ## 'panel.superpose' Trellis panel function that allows the plot # ## `type' to change between superimposed (overlayed) data sets. # ## See the `panel.xyplot' function for details on the `type' # ## option which is usually a single character, but here is a # ## character vector with each element specifying the plot style of # ## each subsequently-overlayed plot. --- Neil Klepeis, # ## 26-Dec-2001 # x <- as.numeric(x) # y <- as.numeric(y) # if (length(x) > 0) { # if (!missing(col)) { # if (missing(col.line)) # col.line <- col # if (missing(col.symbol)) # col.symbol <- col # } # superpose.symbol <- trellis.par.get("superpose.symbol") # superpose.line <- trellis.par.get("superpose.line") # x <- as.numeric(x) # y <- as.numeric(y) # vals <- # if (is.factor(groups)) levels(groups) # else sort(unique(groups)) # nvals <- length(vals) # col.line <- rep(col.line, length.out = nvals) # col.symbol <- rep(col.symbol, length.out = nvals) # pch <- rep(pch, length.out = nvals) # lty <- rep(lty, length.out = nvals) # lwd <- rep(lwd, length.out = nvals) # cex <- rep(cex, length.out = nvals) # type <- rep(type, length.out = nvals) # new line here # for (i in seq_along(vals)) { # id <- (groups[subscripts] == vals[i]) # if (any(id)) # panel.xyplot(x = x[id], y = y[id], pch = pch[i], # cex = cex[i], col.line = col.line[i], col.symbol = col.symbol[i], # lty = lty[i], lwd = lwd[i], type=type[i], ...) # } # } # } lattice/R/zzz.R0000644000176200001440000000454013070415115013060 0ustar liggesusers ### Copyright (C) 2000-2006 Deepayan Sarkar , ### ### This file is part of the lattice package for R. It is made ### available under the terms of the GNU General Public License, ### version 2, or at your option, any later version, incorporated ### herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA .LatticeEnv <- new.env() assign("lattice.status", list(), envir = .LatticeEnv) assign("lattice.theme", list(), envir = .LatticeEnv) assign("lattice.options", list(), envir = .LatticeEnv) ## assign("last.object", NULL, envir = .LatticeEnv) experimentalOptions <- function() list(layout.heights = list(top.padding = list(x = 0.5, units = "char", data = NULL), main.key.padding = list(x = 0.5, units = "char", data = NULL), key.axis.padding = list(x = 0.5, units = "char", data = NULL), axis.xlab.padding = list(x = 0.5, units = "char", data = NULL), xlab.key.padding = list(x = 0.5, units = "char", data = NULL), key.sub.padding = list(x = 0.5, units = "char", data = NULL), bottom.padding = list(x = 0.5, units = "char", data = NULL)), layout.widths = list(left.padding = list(x = 0.5, units = "char", data = NULL), key.ylab.padding = list(x = 0.5, units = "char", data = NULL), ylab.axis.padding = list(x = 0.5, units = "char", data = NULL), axis.key.padding = list(x = 0.5, units = "char", data = NULL), right.padding = list(x = 0.5, units = "char", data = NULL)) ) .onLoad <- function(libname, pkgname) { ## library.dynam("lattice", pkgname, libname ) lattice.options(.defaultLatticeOptions()) lattice.options(experimentalOptions()) lattice.setStatus(.defaultLatticeStatus(), clean.first = TRUE) } .noGenerics <- TRUE .onUnload <- function(libpath) library.dynam.unload("lattice", libpath) lattice/R/splom.R0000644000176200001440000005223114413020055013352 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.splom <- function(z, ...) { list(xlim = c(.5, ncol(z) + .5), ylim = c(.5, ncol(z) + .5), dx = 1, dy = 1) } panel.splom <- function(..., identifier = "splom") panel.xyplot(..., identifier = identifier) diag.panel.splom <- function(x = NULL, varname = NULL, limits, at = NULL, labels = NULL, draw = TRUE, tick.number = 5, varname.col = add.text$col, varname.cex = add.text$cex, varname.lineheight = add.text$lineheight, varname.font = add.text$font, varname.fontfamily = add.text$fontfamily, varname.fontface = add.text$fontface, axis.text.col = axis.text$col, axis.text.alpha = axis.text$alpha, axis.text.cex = axis.text$cex, axis.text.font = axis.text$font, axis.text.fontfamily = axis.text$fontfamily, axis.text.fontface = axis.text$fontface, axis.text.lineheight = axis.text$lineheight, axis.line.col = axis.line$col, axis.line.alpha = axis.line$alpha, axis.line.lty = axis.line$lty, axis.line.lwd = axis.line$lwd, axis.line.tck = 1, ...) { add.text <- trellis.par.get("add.text") axis.line <- trellis.par.get("axis.line") axis.text <- trellis.par.get("axis.text") if (!is.null(varname)) grid.text(varname, name = trellis.grobname("diag.text", type="panel"), gp = gpar(col = varname.col, cex = varname.cex, lineheight = varname.lineheight, fontface = chooseFace(varname.fontface, varname.font), fontfamily = varname.fontfamily)) if (draw) ## plot axes { rot <- if (is.numeric(limits)) 0 else c(90, 0) axis.details <- formattedTicksAndLabels(limits, at = if (is.null(at)) TRUE else at, labels = if (is.null(labels)) TRUE else labels, logsc = FALSE, ..., n = tick.number) for (side in c("left", "top", "right", "bottom")) panel.axis(side = side, at = axis.details$at, labels = axis.details$labels, check.overlap = axis.details$check.overlap, ticks = TRUE, half = TRUE, tck = axis.line.tck, rot = rot, text.col = axis.text.col, text.alpha = axis.text.alpha, text.cex = axis.text.cex, text.font = axis.text.font, text.fontfamily = axis.text.fontfamily, text.fontface = axis.text.fontface, text.lineheight = axis.text.lineheight, line.col = axis.line.col, line.alpha = axis.line.alpha, line.lty = axis.line.lty, line.lwd = axis.line.lwd) } } ## FIXME: add alpha pars panel.pairs <- function(z, panel = lattice.getOption("panel.splom"), lower.panel = panel, upper.panel = panel, diag.panel = "diag.panel.splom", as.matrix = FALSE, groups = NULL, panel.subscripts, subscripts, pscales = 5, ## prepanel.limits = function(x) if (is.factor(x)) levels(x) else ## extend.limits(range(as.numeric(x), finite = TRUE)), prepanel.limits = scale_limits, varnames = colnames(z), varname.col = add.text$col, varname.cex = add.text$cex, varname.font = add.text$font, varname.fontfamily = add.text$fontfamily, varname.fontface = add.text$fontface, axis.text.col = axis.text$col, axis.text.cex = axis.text$cex, axis.text.font = axis.text$font, axis.text.fontfamily = axis.text$fontfamily, axis.text.fontface = axis.text$fontface, axis.text.lineheight = axis.text$lineheight, axis.line.col = axis.line$col, axis.line.lty = axis.line$lty, axis.line.lwd = axis.line$lwd, axis.line.alpha = axis.line$alpha, axis.line.tck = 1, ...) { lower.panel <- getFunctionOrName(lower.panel) upper.panel <- getFunctionOrName(upper.panel) diag.panel <- getFunctionOrName(diag.panel) add.text <- trellis.par.get("add.text") axis.line <- trellis.par.get("axis.line") axis.text <- trellis.par.get("axis.text") n.var <- ncol(z) if (n.var == 0) return() lim <- vector("list", length = n.var) for (i in seq_len(n.var)) lim[[i]] <- if (is.list(pscales) && !is.null(pscales[[i]]$lim)) pscales[[i]]$lim else prepanel.limits(z[,i]) ## maybe (ideally) this should be affected by scales if (length(subscripts)) { draw <- is.list(pscales) || (is.numeric(pscales) && pscales!=0) # whether axes to be drawn splom.layout <- grid.layout(nrow = n.var, ncol = n.var) pushViewport(viewport(layout = splom.layout, name = "pairs")) for(i in 1:n.var) ## i = row, j = col for(j in 1:n.var) { if (as.matrix) pushViewport(viewport(layout.pos.row = i, layout.pos.col = j, name = paste("subpanel", j, i, sep = "."), clip = trellis.par.get("clip")$panel, xscale = as.numeric(extend.limits(lim[[j]])), yscale = as.numeric(extend.limits(lim[[i]])))) ## xscale = if (is.character(lim[[j]])) c(0, length(lim[[j]]) + 1) ## else as.numeric(extend.limits(lim[[j]])), ## yscale = if (is.character(lim[[i]])) c(0, length(lim[[i]]) + 1) ## else as.numeric(extend.limits(lim[[i]])) )) else pushViewport(viewport(layout.pos.row = n.var - i + 1, layout.pos.col = j, name = paste("subpanel", j, i, sep = "."), clip = trellis.par.get("clip")$panel, xscale = as.numeric(extend.limits(lim[[j]])), yscale = as.numeric(extend.limits(lim[[i]])))) ## xscale = if (is.character(lim[[j]])) ## c(0, length(lim[[j]]) + 1) else lim[[j]], ## yscale = if (is.character(lim[[i]])) ## c(0, length(lim[[i]]) + 1) else lim[[i]])) if (i == j) { ## axls <- ## if (is.list(pscales) && !is.null(pscales[[i]]$at)) ## pscales[[i]]$at ## else if (is.character(lim[[i]])) ## seq_along(lim[[i]]) ## else ## pretty(lim[[i]], ## n = if (is.numeric(pscales)) ## pscales else 5) ## labels <- ## if (is.list(pscales) && !is.null(pscales[[i]]$lab)) ## pscales[[i]]$lab ## else if (is.character(lim[[i]])) ## lim[[i]] ## else ## NULL ## if (is.numeric(lim[[i]])) ## { ## axlims <- range(lim[[i]]) ## axid <- axls > axlims[1] & axls < axlims[2] ## axls <- axls[axid] ## labels <- labels[axid] ## } if (is.function(diag.panel)) # else ignore diag.panel(x = z[subscripts, j], varname = varnames[i], limits = lim[[i]], at = if (is.list(pscales)) pscales[[i]]$at else NULL, labels = if (is.list(pscales)) pscales[[i]]$lab else NULL, draw = draw, tick.number = if (is.numeric(pscales)) pscales else 5, varname.col = varname.col, varname.cex = varname.cex, varname.font = varname.font, varname.fontfamily = varname.fontfamily, varname.fontface = varname.fontface, axis.text.col = axis.text.col, axis.text.cex = axis.text.cex, axis.text.font = axis.text.font, axis.text.fontfamily = axis.text.fontfamily, axis.text.fontface = axis.text.fontface, axis.text.lineheight = axis.text.lineheight, axis.line.col = axis.line.col, axis.line.lty = axis.line.lty, axis.line.lwd = axis.line.lwd, axis.line.alpha = axis.line.alpha, axis.line.tck = axis.line.tck, i = i, j= j, ...) grid.rect(name = trellis.grobname("pairs.border", type="panel"), gp = gpar(col = axis.line.col, lty = axis.line.lty, lwd = axis.line.lwd, fill = "transparent")) } else { pargs <- if (!panel.subscripts) c(list(x = z[subscripts, j], y = z[subscripts, i]), list(...), list(i = i, j = j)) else c(list(x = z[subscripts, j], y = z[subscripts, i], groups = groups, subscripts = subscripts), list(...), list(i = i, j = j)) ## if (!("..." %in% names(formals(panel)))) ## pargs <- pargs[intersect(names(pargs), names(formals(panel)))] ## if (as.matrix) ## do.call(if (i > j) lower.panel else upper.panel, ## pargs) ## else ## do.call(if (i < j) lower.panel else upper.panel, ## pargs) if (as.matrix) checkArgsAndCall(if (i > j) lower.panel else upper.panel, pargs) else checkArgsAndCall(if (i < j) lower.panel else upper.panel, pargs) grid.rect(name = trellis.grobname("pairs.border", type="panel"), gp = gpar(col = axis.line.col, lty = axis.line.lty, lwd = axis.line.lwd, fill = "transparent")) } upViewport() } upViewport() } } splom <- function(x, data, ...) UseMethod("splom") splom.matrix <- splom.data.frame <- function(x, data = NULL, ..., groups = NULL, subset = TRUE) { ocall <- sys.call(); ocall[[1]] <- quote(splom) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$x <- ~x ccall$data <- environment() ## WAS: ## ccall$data <- list(x = x, groups = groups, subset = subset) ## ccall$groups <- groups ## ccall$subset <- subset ccall[[1]] <- quote(lattice::splom) modifyList(eval.parent(ccall), list(call = ocall)) } splom.formula <- function(x, data = NULL, auto.key = lattice.getOption("default.args")$auto.key, aspect = 1, between = list(x = 0.5, y = 0.5), panel = lattice.getOption("panel.splom"), ## panel = if (is.null(groups)) "panel.splom" else "panel.superpose", prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab = gettext("Scatter Plot Matrix"), xlim, ylab = NULL, ylim, superpanel = lattice.getOption("panel.pairs"), pscales = 5, varnames = NULL, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(draw = FALSE, relation = "same", axs = "i"), default.prepanel = lattice.getOption("prepanel.default.splom"), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing ## right.name <- deparse(substitute(x)) ## x <- eval(substitute(x), data, environment(formula)) form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = FALSE, outer = FALSE, subscripts = TRUE, drop = drop.unused.levels) ## We need to be careful with subscripts here. It HAS to be there, ## and it's to be used to index x, y, z (and not only groups, ## unlike in xyplot etc). This means we have to subset groups as ## well, which is about the only use for the subscripts calculated ## in latticeParseFormula, after which subscripts is regenerated ## as a straight sequence indexing the variables if (!is.null(form$groups)) groups <- form$groups[form$subscr] subscr <- seq_len(nrow(form$right)) if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) cond <- form$condition x <- as.data.frame(form$right) if (length(cond) == 0) { strip <- FALSE cond <- list(as.factor(rep(1, nrow(x)))) } varnames <- if (is.null(varnames)) colnames(x) else varnames ## WAS eval(substitute(varnames), data, environment(formula)), but ## not sure why non-standard evaluation would be useful here if (length(varnames) != ncol(x)) stop("'varnames' has wrong length.") ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, between = between, panel = superpanel, strip = strip, xlab = xlab, ylab = ylab, xlab.default = gettext("Scatter Plot Matrix"), lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(splom) ## Step 2: Compute scales.common (leaving out limits for now) ## FIXME: It is not very clear exactly what effect scales is ## supposed to have. Not much in Trellis (probably), but there are ## certain components which are definitely relevant, and certain ## others (like log) which can be used in innovative ## ways. However, I'm postponing all that to later, if at all if (!is.list(scales)) scales <- list() scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used (has to be NO): ## have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log ## have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- c(list(z = x, panel = panel, panel.subscripts = TRUE, groups = groups, # xscales = foo$x.scales, yscales = foo$y.scales, varnames = varnames, pscales = pscales), dots) npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(subscripts = subscr[id]) cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { # provide smart defaults for auto key based on 'type' type <- dots$type if (is.character(type) && length(type) > 0) { points <- any(type %in% "p") lines <- any(type %in% c("l", "b", "o", "h", "s", "S", "a", "smooth", "spline", "r")) keytype <- if (any(type %in% c("b", "o"))) "o" else "l" } else { points <- TRUE lines <- FALSE keytype <- "l" } foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = points, rectangles = FALSE, lines = lines, type = keytype), auto.key) } class(foo) <- "trellis" foo } lattice/R/summary.trellis.R0000644000176200001440000000511713070415115015376 0ustar liggesusers### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA summary.trellis <- function(object, ...) { ans <- with(object, list(call = call, packet.sizes = packet.sizes, index.cond = index.cond, perm.cond = perm.cond)) class(ans) <- "summary.trellis" ans } print.summary.trellis <- function(x, ...) { cat(gettext("\nCall:\n")) print(x$call) cat(gettext("\nNumber of observations:\n")) ps <- do.call("[", c(list(x$packet.sizes), x$index.cond, list(drop = FALSE))) if (!is.null(dim(ps))) ps <- aperm(ps, x$perm.cond) print(ps) invisible(x) } ## summary.trellis.old <- function(object, ...) ## { ## cat(gettext("\nCall:\n")) ## print(object$call) ## cat("\nY label:\n") ## str(object$ylab) ## cat("\nX label:\n") ## str(object$xlab) ## if (!is.null(names(object$condlevels))) ## { ## cat("\nLevels of Conditioning variables:") ## for (i in seq_along(object$condlevels)) ## { ## cat("\n<", i, "> ", names(object$condlevels)[i], "\n", sep = "") ## print(object$condlevels[[i]]) ## } ## } ## cat("\n") ## invisible() ## } dim.trellis <- function(x) { olevs <- lapply(sapply(x$condlevels, length), seq) as.integer(sapply(mapply("[", olevs, x$index.cond, SIMPLIFY = FALSE), length)) } dimnames.trellis <- function(x) x$condlevels "dimnames<-.trellis" <- function (x, value) { d <- dim(x) if (!is.list(value) || length(value) != length(d)) stop("supplied 'dimnames' have wrong length") if (!all(d == sapply(value, length))) stop("some components of supplied 'dimnames' have wrong length") x$condlevels <- value x } lattice/R/levelplot.R0000644000176200001440000010274314576465132014255 0ustar liggesusers ### Copyright (C) 2001-2023 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA level.colors <- function(x, at, col.regions, colors = TRUE, ...) { ind.col <- cut(x, at, include.lowest = TRUE, labels = FALSE) if (!colors) ind.col else { if (missing(col.regions)) col.regions <- trellis.par.get("regions")$col nregions <- length(at) - 1 if (is.function(col.regions)) col.regions <- col.regions(nregions) ncolor <- length(col.regions) col.regions <- if (ncolor <= nregions) rep(col.regions, length.out = nregions) else col.regions[round(seq(1, ncolor, length.out = nregions))] col.regions[ind.col] } } prepanel.default.levelplot <- function(x, y, subscripts, ...) { pad <- lattice.getOption("axis.padding")$numeric if (length(subscripts) > 0) { x <- x[subscripts] y <- y[subscripts] if (!is.factor(x)) ## (is.numeric(x)) { ux <- sort(unique(x[is.finite(x)])) if ((ulen <- length(ux)) < 2) xlim <- ux + c(-1, 1) else { ## need to be careful here for DateTime classes diffs <- diff(as.numeric(ux))[c(1, ulen-1)] xlim <- c(ux[1] - diffs[1] / 2, ux[ulen] + diffs[2] / 2) } } if (!is.factor(y)) ## (is.numeric(y)) { uy <- sort(unique(y[is.finite(y)])) if ((ulen <- length(uy)) < 2) ylim <- uy + c(-1, 1) else { ## need to be careful here for DateTime classes diffs <- diff(as.numeric(uy))[c(1, ulen-1)] ylim <- c(uy[1] - diffs[1] / 2, uy[ulen] + diffs[2] / 2) } } list(xlim = if (!is.factor(x)) { ## (is.numeric(x)) extend.limits(xlim, prop = -pad/(1 + 2*pad)) } ## ^^ these get extended back later else levels(x), ylim = if (!is.factor(y)) { ## (is.numeric(y)) extend.limits(ylim, prop = -pad/(1 + 2*pad)) } else levels(y), dx = if (is.numeric(x)) length(ux) else 1, dy = if (is.numeric(y)) length(uy) else 1) } else prepanel.null() } panel.contourplot <- function(...) panel.levelplot(...) ## version using contourLines, and hopefully works for missing matrix ## entries as well panel.levelplot <- function(x, y, z, subscripts, at = pretty(z), shrink, labels = FALSE, label.style = c("mixed", "flat", "align"), contour = FALSE, region = TRUE, col = add.line$col, lty = add.line$lty, lwd = add.line$lwd, border = "transparent", border.lty = 1, border.lwd = 0.1, ..., region.type = c("grid", "contour"), col.regions = regions$col, alpha.regions = regions$alpha, identifier = "levelplot") { if (length(subscripts) == 0) return() regions <- trellis.par.get("regions") region.type <- match.arg(region.type) label.style <- match.arg(label.style) x.is.factor <- is.factor(x) y.is.factor <- is.factor(y) x <- as.numeric(x) y <- as.numeric(y) z <- as.numeric(z) ## numcol <- length(at) - 1 ## numcol.r <- length(col.regions) ## col.regions <- ## if (numcol.r <= numcol) ## rep(col.regions, length.out = numcol) ## else ## col.regions[round(seq(1, numcol.r, length.out = numcol))] ## zcol <- cut(z, at, include.lowest = TRUE, labels = FALSE) zcol <- if (region) level.colors(z, at, col.regions, colors = TRUE) else "transparent" x <- x[subscripts] y <- y[subscripts] minXwid <- if (length(unique(x)) > 1) min(diff(sort(unique(x)))) else 1 minYwid <- if (length(unique(y)) > 1) min(diff(sort(unique(y)))) else 1 fullZrange <- range(as.numeric(z), finite = TRUE) # for shrinking z <- z[subscripts] if (region) zcol <- zcol[subscripts] if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 ## Do we need a zlim-like argument ? shrinkx <- c(1, 1) shrinky <- c(1, 1) if (!missing(shrink)) { if (is.numeric(shrink)) { shrinkx <- rep(shrink, length.out = 2) shrinky <- rep(shrink, length.out = 2) } else if (is.list(shrink)) { shrinkx <- rep(shrink[[1]], length.out = 2) shrinky <- rep(shrink[[1]], length.out = 2) if ("x" %in% names(shrink)) shrinkx <- rep(shrink$x, length.out = 2) if ("y" %in% names(shrink)) shrinky <- rep(shrink$y, length.out = 2) } else warning("Invalid 'shrink' parameter ignored") } scaleWidth <- function(z, min = .8, max = .8, zl = range(z, finite = TRUE)) { if (diff(zl) == 0) rep(.5 * (min + max), length(z)) else min + (max - min) * (z - zl[1]) / diff(zl) } if (x.is.factor) { ## unique values ux <- sort(unique(x[!is.na(x)])) ## dimension of rectangles lx <- rep(1, length(ux)) ## centers of rectangles cx <- ux } else { ## sorted unique values of x ux <- sort(unique(x[!is.na(x)])) ## actual box boundaries (x axis) bx <- if (length(ux) > 1) c(3 * ux[1] - ux[2], ux[-length(ux)] + ux[-1], 3 * ux[length(ux)] - ux[length(ux)-1]) / 2 else ux + c(-.5, .5) * minXwid ## dimension of rectangles lx <- diff(bx) ## centers of rectangles cx <- (bx[-1] + bx[-length(bx)])/2 } ## same things for y if (y.is.factor) { ## unique values uy <- sort(unique(y[!is.na(y)])) ## dimension of rectangles ly <- rep(1, length(uy)) ## centers of rectangles cy <- uy } else { uy <- sort(unique(y[!is.na(y)])) by <- if (length(uy) > 1) c(3 * uy[1] - uy[2], uy[-length(uy)] + uy[-1], 3 * uy[length(uy)] - uy[length(uy)-1]) / 2 else uy + c(-.5, .5) * minYwid ly <- diff(by) cy <- (by[-1] + by[-length(by)])/2 } idx <- match(x, ux) idy <- match(y, uy) if (region) { if (region.type == "grid") { grid.rect(x = cx[idx], y = cy[idy], width = lx[idx] * scaleWidth(z, shrinkx[1], shrinkx[2], fullZrange), height = ly[idy] * scaleWidth(z, shrinky[1], shrinky[2], fullZrange), default.units = "native", name = trellis.grobname(paste(identifier, "rect", sep="."), type = "panel", group = group), gp = gpar(fill = zcol, col = border, lwd = border.lwd, lty = border.lty, alpha = alpha.regions)) } else if (region.type == "contour") { numcol <- length(at) - 1 cols <- level.colors(x = seq_len(numcol) - 0.5, at = seq_len(numcol + 1) - 1, col.regions = col.regions, colors = TRUE) filledContour(x = cx, y = cy, z = matrix(z, length(cx)), s = at, cols = cols, name = trellis.grobname(paste(identifier, "polygon", sep = "."), type = "panel", group = group), border = border, lwd = border.lwd, lty = border.lty, alpha = alpha.regions) } } if (contour) { ## calculate aspect ratio of panel to use in calculating label alignment cpl <- current.panel.limits(unit="cm") asp <- diff(cpl$ylim) / diff(cpl$xlim) ## Processing the labels argument if (is.logical(labels) && !labels) labels <- NULL else { if (is.characterOrExpression(labels)) labels <- list(labels = labels) text <- trellis.par.get("add.text") tmp <- list(col = text$col, alpha = text$alpha, cex = text$cex, fontfamily = text$fontfamily, fontface = text$fontface, font = text$font) labels <- if (is.list(labels)) updateList(tmp, labels) else tmp if (!is.characterOrExpression(labels$labels)) # NULL/TRUE labels$labels <- format(at, trim = TRUE) } add.line <- trellis.par.get("add.line") ## convert z into a matrix, with NA entries for those ## 'missing' from data frame. There's scope for ambiguity ## here, which can be avoided by the user. m <- matrix(NA_real_, nrow = length(ux), ncol = length(uy)) m[(idy - 1) * length(ux) + idx ] <- z clines <- contourLines(x = ux, y = uy, z = m, nlevels = length(at), ## necessary ? levels = at) ccount <- 0 for (val in clines) { ccount <- ccount + 1 ## each val looks like: ## $ :List of 3 ## ..$ level: num 170 ## ..$ x : num [1:21] 0.535 0.534 0.534 0.534 0.535 ... ## ..$ y : num [1:21] 0.398 0.400 0.417 0.433 0.434 ... ## we don't know how to leave gap in lines for labels. llines(val, ## hopefully $levels won't matter col = col, lty = lty, lwd = lwd, identifier = paste(identifier, "line", ccount, sep = ".")) ## if too small, don't add label. How small is small ? ## Should depend on resolution. How ? if (length(val$x) > 5) { if (!is.null(labels)) { slopes <- diff(val$y) / diff(val$x) ## slopes[is.na(slopes)] <- 0 if (label.style == "flat") { ## draw label at 'flattest' position along contour textloc <- which.min(abs(slopes)) rotangle <- 0 } else if (label.style == "align") { ## draw label at 'deepest' position along ## contour, depth being min distance to either ## of the four edges, scaled appropriately rx <- range(ux) ry <- range(uy) depth <- pmin(pmin(val$x - rx[1], rx[2] - val$x) / diff(rx), pmin(val$y - ry[1], ry[2] - val$y) / diff(ry)) textloc <- min(which.max(depth), length(slopes)) # slopes has one less entry, # and textloc indexes slopes rotangle <- atan(asp * slopes[textloc] * diff(rx) / diff(ry)) * 180 / base::pi } else if (label.style == "mixed") { ## mix both. align for contours whose flattest ## portion is too close to edge rx <- range(ux) ry <- range(uy) depth <- pmin(pmin(val$x - rx[1], rx[2] - val$x) / diff(rx), pmin(val$y - ry[1], ry[2] - val$y) / diff(ry)) textloc <- which.min(abs(slopes)) rotangle <- 0 if (depth[textloc] < .05 ) { textloc <- min(which.max(depth), length(slopes)) rotangle <- atan(asp * slopes[textloc] * diff(rx) / diff(ry)) * 180 / base::pi } } else stop("Invalid label.style") i <- match(val$level, at) ltext(labels$labels[i], adj = c(.5, 0), srt = rotangle, col = labels$col, alpha = labels$alpha, cex = labels$cex, font = labels$font, fontfamily = labels$fontfamily, fontface = labels$fontface, x = .5 * (val$x[textloc]+val$x[textloc + 1]), y = .5 * (val$y[textloc]+val$y[textloc + 1]), identifier = paste(identifier, "label", ccount, sep = ".")) } } } } } contourplot <- function(x, data, ...) UseMethod("contourplot") contourplot.table <- function(x, data = NULL, aspect = "iso", ..., xlim, ylim) { ocall <- sys.call(); ocall[[1]] <- quote(contourplot) ## see comments in levelplot.table below if (!missing(data)) warning("explicit 'data' specification ignored") dn <- dimnames(x) ## if (!is.null(dn)) dimnames(x) <- lapply(dn, make.unique) data <- as.data.frame.table(x) nms <- names(data) freq <- which(nms == "Freq") nms <- nms[-freq] form <- sprintf("Freq ~ %s + %s", nms[1], nms[2]) nms <- nms[-c(1, 2)] len <- length(nms) if (len > 0) { rest <- paste(nms, collapse = "+") form <- paste(form, rest, sep = "|") } if (missing(xlim)) xlim <- dn[[1]] if (missing(ylim)) ylim <- dn[[2]] modifyList(contourplot(as.formula(form), data, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } contourplot.matrix <- function(x, data = NULL, aspect = "iso", ..., xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) { stopifnot(length(row.values) == nrow(x), length(column.values) == ncol(x)) ocall <- sys.call(); ocall[[1]] <- quote(contourplot) if (!missing(data)) warning("explicit 'data' specification ignored") form <- z ~ row * column data <- expand.grid(row = row.values, column = column.values) data$z <- as.vector(as.numeric(x)) ## if rownames/colnames are non-null, use them to label if (missing(xlim)) xlim <- if (!is.null(rownames(x))) rownames(x) else range(row.values, finite = TRUE) + c(-0.5, 0.5) if (missing(ylim)) ylim <- if (!is.null(colnames(x))) colnames(x) else range(column.values, finite = TRUE) + c(-0.5, 0.5) modifyList(contourplot(form, data, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } ### FIXME: This would have been cleaner, except that as.table() forces ### row and column names, whereas we would prefer numeric axes if no ### names are present. The same point could be made for arrays ### (although what should happen to conditioning variables is less ### clear in that case), but we will ignore that issue for now. ## contourplot.matrix <- function(x, data = NULL, xlab, ylab, ...) ## { ## if (!missing(data)) warning("explicit 'data' specification ignored") ## dns <- names(dimnames(x)) ## if (missing(xlab)) ## xlab <- if (is.null(dns)) "row" else dns[1] ## if (missing(ylab)) ## ylab <- if (is.null(dns)) "column" else dns[2] ## contourplot(as.table(x), xlab = xlab, ylab = ylab, ...) ## } contourplot.array <- function(x, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(contourplot) if (!missing(data)) warning("explicit 'data' specification ignored") modifyList(contourplot(as.table(x), ...), list(call = ocall)) } contourplot.formula <- function(x, data = NULL, panel = lattice.getOption("panel.contourplot"), default.prepanel = lattice.getOption("prepanel.default.contourplot"), cuts = 7, labels = TRUE, contour = TRUE, pretty = TRUE, region = FALSE, ...) { ocall <- sys.call(); ocall[[1]] <- quote(contourplot) ccall <- match.call() ccall$data <- data ccall$panel <- panel ccall$cuts <- cuts ccall$labels <- labels ccall$contour <- contour ccall$pretty <- pretty ccall$region <- region ccall[[1]] <- quote(lattice::levelplot) ans <- eval.parent(ccall) ans$call <- ocall ans } levelplot <- function(x, data, ...) UseMethod("levelplot") levelplot.array <- function(x, data = NULL, ...) { if (!missing(data)) warning("explicit 'data' specification ignored") levelplot(as.table(x), ...) } levelplot.table <- function(x, data = NULL, aspect = "iso", ..., xlim, ylim) { ocall <- sys.call(); ocall[[1]] <- quote(levelplot) if (!missing(data)) warning("explicit 'data' specification ignored") dn <- dimnames(x) ## cannot be NULL for tables ## We don't want to collapse duplicate names. We do prefer to use ## original names for labeling, and we do so for xlim and ylim ## below, but not for conditioning variables (too much work, plus ## may not even be possible) ## if (!is.null(dn)) dimnames(x) <- lapply(dn, make.unique) data <- as.data.frame.table(x) nms <- names(data) freq <- which(nms == "Freq") nms <- nms[-freq] form <- sprintf("Freq ~ %s + %s", nms[1], nms[2]) nms <- nms[-c(1, 2)] len <- length(nms) if (len > 0) { rest <- paste(nms, collapse = "+") form <- paste(form, rest, sep = "|") } ## if rownames/colnames are non-null, use them to label (not the unique versions) if (missing(xlim)) xlim <- dn[[1]] if (missing(ylim)) ylim <- dn[[2]] modifyList(levelplot(as.formula(form), data, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } levelplot.matrix <- function(x, data = NULL, aspect = "iso", ..., xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) { stopifnot(length(row.values) == nrow(x), length(column.values) == ncol(x)) ocall <- sys.call(); ocall[[1]] <- quote(levelplot) if (!missing(data)) warning("explicit 'data' specification ignored") form <- z ~ row * column data <- expand.grid(row = row.values, column = column.values) data$z <- as.vector(as.numeric(x)) ## if rownames/colnames are non-null, use them to label if (missing(xlim)) xlim <- if (!is.null(rownames(x))) rownames(x) else range(row.values, finite = TRUE) + c(-0.5, 0.5) if (missing(ylim)) ylim <- if (!is.null(colnames(x))) colnames(x) else range(column.values, finite = TRUE) + c(-0.5, 0.5) modifyList(levelplot(form, data, aspect = aspect, xlim = xlim, ylim = ylim, ...), list(call = ocall)) } ### See FIXME for contourplot.matrix above ## levelplot.matrix <- function(x, data = NULL, xlab, ylab, ...) ## { ## if (!missing(data)) warning("explicit 'data' specification ignored") ## dns <- names(dimnames(x)) ## if (missing(xlab)) ## xlab <- if (is.null(dns)) "row" else dns[1] ## if (missing(ylab)) ## ylab <- if (is.null(dns)) "column" else dns[2] ## levelplot(as.table(x), xlab = xlab, ylab = ylab, ...) ## } levelplot.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = TRUE, aspect = "fill", panel = if (useRaster) lattice.getOption("panel.levelplot.raster") else lattice.getOption("panel.levelplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, ## at, region etc should be ideally in panel.levelplot only, but is needed for colorkey at, cuts = 15, pretty = FALSE, region = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., useRaster = FALSE, lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.levelplot"), colorkey = region, col.regions, alpha.regions, subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, z etc. and do some preprocessing form <- latticeParseFormula(formula, data, dimension = 3, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) ## We need to be careful with 'subscripts' here. It HAS to be ## there, and it's to be used to index x, y, z (and not only ## groups, unlike in xyplot etc). This means we have to subset ## groups as well, which is about the only use for the subscripts ## calculated in latticeParseFormula, after which subscripts is ## regenerated as a straight sequence indexing the variables if (!is.null(form$groups)) groups <- if (is.matrix(form$groups)) as.vector(form$groups)[form$subscr] else if (is.data.frame(form$groups)) as.vector(as.matrix(form$groups))[form$subscr] else form$groups[form$subscr] subscr <- seq_len(length(form$left)) cond <- form$condition z <- form$left x <- form$right.x y <- form$right.y if (useRaster) { ## Does device support raster images? devRaster <- dev.capabilities("rasterImage")$rasterImage if (is.na(devRaster)) { warning("device support for raster images unknown, ignoring 'raster=TRUE'") useRaster <- FALSE } else if (devRaster == "no") { warning("device has no raster support, ignoring 'raster=TRUE'") useRaster <- FALSE } else if (devRaster == "non-missing" && any(is.na(z))) { warning("device does not support raster images with NA, ignoring 'raster=TRUE'") useRaster <- FALSE } } if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (missing(xlab)) xlab <- form$right.x.name if (missing(ylab)) ylab <- form$right.y.name zrng <- extend.limits(range(as.numeric(z), finite = TRUE)) if (missing(at)) at <- if (pretty) pretty(zrng, cuts) else seq(zrng[1], zrng[2], length.out = cuts + 2) ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = form$right.x.name, ylab.default = form$right.y.name, lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(levelplot) ## Step 2: Compute scales.common (excluding limits) if (is.character (scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { ylog <- foo$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) y <- log(y, ybase) if (have.ylim) ylim <- logLimits(ylim, ybase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Most levelplot/contourplot specific code here if (is.logical(colorkey)) { if (colorkey) { colorkey <- list(at = at, space = "right") if (useRaster) colorkey$raster <- TRUE if (!missing(col.regions)) colorkey$col <- col.regions if (!missing(alpha.regions)) colorkey$alpha <- alpha.regions } else colorkey <- NULL } else if (is.list(colorkey)) { tmp <- ## FIXME: does the inside thing work? probably not list(space = if (any(c("x", "y", "corner") %in% names(colorkey))) "inside" else "right", at = at) if (!missing(col.regions)) tmp$col <- col.regions if (!missing(alpha.regions)) tmp$alpha <- alpha.regions if (useRaster) tmp$raster <- TRUE colorkey <- updateList(tmp, colorkey) } foo$legend <- construct.legend(foo$legend, colorkey, fun = "draw.colorkey") ## Step 6: Determine packets foo$panel.args.common <- c(list(x = x, y = y, z = z, at = at, region = region), dots) if (!missing(col.regions)) foo$panel.args.common$col.regions <- col.regions if (!missing(alpha.regions)) foo$panel.args.common$alpha.regions <- alpha.regions # ############### premature calculation of col.regions # ## region # numcol <- length(at)-1 # numcol.r <- length(col.regions) # col.regions <- # if (numcol.r <= numcol) # rep(col.regions, length.out = numcol) # else col.regions[floor(1+(1:numcol-1)*(numcol.r-1)/(numcol-1))] # if (is.logical(colorkey)) # { # if (colorkey) colorkey <- # list(space = "right", col = col.regions, # at = at, tick.number = 7) # else colorkey <- NULL # } # else if (is.list(colorkey)) # { # #foo$colorkey <- colorkey # if (is.null(colorkey$col)) colorkey$col <- col.regions # if (is.null(colorkey$at)) colorkey$at <- at # if (is.null(colorkey$space)) colorkey$space <- # if (any(c("x", "y", "corner") %in% names(colorkey))) "inside" else "right" # } # foo$legend <- # construct.legend(foo$legend, # colorkey, # fun = "draw.colorkey") # zcol <- rep(NA, length(z)) #numeric(length(z)) # for (i in seq_along(col.regions)) # zcol[!id.na & !is.na(z) & z>=at[i] & z 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(subscripts = subscr[id]) cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp class(foo) <- "trellis" foo } ## experimental version using grid.raster (R >= 2.11.0) panel.levelplot.raster <- function(x, y, z, subscripts, at = pretty(z), ..., col.regions = regions$col, alpha.regions = regions$alpha, interpolate = FALSE, identifier = "levelplot") { if (length(subscripts) == 0) return() regions <- trellis.par.get("regions") x.is.factor <- is.factor(x) y.is.factor <- is.factor(y) x <- as.numeric(x) y <- as.numeric(y) z <- as.numeric(z) zcol <- level.colors(z, at, col.regions, colors = TRUE) x <- x[subscripts] y <- y[subscripts] z <- z[subscripts] zcol <- zcol[subscripts] if (hasGroupNumber()) group <- list(...)$group.number else group <- 0 if (x.is.factor) { ## unique values (we want to keep missing levels in between) ux <- seq(from = min(x, na.rm = TRUE), to = max(x, na.rm = TRUE)) xwid <- 1L } else { ## sorted unique values of x ux <- sort(unique(x[!is.na(x)])) ## complain if all ux are not equidistant ## if (length(unique(diff(ux))) != 1) -- too strict if (!isTRUE(all.equal(diff(range(diff(ux))), 0))) warning("'x' values are not equispaced; output may be wrong") xwid <- mean(diff(ux)) } ## same things for y if (y.is.factor) { ux <- seq(from = min(y, na.rm = TRUE), to = max(y, na.rm = TRUE)) ywid <- 1L } else { uy <- sort(unique(y[!is.na(y)])) if (!isTRUE(all.equal(diff(range(diff(uy))), 0))) warning("'y' values are not equispaced; output may be wrong") ywid <- mean(diff(uy)) } ncolumns <- length(ux) nrows <- length(uy) xlow <- ux[1] - 0.5 * xwid xhigh <- ux[ncolumns] + 0.5 * xwid ylow <- uy[1] - 0.5 * ywid yhigh <- uy[nrows] + 0.5 * ywid ## create a suitable matrix of colors zmat <- rep("transparent", ncolumns * nrows) idx <- match(x, ux) idy <- match(y, rev(uy)) # image goes top to bottom id <- idy + nrows * (idx-1L) zmat[id] <- zcol dim(zmat) <- c(nrows, ncolumns) grid.raster(as.raster(zmat), interpolate = interpolate, x = xlow, y = ylow, width = xhigh - xlow, height = yhigh - ylow, just = c("left", "bottom"), default.units = "native", name = trellis.grobname(paste(identifier, "raster", sep="."), type = "panel", group = group)) } lattice/R/tmd.R0000644000176200001440000001466114576465132013034 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.tmd.default <- function(x, y, ...) { prepanel.default.xyplot(x = (as.numeric(x) + as.numeric(y)) / 2, y = (as.numeric(y) - as.numeric(x)), ...) } prepanel.tmd.qqmath <- function(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, subscripts, ...) { if (!is.numeric(x)) x <- as.numeric(x) distribution <- getFunctionOrName(distribution) nobs <- sum(!is.na(x)) getxx <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) distribution(ppoints(nobs)) else distribution(f.value(nobs)) } getyy <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) sort(x) else quantile(x, f.value(nobs), names = FALSE, type = qtype, na.rm = TRUE) } if (!nobs) prepanel.null() else if (!is.null(groups)) { sx <- split(x, groups[subscripts]) xxlist <- lapply(sx, getxx, f.value = f.value) yylist <- lapply(sx, getyy, f.value = f.value) meanlist <- difflist <- vector(mode = "list", length = length(sx)) for (i in seq_along(sx)) { meanlist[[i]] <- (xxlist[[i]] + yylist[[1]]) / 2 difflist[[i]] <- (yylist[[i]] - xxlist[[1]]) } list(xlim = range(unlist(meanlist), na.rm = TRUE), ylim = range(unlist(difflist), na.rm = TRUE), dx = unlist(lapply(meanlist, diff)), dy = unlist(lapply(difflist, diff))) } else { xx <- getxx(x, f.value, nobs) yy <- getyy(x, f.value, nobs) tmd.mean <- (xx + yy) / 2 tmd.diff <- (yy - xx) list(xlim = range(tmd.mean), ylim = range(tmd.diff), dx = diff(tmd.mean), dy = diff(tmd.diff)) } } panel.tmd.default <- function(x, y, groups = NULL, ..., identifier = "tmd") { panel.abline(h=0) if (is.null(groups)) panel.xyplot(x = (as.numeric(x) + as.numeric(y)) / 2, y = (as.numeric(y) - as.numeric(x)), ..., identifier = identifier) else panel.superpose(x = (as.numeric(x) + as.numeric(y)) / 2, y = (as.numeric(y) - as.numeric(x)), groups = groups, ...) } panel.tmd.qqmath <- function(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, subscripts, ..., identifier = "tmd") { panel.abline(h=0) if (!is.numeric(x)) x <- as.numeric(x) distribution <- getFunctionOrName(distribution) nobs <- sum(!is.na(x)) getxx <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) distribution(ppoints(nobs)) else distribution(f.value(nobs)) } getyy <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) sort(x) else quantile(x, f.value(nobs), names = FALSE, type = qtype, na.rm = TRUE) } if (!nobs) NULL else if (!is.null(groups)) { sx <- split(x, groups[subscripts]) xxlist <- lapply(sx, getxx, f.value = f.value) yylist <- lapply(sx, getyy, f.value = f.value) xx <- unlist(xxlist) yy <- unlist(yylist) tmd.mean <- (xx + yy) / 2 tmd.diff <- (yy - xx) tmd.groups <- gl(length(xxlist), sapply(xxlist, length), labels = names(xxlist)) tmd.subscripts <- seq_along(xx) panel.superpose(x = tmd.mean, y = tmd.diff, groups = tmd.groups, subscripts = tmd.subscripts, ...) } else { xx <- getxx(x, f.value, nobs) yy <- getyy(x, f.value, nobs) tmd.mean <- (xx + yy) / 2 tmd.diff <- (yy - xx) panel.xyplot(x = tmd.mean, y = tmd.diff, ..., identifier = identifier) } } tmd <- function(object, ...) UseMethod("tmd") tmd.formula <- function(object, data = NULL, ...) { ocall <- sys.call(); ocall[[1]] <- quote(tmd) modifyList(tmd(xyplot(object, data = data, ...)), list(call = ocall)) } tmd.trellis <- function(object, xlab = "mean", ylab = "difference", panel = if (qqmath) panel.tmd.qqmath else panel.tmd.default, prepanel = if (qqmath) prepanel.tmd.qqmath else prepanel.tmd.default, ...) { ## data x, y are not always in panel.args (they may be in ## panel.args.common), but they are for xyplot and qq, which are ## all this is supposed to work for (also qqmath, but see below). ## One special case is qqmath, which is treated differently. May ## modify this for others if there's demand. ocall <- sys.call(); ocall[[1]] <- quote(tmd) qqmath <- object$call[[1]] == quote(qqmath) ## FIXME bad hack (use class(x) = c("trellis", "qqmath") instead?) object$xlab.default <- gettext("mean") object$ylab.default <- gettext("difference") modifyList(update(object, xlab = xlab, ylab = ylab, panel = panel, prepanel = prepanel, ...), list(call = ocall)) } lattice/R/histogram.R0000644000176200001440000003427714576465132014252 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## from R 2.4.0 onwards, hist.default produces a warning when any ## 'unused' arguments are supplied. Before then, all ... arguments ## used to be supplied to hist(), so arguments to hist() could be ## supplied that way. This is no longer possible, so the following ## wrapper is being added to capture undesirable arguments. hist.constructor <- function(x, breaks, include.lowest = TRUE, right = TRUE, ...) { if (is.numeric(breaks) && length(breaks) > 1) hist(as.numeric(x), breaks = breaks, plot = FALSE, include.lowest = include.lowest, right = right) else hist(as.numeric(x), breaks = breaks, right = right, plot = FALSE) } ## if (prefer.density && type != "density" && !is.function(breaks)) ## warning(gettextf("type='%s' can be misleading in this context", type)) prepanel.default.histogram <- function(x, breaks, equal.widths = TRUE, type = "density", nint = round(log2(length(x)) + 1), ...) { if (length(x) < 1) prepanel.null() else { if (is.null(breaks)) { breaks <- if (is.factor(x)) seq_len(1 + nlevels(x)) - 0.5 else if (equal.widths) do.breaks(range(x, finite = TRUE), nint) else quantile(x, 0:nint/nint, na.rm = TRUE) } h <- hist.constructor(x, breaks = breaks, ...) if (type != "density" && is.function(breaks)) { ## warn if not equispaced breaks if (!isTRUE(all.equal(diff(range(diff(h$breaks))), 0))) warning(gettextf("type='%s' can be misleading in this context", type)) } y <- switch(type, count = h$counts, percent = 100 * h$counts/length(x), density = h$density) list(xlim = if (is.factor(x)) levels(x) # same as scale_limits(x) else scale_limits(c(x, h$breaks)), ylim = range(0, y, finite = TRUE), dx = 1, dy = 1) } } panel.histogram <- function(x, breaks, equal.widths = TRUE, type = "density", nint = round(log2(length(x)) + 1), alpha = plot.polygon$alpha, col = plot.polygon$col, border = plot.polygon$border, lty = plot.polygon$lty, lwd = plot.polygon$lwd, ..., identifier = "histogram") { plot.polygon <- trellis.par.get("plot.polygon") xscale <- current.panel.limits()$xlim panel.lines(x = xscale[1] + diff(xscale) * c(0.05, 0.95), y = c(0,0), col = border, lty = lty, lwd = lwd, alpha = alpha, identifier = paste(identifier, "baseline", sep = ".")) ## grid.lines(x = c(0.05, 0.95), ## y = unit(c(0,0), "native"), ## gp = gpar(col = border, lty = lty, lwd = lwd, alpha = alpha), ## default.units = "npc") if (length(x) > 0) { if (is.null(breaks)) { breaks <- if (is.factor(x)) seq_len(1 + nlevels(x)) - 0.5 else if (equal.widths) do.breaks(range(x, finite = TRUE), nint) else quantile(x, 0:nint/nint, na.rm = TRUE) } h <- hist.constructor(x, breaks = breaks, ...) y <- switch(type, count = h$counts, percent = 100 * h$counts/length(x), density = h$density) ## y <- ## if (type == "count") h$counts ## else if (type == "percent") 100 * h$counts/length(x) ## else h$density breaks <- h$breaks nb <- length(breaks) if (length(y) != nb-1) warning("problem with 'hist' computations") if (nb > 1) { panel.rect(x = breaks[-nb], y = 0, height = y, width = diff(breaks), col = col, alpha = alpha, border = border, lty = lty, lwd = lwd, just = c("left", "bottom"), identifier = identifier) } } } histogram <- function(x, data, ...) UseMethod("histogram") histogram.factor <- histogram.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(histogram) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::histogram) ans <- eval.parent(ccall) ans$call <- ocall ans } histogram.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = TRUE, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.histogram"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, type = c("percent", "count", "density"), nint = if (is.factor(x)) nlevels(x) else round(log2(length(x)) + 1), endpoints = extend.limits(range(as.numeric(x), finite = TRUE), prop = 0.04), breaks, equal.widths = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.histogram"), subscripts = !is.null(groups), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if (subscripts) subscr <- form$subscr cond <- form$condition x <- form$right if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (missing(xlab)) xlab <- form$right.name if (missing(ylab)) ylab <- TRUE ##if(!(is.numeric(x) || is.factor(x))) ## warning("x should be numeric") ##x <- as.numeric(x) ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = form$right.name, ylab.default = "dummy", lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(histogram) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { warning("Can't have log Y-scale") have.ylog <- FALSE foo$y.scales$log <- FALSE } ## should type default to density? "Yes" when a relative ## frequency histogram is going to be misleading. if (missing(breaks)) # explicit NULL, or function, or character is fine { breaks <- lattice.getOption("histogram.breaks") if (is.null(breaks)) # nothing specified breaks <- # use nint and endpoints if (is.factor(x)) seq_len(1 + nlevels(x)) - 0.5 else do.breaks(as.numeric(endpoints), nint) } ## We would like to issue a warning if type!="density" but breaks ## are not equispaced. This is done here: BUT there is a problem ## if 'breaks' is a function, because then we cannot know if the ## breaks are equispaced here. On the other hand, we can issue ## the warning in the prepanel/panel function, but that could ## cause unnecessary repititions. ## The compromise is that we only issue a warning when 'breaks' is ## not a function (even though we still prefer type=density in ## that case because we don't want to impose a default of ## equispaced breaks in that case). Ideally, the prepanel ## function should check if type!=density and warn if necessary ## when breaks is a function. prefer.density <- (is.function(breaks) || (is.null(breaks) && !equal.widths) || (is.numeric(breaks) && (length(breaks) > 1) && !isTRUE(all.equal(diff(range(diff(breaks))), 0))) ) if (missing(type) && prefer.density) type <- "density" type <- match.arg(type) if (prefer.density && type != "density" && !is.function(breaks)) warning(gettextf("type='%s' can be misleading in this context", type)) ## this is normally done earlier (in trellis.skeleton), but in ## this case we needed to wait till type is determined foo$ylab.default <- switch(type, count = gettext("Count"), percent = gettext("Percent of Total"), density = gettext("Density")) ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- c(list(breaks = breaks, type = type, equal.widths = equal.widths, nint = nint), dots) if (subscripts) foo$panel.args.common$groups <- groups npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(x = x[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = FALSE, rectangles = TRUE, lines = FALSE), auto.key) } class(foo) <- "trellis" foo } lattice/R/xyplot.R0000644000176200001440000004053314576465132013604 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.xyplot <- function(x, y, type, subscripts, groups = NULL, ...) { ## Note: shingles satisfy is.numeric() if (any(!is.na(x)) && any(!is.na(y))) { ord <- order(as.numeric(x)) if (!is.null(groups)) { gg <- groups[subscripts] dx <- unlist(lapply(split(as.numeric(x)[ord], gg[ord]), diff)) dy <- unlist(lapply(split(as.numeric(y)[ord], gg[ord]), diff)) ## ok <- !is.na(gg) ## One may argue that points with is.na(gg) should be ## excluded from the data rectangle since they are not ## plotted. For now I'm going to take the other view, ## namely that the points are there, they just happen to ## be invisible because the value of the variable defining ## their graphical parameters is unknown. } else { dx <- diff(as.numeric(x[ord])) dy <- diff(as.numeric(y[ord])) ## ok <- TRUE } list(xlim = scale_limits(x), ylim = scale_limits(y), dx = dx, dy = dy, xat = if (is.factor(x)) sort(unique(as.numeric(x))) else NULL, yat = if (is.factor(y)) sort(unique(as.numeric(y))) else NULL) } else prepanel.null() } panel.xyplot <- function(x, y, type = "p", groups = NULL, pch = if (is.null(groups)) plot.symbol$pch else superpose.symbol$pch, col, col.line = if (is.null(groups)) plot.line$col else superpose.line$col, col.symbol = if (is.null(groups)) plot.symbol$col else superpose.symbol$col, font = if (is.null(groups)) plot.symbol$font else superpose.symbol$font, fontfamily = if (is.null(groups)) plot.symbol$fontfamily else superpose.symbol$fontfamily, fontface = if (is.null(groups)) plot.symbol$fontface else superpose.symbol$fontface, lty = if (is.null(groups)) plot.line$lty else superpose.line$lty, cex = if (is.null(groups)) plot.symbol$cex else superpose.symbol$cex, fill = if (is.null(groups)) plot.symbol$fill else superpose.symbol$fill, lwd = if (is.null(groups)) plot.line$lwd else superpose.line$lwd, horizontal = FALSE, ..., smooth = NULL, grid = lattice.getOption("default.args")$grid, abline = NULL, jitter.x = FALSE, jitter.y = FALSE, factor = 0.5, amount = NULL, identifier = "xyplot") { plot.symbol <- trellis.par.get("plot.symbol") plot.line <- trellis.par.get("plot.line") superpose.symbol <- trellis.par.get("superpose.symbol") superpose.line <- trellis.par.get("superpose.line") if (!missing(col)) { if (missing(col.line)) col.line <- col if (missing(col.symbol)) col.symbol <- col } if (missing(grid) && ("g" %in% type)) grid <- TRUE ## FIXME: what if list? if (!isFALSE(grid)) { if (!is.list(grid)) grid <- switch(as.character(grid), "TRUE" = list(h = -1, v = -1, x = x, y = y), "h" = list(h = -1, v = 0, y = y), "v" = list(h = 0, v = -1, x = x), list(h = 0, v = 0)) do.call(panel.grid, grid) } if (!is.null(abline)) { if (is.numeric(abline)) abline <- list(abline) do.call(panel.abline, abline) } if (all(is.na(x) | is.na(y))) return() if (!is.null(groups)) panel.superpose(x, y, type = type, groups = groups, pch = pch, col.line = col.line, col.symbol = col.symbol, font = font, fontfamily = fontfamily, fontface = fontface, lty = lty, cex = cex, fill = fill, lwd = lwd, horizontal = horizontal, panel.groups = panel.xyplot, jitter.x = jitter.x, jitter.y = jitter.y, factor = factor, amount = amount, grid = FALSE, ## grid=TRUE/type="g" already handled ...) else { x <- as.numeric(x) y <- as.numeric(y) id <- identifier if ("o" %in% type || "b" %in% type) type <- c(type, "p", "l") if ("p" %in% type) panel.points(x = if (jitter.x) jitter(x, factor = factor, amount = amount) else x, y = if (jitter.y) jitter(y, factor = factor, amount = amount) else y, cex = cex, fill = fill, font = font, fontfamily = fontfamily, fontface = fontface, col = col.symbol, pch = pch, ..., identifier = id) if ("l" %in% type) panel.lines(x = x, y = y, lty = lty, col = col.line, lwd = lwd, ..., identifier = id) if ("h" %in% type) { if (horizontal) panel.lines(x = x, y = y, type = "H", lty = lty, col = col.line, lwd = lwd, ..., identifier = id) else panel.lines(x = x, y = y, type = "h", lty = lty, col = col.line, lwd = lwd, ..., identifier = id) } ## FIXME: should this be delegated to llines with type='s'? if ("s" %in% type) { ord <- if (horizontal) sort.list(y) else sort.list(x) n <- length(x) xx <- numeric(2*n-1) yy <- numeric(2*n-1) xx[2*1:n-1] <- x[ord] yy[2*1:n-1] <- y[ord] xx[2*1:(n-1)] <- x[ord][-1] yy[2*1:(n-1)] <- y[ord][-n] panel.lines(x = xx, y = yy, lty = lty, col = col.line, lwd = lwd, ..., identifier = id) } if ("S" %in% type) { ord <- if (horizontal) sort.list(y) else sort.list(x) n <- length(x) xx <- numeric(2*n-1) yy <- numeric(2*n-1) xx[2*1:n-1] <- x[ord] yy[2*1:n-1] <- y[ord] xx[2*1:(n-1)] <- x[ord][-n] yy[2*1:(n-1)] <- y[ord][-1] panel.lines(x = xx, y = yy, lty = lty, col = col.line, lwd = lwd, ..., identifier = id) } smooth <- if (!is.null(smooth) && isTRUE(smooth)) "loess" else as.character(smooth) if ("r" %in% type || "lm" %in% smooth) panel.lmline(x, y, col = col.line, lty = lty, lwd = lwd, ...) if ("smooth" %in% type || "loess" %in% smooth) panel.loess(x, y, horizontal = horizontal, col = col.line, lty = lty, lwd = lwd, ...) if ("spline" %in% type || "spline" %in% smooth) panel.spline(x, y, horizontal = horizontal, col = col.line, lty = lty, lwd = lwd, ...) if ("a" %in% type || "average" %in% smooth) panel.average(x, y, horizontal = horizontal, lwd = lwd, lty = lty, col.line = col.line, ...) } } xyplot <- function(x, data, ...) UseMethod("xyplot") ## xyplot.default <- ## function(x, data = NULL, ## formula = try(stats::formula(x), silent = TRUE), ## ...) ## { ## ocall <- sys.call(); ocall[[1]] <- quote(xyplot) ## ccall <- match.call() ## if (!is.null(ccall$data)) ## warning("explicit 'data' specification ignored") ## if (!inherits(formula, "formula")) formula = y ~ x ## ccall$data <- x ## ccall$x <- formula ## ccall$formula <- NULL ## ccall[[1]] <- quote(lattice::xyplot) ## ans <- eval.parent(ccall) ## ans$call <- ocall ## ans ## } xyplot.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.xyplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.xyplot"), subscripts = !is.null(groups), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(x)) subset <- eval(substitute(subset), data, environment(x)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if (subscripts) subscr <- form$subscr cond <- form$condition y <- form$left x <- form$right if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (missing(xlab)) xlab <- form$right.name if (missing(ylab)) ylab <- form$left.name ## S-PLUS requires both x and y to be numeric, but we ## don't. Question is, should we give a warning ? Nope. ##if (!(is.numeric(x) && is.numeric(y))) ## warning("x and y are not both numeric") ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = form$right.name, ylab.default = form$left.name, lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo ### FIXME: For a long time, lattice has used ## foo$call <- sys.call(sys.parent()); foo$call[[1]] <- quote(xyplot) ### But this doesn't work in all contexts; e.g., ### with(cars, xyplot(speed ~ dist))$call ### This works better, but is NOT OK for other methods that call ### xyplot.formula(). So EVERY METHOD must include this line of code ### to get the correct call component foo$call <- sys.call(); foo$call[[1]] <- quote(xyplot) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) # override xlim { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { ylog <- foo$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) y <- log(y, ybase) if (have.ylim) ylim <- logLimits(ylim, ybase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- dots if (subscripts) foo$panel.args.common$groups <- groups npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } ## cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(x = x[id], y = y[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] cond.current.level <- cupdate(cond.current.level, cond.max.level) } ## FIXME: make this adjustment everywhere else more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { # provide smart defaults for auto key based on 'type' type <- dots$type if (is.character(type) && length(type) > 0) { points <- any(type %in% "p") lines <- any(type %in% c("l", "b", "o", "h", "s", "S", "a", "smooth", "spline", "r")) keytype <- if (any(type %in% c("b", "o"))) "o" else "l" } else { points <- TRUE lines <- FALSE keytype <- "l" } foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = points, rectangles = FALSE, lines = lines, type = keytype), auto.key) } class(foo) <- "trellis" foo } lattice/R/densityplot.R0000644000176200001440000003363414576465132014627 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.densityplot <- function(x, darg, groups = NULL, weights = NULL, subscripts = TRUE, ...) { if (!is.numeric(x)) x <- as.numeric(x) if (sum(!is.na(x)) < 1) prepanel.null() else if (sum(!is.na(x)) == 1) { list(xlim = rep(x, 2), ylim = rep(0, 2), dx = 1, dy = 1) } else if (is.null(groups)) { h <- do.call(density, c(list(x = x, weights = weights[subscripts]), darg)) ## for banking calculations, include only middle 70% values quants <- quantile(x, c(0.15, 0.85), names = FALSE, na.rm = TRUE) ok <- h$x > quants[1] & h$x < quants[2] list(xlim = range(h$x), ylim = range(h$y), dx = diff(h$x[ok]), dy = diff(h$y[ok])) } else { vals <- sort(unique(groups)) ## nvals <- length(vals) xl <- range(x, finite = TRUE) yl <- 0 dxl <- numeric(0) # bad names !! dyl <- numeric(0) for (i in seq_along(vals)) { id <- (groups[subscripts] == vals[i]) if (sum(id, na.rm = TRUE) > 1) ## need at least 2 { h <- do.call(density, c(list(x = x[id], weights = weights[subscripts][id]), darg)) xl <- c(xl, h$x) yl <- c(yl, h$y) ## for banking calculations, include only middle 70% values quants <- quantile(x[id], c(0.15, 0.85), names = FALSE, na.rm = TRUE) ok <- h$x > quants[1] & h$x < quants[2] dxl <- c(dxl, diff(h$x[ok])) dyl <- c(dyl, diff(h$y[ok])) } } list(xlim = range(xl, finite = TRUE), ylim = range(yl, finite = TRUE), dx = dxl, dy = dyl) } } panel.densityplot <- function(x, darg = list(n = 512), plot.points = "jitter", ref = FALSE, groups = NULL, weights = NULL, ## col = if (is.null(groups)) plot.symbol$col else superpose.symbol$col, ## lty = if (is.null(groups)) plot.line$lty else superpose.line$lty, ## lwd = if (is.null(groups)) plot.line$lwd else superpose.line$lwd, ## alpha = if (is.null(groups)) plot.line$alpha else superpose.line$alpha, ## col.line = if (is.null(groups)) plot.line$col else superpose.line$col, jitter.amount = 0.01 * diff(current.panel.limits()$ylim), type = "p", ..., grid = lattice.getOption("default.args")$grid, identifier = "density") { if (!isFALSE(grid)) { if (!is.list(grid)) grid <- switch(as.character(grid), "TRUE" = list(h = -1, v = -1, x = x), "h" = list(h = -1, v = 0), "v" = list(h = 0, v = -1, x = x), list(h = 0, v = 0)) do.call(panel.grid, grid) } if (ref) { reference.line <- trellis.par.get("reference.line") panel.abline(h = 0, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, identifier = paste(identifier, "abline")) } ## plot.line <- trellis.par.get("plot.line") ## superpose.line <- trellis.par.get("superpose.line") if (!is.null(groups)) { panel.superpose(x, darg = darg, plot.points = plot.points, ref = FALSE, groups = groups, weights = weights, panel.groups = panel.densityplot, jitter.amount = jitter.amount, type = type, ...) } else { switch(as.character(plot.points), "TRUE" = panel.xyplot(x = x, y = rep(0, length(x)), type = type, ..., identifier = identifier), "rug" = panel.rug(x = x, start = 0, end = 0, x.units = c("npc", "native"), type = type, ..., identifier = paste(identifier, "rug")), "jitter" = panel.xyplot(x = x, y = jitter(rep(0, length(x)), amount = jitter.amount), type = type, ..., identifier = identifier)) density.fun <- function(x, weights, subscripts = TRUE, darg, ...) ## wrapper to handle 'subscripts' without actually making ## it a formal argument to panel.densityplot { do.call("density", c(list(x = x, weights = weights[subscripts]), darg)) } if (sum(!is.na(x)) > 1) { h <- density.fun(x = x, weights = weights, ..., darg = darg) lim <- current.panel.limits()$xlim id <- h$x > min(lim) & h$x < max(lim) panel.lines(x = h$x[id], y = h$y[id], ..., identifier = identifier) } } } densityplot <- function(x, data, ...) UseMethod("densityplot") densityplot.numeric <- function(x, data = NULL, xlab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(densityplot) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$xlab <- xlab ccall$x <- ~x ccall[[1]] <- quote(lattice::densityplot) ans <- eval.parent(ccall) ans$call <- ocall ans } ## FIXME: weights will not currently work with the extended formula ## interface. The fix is to pass it to latticeParseFormula and ## replicate it there, but I'll postpone that for now. densityplot.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.densityplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, weights = NULL, xlab, xlim, ylab, ylim, bw = NULL, adjust = NULL, kernel = NULL, window = NULL, width = NULL, give.Rkern = FALSE, n = 512, from = NULL, to = NULL, cut = NULL, na.rm = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.densityplot"), subscripts = !is.null(groups) || !is.null(weights), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) weights <- eval(substitute(weights), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## darg is a list that gives arguments to density() darg <- list() darg$bw <- bw darg$adjust <- adjust darg$kernel <- kernel darg$window <- window darg$width <- width darg$give.Rkern <- give.Rkern darg$n <- n darg$from <- from darg$to <- to darg$cut <- cut darg$na.rm <- na.rm ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if (subscripts) subscr <- form$subscr cond <- form$condition x <- form$right if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) } if (missing(xlab)) xlab <- form$right.name if (missing(ylab)) ylab <- gettext("Density") ## if (!is.numeric(x)) ## warning("x should be numeric") ## x <- as.numeric(x) ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = form$right.name, ylab.default = gettext("Density"), lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(densityplot) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) if (have.xlim) xlim <- logLimits(xlim, xbase) } if (have.ylog) { warning("Can't have log Y-scale") have.ylog <- FALSE foo$y.scales$log <- FALSE } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- c(dots, list(darg = darg)) if (subscripts) { foo$panel.args.common$groups <- groups foo$panel.args.common$weights <- weights } npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(x = x[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = FALSE, rectangles = FALSE, lines = TRUE), auto.key) } class(foo) <- "trellis" foo } lattice/R/layout.R0000644000176200001440000010513614145160206013545 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## the pos'th entry in the unit vector x is replaced by the unit u. ## Essentially does what x[pos] <- u should have done, only u can only ## be a unit of length 1 rearrangeUnit <- function(x, pos, u) { lx <- length(x) if (lx == 1) u else if (pos == 1) unit.c(u, x[(pos+1):lx]) else if (pos == lx) unit.c(x[1:(pos-1)], u) else unit.c(x[1:(pos-1)], u, x[(pos+1):lx]) } calculateGridLayout <- function(x, rows.per.page, cols.per.page, number.of.cond, panel.height = NULL, panel.width = NULL, main, sub, xlab, ylab, xlab.top, ylab.right, x.alternating, y.alternating, x.relation.same, y.relation.same, xaxis.rot, yaxis.rot, xaxis.cex, yaxis.cex, xaxis.lineheight, yaxis.lineheight, par.strip.text, legend) ## x: the trellis object { ## The idea here is to create a layout with proper widths and ## heights (representing the requisite amounts of space required ## for different components of the plot -- see descriptions below) ## using the various units available in grid. ## Most of these components are fairly easy to define, with one ## exception -- namely those that involve axis labels. For ## instance, one (or more) _columns_ would usually contain the ## y-axis tick-labels. The width of this column is determined by ## ALL the y-labels; basically, the width of the column would be ## the MAXIMUM of the widths of the individual labels. ## This is in general not an easy problem, since relative width ## depends on the font used (also perhaps the device). Till ## lattice version 0.6, this was dealt with naively by treating ## the label with highest nchar() to be the widest. Unfortunately, ## this was no longer possible with labels that were ## expressions. So, after grid.text started supporting expression ## markups, the method of determining widths/heights for tick ## labels has changed. The new method essentially calculates the ## MAXIMUM of several grid UNIT objects (using calls like ## max(unit(...))) . ## The problem with this is that it is impossible to define the ## 'units' argument of those parts of the eventual layout when ## it's first being defined (it is not "null", "lines" or anything ## like that). So, those parts are calculated as separate units ## (via max.unit) and then inserted into the layout later. ## All this makes the code a bit difficult to follow. I just hope ## this gives some hints to whoever (probably me!) tries to ## decipher the following code on some later date. ## list giving positions (for indexing) of various components last.panel <- (rows.per.page - 1) * 4 + 10 between.seq <- seq_len(rows.per.page-1) panel.seq <- seq_len(rows.per.page) if (!x$as.table) { between.seq <- rev(between.seq) panel.seq <- rev(panel.seq) } pos.heights <- list(top.padding = 1, main = 2, main.key.padding = 3, key.top = 4, xlab.top = 5, #new key.axis.padding = 6, axis.top = 7, strip = (panel.seq - 1) * 4 + 8, panel = (panel.seq - 1) * 4 + 9, axis.panel = (panel.seq - 1) * 4 + 10, between = (between.seq - 1) * 4 + 11, axis.bottom = last.panel + 1, axis.xlab.padding = last.panel + 2, xlab = last.panel + 3, xlab.key.padding = last.panel + 4, key.bottom = last.panel + 5, key.sub.padding = last.panel + 6, sub = last.panel + 7, bottom.padding = last.panel + 8) last.panel <- (cols.per.page - 1) * 4 + 9 pos.widths <- list(left.padding = 1, key.left = 2, key.ylab.padding = 3, ylab = 4, ylab.axis.padding = 5, axis.left = 6, axis.panel = (seq_len(cols.per.page) - 1) * 4 + 7, strip.left = (seq_len(cols.per.page) - 1) * 4 + 8, panel = (seq_len(cols.per.page) - 1) * 4 + 9, between = (seq_len(cols.per.page-1) - 1) * 4 + 10, axis.right = last.panel + 1, axis.key.padding = last.panel + 2, ylab.right = last.panel + 3, # new key.right = last.panel + 4, right.padding = last.panel + 5) n.row <- sum(sapply(pos.heights, length)) n.col <- sum(sapply(pos.widths, length)) ## The next block applies when aspect is anything other than ## "fill", which means that the aspect ratio of panels are ## fixed. In grid terms, this means that the 'respect' argument ## has to be true for elements of the layout that correspond to ## panels. ## Earlier code used to set all respect entries to be TRUE in such ## cases (no need for matrices then), but that fails with the ## complicated layout necessitated by expressions (see above). layout.respect <- !x$aspect.fill if (layout.respect) { layout.respect <- matrix(0, n.row, n.col) layout.respect[pos.heights$panel, pos.widths$panel] <- 1 } ## Shall now construct height and width components needed for the ## layout. See ?unit before trying to follow this. ## placeholders: heights.x <- numeric(n.row) heights.units <- character(n.row) heights.data <- vector(mode = "list", length = n.row) widths.x <- numeric(n.col) widths.units <- character(n.col) widths.data <- vector(mode = "list", length = n.col) ## default dimensions heights.defaults <- lattice.getOption("layout.heights") widths.defaults <- lattice.getOption("layout.widths") ## finally settings values, act as multipliers (usually all 1) heights.settings <- trellis.par.get("layout.heights") widths.settings <- trellis.par.get("layout.widths") ## want to convert this into a simple vector of multipliers #h.mult <- rep(1, n.row) #w.mult <- rep(1, n.col) #for (nm in names(heights.settings)) # h.mult[pos.heights[[nm]]] <- heights.settings[[nm]] #for (nm in names(widths.settings)) # w.mult[pos.widths[[nm]]] <- widths.settings[[nm]] ## set default units. These may be scaled by user controlled ## [heights/widths].settings (usually just 1) for (nm in names(heights.defaults)) { heights.x[pos.heights[[nm]]] <- heights.settings[[nm]] * heights.defaults[[nm]]$x heights.units[pos.heights[[nm]]] <- heights.defaults[[nm]]$units if (!is.null(heights.defaults[[nm]]$data)) heights.data[[ pos.heights[[nm]] ]] <- heights.defaults[[nm]]$data } for (nm in names(widths.defaults)) { widths.x[pos.widths[[nm]]] <- widths.settings[[nm]] * widths.defaults[[nm]]$x widths.units[pos.widths[[nm]]] <- widths.defaults[[nm]]$units if (!is.null(widths.defaults[[nm]]$data)) widths.data[[ pos.widths[[nm]] ]] <- widths.defaults[[nm]]$data } ## fine tuning: if (rows.per.page > 1) heights.x[pos.heights[["between"]]] <- rep(x$y.between, length.out = rows.per.page - 1) * heights.x[pos.heights[["between"]]] if (cols.per.page > 1) widths.x[pos.widths[["between"]]] <- rep(x$x.between, length.out = cols.per.page - 1) * widths.x[pos.widths[["between"]]] if (!is.null(panel.height)) { heights.x[pos.heights[["panel"]]] <- heights.settings[["panel"]] * panel.height[[1]] heights.units[pos.heights[["panel"]]] <- panel.height[[2]] ##heights.data[[ pos.heights[["panel"]] ]] <- NULL } if (!is.null(panel.width)) { widths.x[pos.widths[["panel"]]] <- widths.settings[["panel"]] * panel.width[[1]] widths.units[pos.widths[["panel"]]] <- panel.width[[2]] ##widths.data[[ pos.widths[["panel"]] ]] <- NULL } ## Update label data as necessary, but only if units are ## "grobwidth|grobheight" (the default). Otherwise, the user ## wanted something different, so honor that. if (!is.null(main) && (heights.units[[ pos.heights[["main"]] ]] == "grobheight")) { heights.x[pos.heights[["main"]]] <- heights.settings[["main"]] heights.data[[ pos.heights[["main"]] ]] <- main } if (!is.null(sub) && (heights.units[[ pos.heights[["sub"]] ]] == "grobheight")) { heights.x[pos.heights[["sub"]]] <- heights.settings[["sub"]] heights.data[[ pos.heights[["sub"]] ]] <- sub } if (!is.null(xlab) && (heights.units[[ pos.heights[["xlab"]] ]] == "grobheight")) { heights.x[pos.heights[["xlab"]]] <- heights.settings[["xlab"]] heights.data[[ pos.heights[["xlab"]] ]] <- xlab } if (!is.null(xlab.top) && (heights.units[[ pos.heights[["xlab.top"]] ]] == "grobheight")) { heights.x[pos.heights[["xlab.top"]]] <- heights.settings[["xlab.top"]] heights.data[[ pos.heights[["xlab.top"]] ]] <- xlab.top } if (!is.null(ylab) && (widths.units[[ pos.widths[["ylab"]] ]] == "grobwidth")) { widths.x[pos.widths[["ylab"]]] <- widths.settings[["ylab"]] widths.data[[ pos.widths[["ylab"]] ]] <- ylab } if (!is.null(ylab.right) && (widths.units[[ pos.widths[["ylab.right"]] ]] == "grobwidth")) { widths.x[pos.widths[["ylab.right"]]] <- widths.settings[["ylab.right"]] widths.data[[ pos.widths[["ylab.right"]] ]] <- ylab.right } if (!is.null(legend)) { ## Update data as necessary, but only if units are ## "grobwidth|grobheight" (the default). Otherwise, the user ## wanted something different, so honor that. nl <- names(legend) if ("left" %in% nl && (widths.units[[ pos.widths[["key.left"]] ]] == "grobwidth")) { widths.x[ pos.widths[["key.left"]] ] <- widths.settings[["key.left"]] widths.data[[ pos.widths[["key.left"]] ]] <- legend$left$obj } if ("right" %in% nl && (widths.units[[ pos.widths[["key.right"]] ]] == "grobwidth")) { widths.x[ pos.widths[["key.right"]] ] <- widths.settings[["key.right"]] widths.data[[ pos.widths[["key.right"]] ]] <- legend$right$obj } if ("top" %in% nl && (heights.units[[ pos.heights[["key.top"]] ]] == "grobheight")) { heights.x[ pos.heights[["key.top"]] ] <- heights.settings[["key.top"]] heights.data[[ pos.heights[["key.top"]] ]] <- legend$top$obj } if ("bottom" %in% nl && (heights.units[[ pos.heights[["key.bottom"]] ]] == "grobheight")) { heights.x[ pos.heights[["key.bottom"]] ] <- heights.settings[["key.top"]] heights.data[[ pos.heights[["key.bottom"]] ]] <- legend$bottom$obj } } heights.x[pos.heights[["strip"]]] <- heights.x[pos.heights[["strip"]]] * if (is.logical(x$strip)) 0 # which means strip = F, strips not to be drawn else par.strip.text$cex * par.strip.text$lines * number.of.cond widths.x[pos.widths[["strip.left"]]] <- widths.x[pos.widths[["strip.left"]]] * if (is.logical(x$strip.left)) 0 # which means strip = F, strips not to be drawn else par.strip.text$cex * par.strip.text$lines * number.of.cond ## All the upcoming scary code about labels is only to determine ## how much space to leave for them. Much of these calculations ## will be repeated later before actually drawing them. if (x$x.scales$draw) { axis.units <- lattice.getOption("axis.units")[["outer"]][c("top", "bottom")] axis.settings <- trellis.par.get("axis.components")[c("top", "bottom")] if (x.relation.same) { ## this means we need to allocate space for ## pos.heights[axis.top] and pos.heights[axis.bottom] ## lab <- ## calculateAxisComponents(x = x$x.limits, ## at = x$x.scales$at, ## used.at = x$x.used.at, ## num.limit = x$x.num.limit, ## labels = x$x.scales$lab, ## logsc = x$x.scales$log, ## abbreviate = x$x.scales$abbr, ## minlength = x$x.scales$minl, ## format.posixt = x$x.scales$format, ## n = x$x.scales$tick.number)$lab lab.comps <- x$xscale.components(x$x.limits, at = x$x.scales$at, used.at = x$x.used.at, num.limit = x$x.num.limit, labels = x$x.scales$labels, logsc = x$x.scales$log, abbreviate = x$x.scales$abbreviate, minlength = x$x.scales$minlength, format.posixt = x$x.scales$format, n = x$x.scales$tick.number) ## top if (is.logical(lab.comps$top) && !lab.comps$top) { axis.top.unit <- unit(0, "mm") } else { lab.comps.top <- if (is.logical(lab.comps$top)) # must be TRUE lab.comps$bottom else lab.comps$top lab <- lab.comps.top$labels$labels tick.unit <- unit(max(0, x$x.scales$tck[2] * axis.units$top$tick$x * axis.settings$top$tck * lab.comps.top$ticks$tck), axis.units$top$tick$units) pad1.unit <- unit(axis.units$top$pad1$x * axis.settings$top$pad1, axis.units$top$pad1$units) pad2.unit <- unit(axis.units$top$pad2$x * axis.settings$top$pad2, axis.units$top$pad2$units) ## FIXME: dims may depend on other gpars like font (but ## implementing that maybe overkill) lab.grob <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = xaxis.rot[2], gp = gpar(cex = xaxis.cex[2], lineheight = xaxis.lineheight)) else textGrob("") ## FIXME: this is slightly inefficient (refer to email ## exchange with Paul), in the sense that grid has to go ## through a lot of hoops to figure out that the ## dimensions of textGrob("") is 0x0. axis.top.unit <- heights.settings[["axis.top"]] * (unit(if (any(x.alternating==2 | x.alternating==3)) 1 else 0, "grobheight", data = list(lab.grob)) + tick.unit + pad1.unit + pad2.unit) } ## bottom lab.comps.bottom <- lab.comps$bottom lab <- lab.comps.bottom$labels$labels tick.unit <- unit(max(0, x$x.scales$tck[1] * axis.units$bottom$tick$x * axis.settings$bottom$tck * lab.comps.bottom$ticks$tck), axis.units$bottom$tick$units) pad1.unit <- unit(axis.units$bottom$pad1$x * axis.settings$bottom$pad1, axis.units$bottom$pad1$units) pad2.unit <- unit(axis.units$bottom$pad2$x * axis.settings$bottom$pad2, axis.units$bottom$pad2$units) lab.grob <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = xaxis.rot[1], gp = gpar(cex = xaxis.cex[1], lineheight = xaxis.lineheight)) else textGrob("") axis.bottom.unit <- heights.settings[["axis.bottom"]] * (unit(if (any(x.alternating==1 | x.alternating==3)) 1 else 0, "grobheight", data = list(lab.grob)) + tick.unit + pad1.unit + pad2.unit) } else { # relation != same ## Basically need to allocate space for the tick labels. ## Technically, could have different heights for different ## rows, but don't want to go there (probably won't look ## good anyway). So, boils down to finding all the ## labels. Note that from R 2.0.0 onwards, the user can ## scale space for each axis individually, so such fine ## control is still possible tick.unit <- unit(max(0, x$x.scales$tck[1] * axis.units$bottom$tick$x * axis.settings$bottom$tck), axis.units$bottom$tick$units) pad1.unit <- unit(axis.units$bottom$pad1$x * axis.settings$bottom$pad1, axis.units$bottom$pad1$units) pad2.unit <- unit(axis.units$bottom$pad2$x * axis.settings$bottom$pad2, axis.units$bottom$pad2$units) ## we'll take max of ALL panels, even those that may not ## be present in this particular page or even this ## particular plot lab.groblist <- vector(mode = "list", length = length(x$x.limits)) for (i in seq_along(x$x.limits)) { ## lab <- ## calculateAxisComponents(x = x$x.limits[[i]], ## at = if (is.list(x$x.scales$at)) ## x$x.scales$at[[i]] else x$x.scales$at, ## used.at = x$x.used.at[[i]], ## num.limit = x$x.num.limit[[i]], ## labels = if (is.list(x$x.scales$lab)) ## x$x.scales$lab[[i]] else x$x.scales$lab, ## logsc = x$x.scales$log, ## abbreviate = x$x.scales$abbr, ## minlength = x$x.scales$minl, ## n = x$x.scales$tick.number, ## format.posixt = x$x.scales$format)$lab lab.comps <- x$xscale.components(x$x.limits[[i]], at = if (is.list(x$x.scales$at)) x$x.scales$at[[i]] else x$x.scales$at, used.at = x$x.used.at[[i]], num.limit = x$x.num.limit[[i]], labels = if (is.list(x$x.scales$labels)) x$x.scales$labels[[i]] else x$x.scales$labels, logsc = x$x.scales$log, abbreviate = x$x.scales$abbreviate, minlength = x$x.scales$minlength, n = x$x.scales$tick.number, format.posixt = x$x.scales$format) lab <- lab.comps$bottom$labels$labels lab.groblist[[i]] <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = xaxis.rot[1], gp = gpar(cex = xaxis.cex[1], lineheight = xaxis.lineheight)) else textGrob("") } xaxis.panel.unit <- max(unit(rep(1, length(lab.groblist)), "grobheight", data = lab.groblist)) if (lattice.getOption("optimize.grid")) xaxis.panel.unit <- convertHeight(xaxis.panel.unit, "inches") xaxis.panel.unit <- xaxis.panel.unit + tick.unit + pad1.unit + pad2.unit } } ## same for y-axes now if (x$y.scales$draw) { axis.units <- lattice.getOption("axis.units")[["outer"]][c("left", "right")] axis.settings <- trellis.par.get("axis.components")[c("left", "right")] if (y.relation.same) { ## this means we need to allocate space for ## pos.widths[axis.left] and pos.widths[axis.right] ## lab <- ## calculateAxisComponents(x = x$y.limits, ## at = x$y.scales$at, ## used.at = x$y.used.at, ## num.limit = x$y.num.limit, ## labels = x$y.scales$lab, ## logsc = x$y.scales$log, ## abbreviate = x$y.scales$abbr, ## minlength = x$y.scales$minl, ## format.posixt = x$y.scales$format, ## n = x$y.scales$tick.number)$lab lab.comps <- x$yscale.components(x$y.limits, at = x$y.scales$at, used.at = x$y.used.at, num.limit = x$y.num.limit, labels = x$y.scales$labels, logsc = x$y.scales$log, abbreviate = x$y.scales$abbreviate, minlength = x$y.scales$minlength, format.posixt = x$y.scales$format, n = x$y.scales$tick.number) ## right if (is.logical(lab.comps$right) && !lab.comps$right) { axis.right.unit <- unit(0, "mm") } else { lab.comps.right <- if (is.logical(lab.comps$right)) # must be TRUE lab.comps$left else lab.comps$right lab <- lab.comps.right$labels$labels tick.unit <- unit(max(0, x$y.scales$tck[2] * axis.units$right$tick$x * axis.settings$right$tck * lab.comps.right$ticks$tck), axis.units$right$tick$units) pad1.unit <- unit(axis.units$right$pad1$x * axis.settings$right$pad1, axis.units$right$pad1$units) pad2.unit <- unit(axis.units$right$pad2$x * axis.settings$right$pad2, axis.units$right$pad2$units) lab.grob <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = yaxis.rot[2], gp = gpar(cex = yaxis.cex[2], lineheight = yaxis.lineheight)) else textGrob("") axis.right.unit <- widths.settings[["axis.right"]] * (unit(if (any(y.alternating==2 | y.alternating==3)) 1 else 0, "grobwidth", data = list(lab.grob)) + tick.unit + pad1.unit + pad2.unit) } ## left lab.comps.left <- lab.comps$left lab <- lab.comps.left$labels$labels tick.unit <- unit(max(0, x$y.scales$tck[1] * axis.units$left$tick$x * axis.settings$left$tck * lab.comps.left$ticks$tck), axis.units$left$tick$units) pad1.unit <- unit(axis.units$left$pad1$x * axis.settings$left$pad1, axis.units$left$pad1$units) pad2.unit <- unit(axis.units$left$pad2$x * axis.settings$left$pad2, axis.units$left$pad2$units) lab.grob <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = yaxis.rot[1], gp = gpar(cex = yaxis.cex[1], lineheight = yaxis.lineheight)) else textGrob("") axis.left.unit <- widths.settings[["axis.left"]] * (unit(if (any(y.alternating==1 | y.alternating==3)) 1 else 0, "grobwidth", data = list(lab.grob)) + tick.unit + pad1.unit + pad2.unit) } else { # relation != same ## Basically need to allocate space for the tick labels. ## Technically, could have different heights for different ## rows, but don't want to go there (probably won't look ## good anyway). So, boils down to finding all the ## labels. Note that from R 2.0.0 onwards, the user can ## scale space for each axis individually, so such fine ## control is still possible tick.unit <- unit(max(0, x$y.scales$tck[1] * axis.units$left$tick$x * axis.settings$left$tck), axis.units$left$tick$units) pad1.unit <- unit(axis.units$left$pad1$x * axis.settings$left$pad1, axis.units$left$pad1$units) pad2.unit <- unit(axis.units$left$pad2$x * axis.settings$left$pad2, axis.units$left$pad2$units) ## we'll take max of ALL panels, even those that may not ## be present in this particular page or even this ## particular plot lab.groblist <- vector(mode = "list", length = length(x$y.limits)) for (i in seq_along(x$y.limits)) { ## lab <- ## calculateAxisComponents(x = x$y.limits[[i]], ## at = if (is.list(x$y.scales$at)) ## x$y.scales$at[[i]] else x$y.scales$at, ## used.at = x$y.used.at[[i]], ## num.limit = x$y.num.limit[[i]], ## labels = if (is.list(x$y.scales$lab)) ## x$y.scales$lab[[i]] else x$y.scales$lab, ## logsc = x$y.scales$log, ## abbreviate = x$y.scales$abbr, ## minlength = x$y.scales$minl, ## n = x$y.scales$tick.number, ## format.posixt = x$y.scales$format)$lab lab.comps <- x$yscale.components(x$y.limits[[i]], at = if (is.list(x$y.scales$at)) x$y.scales$at[[i]] else x$y.scales$at, used.at = x$y.used.at[[i]], num.limit = x$y.num.limit[[i]], labels = if (is.list(x$y.scales$labels)) x$y.scales$labels[[i]] else x$y.scales$labels, logsc = x$y.scales$log, abbreviate = x$y.scales$abbreviate, minlength = x$y.scales$minlength, n = x$y.scales$tick.number, format.posixt = x$y.scales$format) lab <- lab.comps$left$labels$labels lab.groblist[[i]] <- if (length(lab) > 0) textGrob(label = lab, x = rep(0.5, length(lab)), y = rep(0.5, length(lab)), rot = yaxis.rot[1], gp = gpar(cex = yaxis.cex[1], lineheight = yaxis.lineheight)) else textGrob("") } yaxis.panel.unit <- max(unit(rep(1, length(lab.groblist)), "grobwidth", data = lab.groblist)) if (lattice.getOption("optimize.grid")) yaxis.panel.unit <- convertWidth(yaxis.panel.unit, "inches") yaxis.panel.unit <- yaxis.panel.unit + tick.unit + pad1.unit + pad2.unit } } ## Having determined heights and widths, now construct the layout: layout.heights <- unit(heights.x, heights.units, data = heights.data) layout.widths <- unit(widths.x, widths.units, data = widths.data) ## As mentioned above, the units for axes are 'composite' units ## calculated separately, and we'll now insert them in their ## proper place if (x$x.scales$draw) { if (x.relation.same) { layout.heights <- rearrangeUnit(layout.heights, pos.heights[["axis.top"]], trellis.par.get("layout.heights")[["axis.top"]] * axis.top.unit) layout.heights <- rearrangeUnit(layout.heights, pos.heights[["axis.bottom"]], trellis.par.get("layout.heights")[["axis.bottom"]] * axis.bottom.unit) } else { ## FIXME: this would be a good place to add custom ## multipliers for panel axes, once Paul fixes the grid ## bug pcol <- length(pos.heights[["axis.panel"]]) axis.panel.mult <- rep(trellis.par.get("layout.heights")[["axis.panel"]], length.out = pcol) for (i in seq_len(pcol)) layout.heights <- rearrangeUnit(layout.heights, pos.heights[["axis.panel"]][i], axis.panel.mult[i] * xaxis.panel.unit) } } if (x$y.scales$draw) { if (y.relation.same) { layout.widths <- rearrangeUnit(layout.widths, pos.widths[["axis.left"]], trellis.par.get("layout.widths")[["axis.left"]] * axis.left.unit) layout.widths <- rearrangeUnit(layout.widths, pos.widths[["axis.right"]], trellis.par.get("layout.widths")[["axis.right"]] * axis.right.unit) } else { prow <- length(pos.widths[["axis.panel"]]) axis.panel.mult <- rep(trellis.par.get("layout.widths")[["axis.panel"]], length.out = prow) for (i in seq_len(prow)) layout.widths <- rearrangeUnit(layout.widths, pos.widths[["axis.panel"]][i], axis.panel.mult[i] * yaxis.panel.unit) } } page.layout <- grid.layout(nrow = n.row, ncol = n.col, widths = layout.widths, heights = layout.heights, # widths = w.mult * layout.widths, # heights = h.mult * layout.heights, respect = layout.respect) #debug # assign("gridLayout", page.layout, .GlobalEnv) list(page.layout = page.layout, pos.heights = pos.heights, pos.widths = pos.widths) } ## Note: the following is only meant to be used in print.trellis. It ## supercedes the use of cupdate there. However, cupdate will ## continue to be used by high level functions. packet.panel.default <- function(layout, condlevels, page, row, column, skip, all.pages.skip = TRUE) { ## assume layout has been standardized ## condlevels is a list, as long as the number of conditioning ## variables, each component being a vector of integer indices ## representing levels. This must already have considered any ## effects of index.cond and perm.cond. panels.per.page <- layout[1] * layout[2] panels.per.row <- layout[1] ## panels.per.column <- layout[2] # unused packet.order <- do.call(expand.grid, condlevels) ## Don't try to force the default behaviour of skip elsewhere, ## since this gives users the freedom to make it behave as they ## want. if (all.pages.skip) { skip <- rep(skip, length.out = panels.per.page * page) } else { skip <- rep(skip, length.out = panels.per.page) skip <- rep(skip, page) } ## This covers current page, which is all we care about. panel.number <- 1 + (page - 1) * panels.per.page + (row - 1) * panels.per.row + (column - 1) if (skip[panel.number]) return(NULL) panel.number <- panel.number - sum(head(skip, panel.number)) if (panel.number > nrow(packet.order)) return(NULL) as.numeric(packet.order[panel.number, ]) } lattice/R/parallel.R0000644000176200001440000003125314576262623014040 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.parallel <- function(x, y, z, ..., horizontal.axis = TRUE) { if (horizontal.axis) list(xlim = c(0,1), ylim = extend.limits(c(1, ncol(as.data.frame(z))), prop = 0.03), ##ylim = colnames(as.data.frame(z)), dx = 1, dy = 1) else list(xlim = extend.limits(c(1, ncol(as.data.frame(z))), prop = 0.03), ylim = c(0,1), dx = 1, dy = 1) } panel.parallel <- function(x, y, z, subscripts, groups = NULL, col = superpose.line$col, lwd = superpose.line$lwd, lty = superpose.line$lty, alpha = superpose.line$alpha, common.scale = FALSE, lower = sapply(z, function(x) min(as.numeric(x), na.rm = TRUE)), upper = sapply(z, function(x) max(as.numeric(x), na.rm = TRUE)), ..., horizontal.axis = TRUE, identifier = "parallel") { superpose.line <- trellis.par.get("superpose.line") reference.line <- trellis.par.get("reference.line") n.r <- ncol(z) n.c <- length(subscripts) if (is.null(groups)) { col <- rep(col, length.out = n.c) lty <- rep(lty, length.out = n.c) lwd <- rep(lwd, length.out = n.c) alpha <- rep(alpha, length.out = n.c) } else { groups <- as.factor(groups)[subscripts] n.g <- nlevels(groups) gnum <- as.numeric(groups) ## probably unnecessary col <- rep(col, length.out = n.g)[gnum] lty <- rep(lty, length.out = n.g)[gnum] lwd <- rep(lwd, length.out = n.g)[gnum] alpha <- rep(alpha, length.out = n.g)[gnum] } if (is.function(lower)) lower <- sapply(z, lower) if (is.function(upper)) upper <- sapply(z, upper) if (common.scale) { lower <- min(lower) upper <- max(upper) } lower <- rep(lower, length.out = n.r) upper <- rep(upper, length.out = n.r) dif <- upper - lower if (n.r > 1) if (horizontal.axis) panel.segments(x0 = 0, x1 = 1, y0 = seq_len(n.r), y1 = seq_len(n.r), col = reference.line$col, lwd = reference.line$lwd, lty = reference.line$lty, identifier = paste(identifier, "reference", sep = ".")) else panel.segments(x0 = seq_len(n.r), x1 = seq_len(n.r), y0 = 0, y1 = 1, col = reference.line$col, lwd = reference.line$lwd, lty = reference.line$lty, identifier = paste(identifier, "reference", sep = ".")) else return(invisible()) for (i in seq_len(n.r-1)) { z0 <- (as.numeric(z[subscripts, i]) - lower[i])/dif[i] z1 <- (as.numeric(z[subscripts, i+1]) - lower[i+1])/dif[i+1] if (horizontal.axis) panel.segments(x0 = z0, y0 = i, x1 = z1, y1 = i + 1, col = col, lty = lty, lwd = lwd, alpha = alpha, ..., identifier = paste(identifier, i, sep = ".")) else panel.segments(x0 = i, y0 = z0, x1 = i + 1, y1 = z1, col = col, lty = lty, lwd = lwd, alpha = alpha, ..., identifier = paste(identifier, i, sep = ".")) } invisible() } parallelplot <- function(x, data, ...) UseMethod("parallelplot") parallelplot.matrix <- parallelplot.data.frame <- function(x, data = NULL, ..., groups = NULL, subset = TRUE) { ocall <- sys.call(); ocall[[1]] <- quote(parallelplot) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$x <- ~x ccall$data <- environment() ## ccall$data <- ## list(x = x, groups = groups, subset = subset) ## ccall$groups <- groups ## ccall$subset <- subset ccall[[1]] <- quote(lattice::parallelplot) modifyList(eval.parent(ccall), list(call = ocall)) } parallelplot.formula <- function(x, data = NULL, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", between = list(x = 0.5, y = 0.5), panel = lattice.getOption("panel.parallel"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab = NULL, xlim, ylab = NULL, ylim, varnames = NULL, horizontal.axis = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.parallel"), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing ## right.name <- deparse(substitute(x)) ## x <- eval(substitute(x), data, environment(formula)) form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = FALSE, outer = FALSE, subscripts = TRUE, drop = drop.unused.levels) ## We need to be careful with subscripts here. It HAS to be there, ## and it's to be used to index x, y, z (and not only groups, ## unlike in xyplot etc). This means we have to subset groups as ## well, which is about the only use for the subscripts calculated ## in latticeParseFormula, after which subscripts is regenerated ## as a straight sequence indexing the variables if (!is.null(form$groups)) groups <- form$groups[form$subscr] subscr <- seq_len(nrow(form$right)) if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) cond <- form$condition x <- as.data.frame(form$right) if (length(cond) == 0) { strip <- FALSE cond <- list(as.factor(rep(1, nrow(x)))) } varnames <- if (is.null(varnames)) colnames(x) else varnames ## WAS eval(substitute(varnames), data, environment(formula)), but ## not sure why non-standard evaluation would be useful here if (length(varnames) != ncol(x)) stop("'varnames' has wrong length.") ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, between = between, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = gettext("Parallel Coordinate Plot"), lattice.options = lattice.options, horizontal.axis = horizontal.axis), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(parallelplot) ## Step 2: Compute scales.common (leaving out limits for now) ## overriding at and labels, maybe not necessary if (missing(default.scales)) { default.scales <- list(x = list(at = c(0, 1), labels = c("Min", "Max")), y = list(alternating = FALSE, axs = "i", tck = 0, at = seq_len(ncol(x)), labels = varnames)) if (!horizontal.axis) names(default.scales) <- c("y", "x") } if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log if (have.xlog) { xlog <- foo$x.scales$log xbase <- if (is.logical(xlog)) 10 else if (is.numeric(xlog)) xlog else if (xlog == "e") exp(1) x <- log(x, xbase) foo$x.scales$log <- FALSE ## This is because No further changes will be ## necessary while printing since x-axes are not ## marked (many x axes) } if (have.ylog) { warning("cannot have log y-scale") foo$y.scales$log <- FALSE } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- c(list(z = x, groups = groups, varnames = varnames), dots) npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(subscripts = subscr[id]) cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = FALSE, rectangles = FALSE, lines = TRUE), auto.key) } class(foo) <- "trellis" foo } parallel <- function(x, data, ...) { .Defunct("parallelplot") ## ccall <- match.call() ## ccall[[1]] <- quote(lattice::parallelplot) ## eval.parent(ccall) UseMethod("parallel") } parallel.formula <- parallelplot.formula parallel.matrix <- parallelplot.matrix parallel.data.frame <- parallelplot.data.frame lattice/R/qqmath.R0000644000176200001440000003331114576465132013534 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.default.qqmath <- function(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, subscripts, ..., tails.n = 0) { if (!is.numeric(x)) x <- as.numeric(x) # FIXME: dates? distribution <- getFunctionOrName(distribution) nobs <- sum(!is.na(x)) ## if plotting tails, do prepanel as for raw data: if (tails.n > 0) f.value <- NULL getxx <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) distribution(ppoints(nobs)) else if (is.numeric(f.value)) distribution(f.value) else distribution(f.value(nobs)) } getyy <- function(x, f.value = NULL, nobs = sum(!is.na(x))) { if (is.null(f.value)) sort(x) else if (is.numeric(f.value)) quantile(x, f.value, # was fast.quantile names = FALSE, type = qtype, na.rm = TRUE) else quantile(x, f.value(nobs), # was fast.quantile names = FALSE, type = qtype, na.rm = TRUE) } if (!nobs) prepanel.null() else if (!is.null(groups)) { sx <- split(x, groups[subscripts]) xxlist <- lapply(sx, getxx, f.value = f.value) yylist <- lapply(sx, getyy, f.value = f.value) list(xlim = range(unlist(xxlist), finite = TRUE), ylim = range(unlist(yylist), finite = TRUE), dx = unlist(lapply(xxlist, diff)), dy = unlist(lapply(yylist, diff))) } else { xx <- getxx(x, f.value, nobs) yy <- getyy(x, f.value, nobs) list(xlim = scale_limits(xx), # range(xx, finite = TRUE), ylim = scale_limits(yy), # range(yy, finite = TRUE), dx = diff(xx), dy = diff(yy)) } } panel.qqmath <- function(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, ..., tails.n = 0, identifier = "qqmath") { x <- as.numeric(x) distribution <- getFunctionOrName(distribution) nobs <- sum(!is.na(x)) if (!is.null(groups)) panel.superpose(x, y = NULL, f.value = f.value, distribution = distribution, qtype = qtype, groups = groups, panel.groups = panel.qqmath, ..., tails.n = tails.n) else if (nobs) { if (is.null(f.value)) # exact data instead of quantiles { panel.xyplot(x = distribution(ppoints(nobs)), y = sort(x), ..., identifier = identifier) } else { pp <- if (is.numeric(f.value)) f.value else f.value(nobs) if (tails.n > 0) { ## use exact data for tails of distribution tails.n <- min(tails.n, nobs %/% 2) ppd <- ppoints(nobs) ## omit probabilities within the exact tails pp <- pp[(pp > ppd[tails.n] & pp < ppd[nobs + 1 - tails.n])] ## add on probs corresponding to exact tails pp <- c(head(ppd, tails.n), pp, tail(ppd, tails.n)) ## must use a quantile type that recovers exact values: qtype <- 1 } xx <- distribution(pp) yy <- quantile(x, pp, names = FALSE, type = qtype, na.rm = TRUE) panel.xyplot(x = xx, y = yy, ..., identifier = identifier) } } } qqmath <- function(x, data, ...) UseMethod("qqmath") qqmath.numeric <- function(x, data = NULL, ylab = deparse(substitute(x)), ...) { ocall <- sys.call(); ocall[[1]] <- quote(qqmath) ccall <- match.call() if (!is.null(ccall$data)) warning("explicit 'data' specification ignored") ccall$data <- environment() # list(x = x) ccall$ylab <- ylab ccall$x <- ~x ccall[[1]] <- quote(lattice::qqmath) ans <- eval.parent(ccall) ans$call <- ocall ans } qqmath.formula <- function(x, data = NULL, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), distribution = qnorm, f.value = NULL, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.qqmath"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.qqmath"), subscripts = !is.null(groups), subset = TRUE) { formula <- x dots <- list(...) groups <- eval(substitute(groups), data, environment(formula)) subset <- eval(substitute(subset), data, environment(formula)) if (!is.null(lattice.options)) { oopt <- lattice.options(lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## Step 1: Evaluate x, y, etc. and do some preprocessing form <- latticeParseFormula(formula, data, subset = subset, groups = groups, multiple = allow.multiple, outer = outer, subscripts = TRUE, drop = drop.unused.levels) groups <- form$groups if (!is.function(panel)) panel <- eval(panel) if (!is.function(strip)) strip <- eval(strip) if ("subscripts" %in% names(formals(panel))) subscripts <- TRUE if (subscripts) subscr <- form$subscr cond <- form$condition ## number.of.cond <- length(cond) x <- form$right if (length(cond) == 0) { strip <- FALSE cond <- list(gl(1, length(x))) ## number.of.cond <- 1 } dist.name <- paste(deparse(substitute(distribution)), collapse = "") if (missing(xlab)) xlab <- dist.name if (missing(ylab)) ylab <- form$right.name ## create a skeleton trellis object with the ## less complicated components: foo <- do.call("trellis.skeleton", c(list(formula = formula, cond = cond, aspect = aspect, strip = strip, panel = panel, xlab = xlab, ylab = ylab, xlab.default = dist.name, ylab.default = form$right.name, lattice.options = lattice.options), dots), quote = TRUE) dots <- foo$dots # arguments not processed by trellis.skeleton foo <- foo$foo foo$call <- sys.call(); foo$call[[1]] <- quote(qqmath) ## Step 2: Compute scales.common (leaving out limits for now) if (is.character(scales)) scales <- list(relation = scales) scales <- updateList(default.scales, scales) foo <- c(foo, do.call("construct.scales", scales)) ## Step 3: Decide if limits were specified in call: have.xlim <- !missing(xlim) if (!is.null(foo$x.scales$limits)) { have.xlim <- TRUE xlim <- foo$x.scales$limits } have.ylim <- !missing(ylim) if (!is.null(foo$y.scales$limits)) { have.ylim <- TRUE ylim <- foo$y.scales$limits } ## Step 4: Decide if log scales are being used: have.xlog <- !is.logical(foo$x.scales$log) || foo$x.scales$log have.ylog <- !is.logical(foo$y.scales$log) || foo$y.scales$log ## This is slightly weird because 'x' is eventually plotted in the ## Y-axis if (have.xlog) { warning("Can't have log X-scale") have.xlog <- FALSE foo$x.scales$log <- FALSE } if (have.ylog) { ylog <- foo$y.scales$log ybase <- if (is.logical(ylog)) 10 else if (is.numeric(ylog)) ylog else if (ylog == "e") exp(1) x <- log(x, ybase) if (have.ylim) ylim <- logLimits(ylim, ybase) } ## Step 5: Process cond cond.max.level <- unlist(lapply(cond, nlevels)) ## Step 6: Determine packets foo$panel.args.common <- c(list(distribution = distribution, f.value = f.value), dots) if (subscripts) { foo$panel.args.common$groups <- groups } npackets <- prod(cond.max.level) if (npackets != prod(sapply(foo$condlevels, length))) stop("mismatch in number of packets") foo$panel.args <- vector(mode = "list", length = npackets) foo$packet.sizes <- numeric(npackets) if (npackets > 1) { dim(foo$packet.sizes) <- sapply(foo$condlevels, length) dimnames(foo$packet.sizes) <- lapply(foo$condlevels, as.character) } cond.current.level <- rep(1, length(cond)) for (packet.number in seq_len(npackets)) { id <- compute.packet(cond, cond.current.level) foo$packet.sizes[packet.number] <- sum(id) foo$panel.args[[packet.number]] <- list(x = x[id]) if (subscripts) foo$panel.args[[packet.number]]$subscripts <- subscr[id] cond.current.level <- cupdate(cond.current.level, cond.max.level) } more.comp <- c(limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, x.axs = foo$x.scales$axs, y.axs = foo$y.scales$axs), cond.orders(foo)) foo[names(more.comp)] <- more.comp if (is.null(foo$legend) && needAutoKey(auto.key, groups)) { foo$legend <- autoKeyLegend(list(text = levels(as.factor(groups)), points = TRUE, rectangles = FALSE, lines = FALSE), auto.key) } class(foo) <- "trellis" foo } ############################################## panel.qqmathline <- function(x, y = x, distribution = qnorm, probs = c(0.25, 0.75), qtype = 7, groups = NULL, ..., identifier = "qqmathline") { y <- as.numeric(y) stopifnot(length(probs) == 2) distribution <- getFunctionOrName(distribution) nobs <- sum(!is.na(y)) if (!is.null(groups)) panel.superpose(x = y, y = NULL, distribution = distribution, probs = probs, qtype = qtype, groups = groups, panel.groups = panel.qqmathline, ...) else if (nobs > 0) { yy <- quantile(y, probs, names = FALSE, # was fast.quantile type = qtype, na.rm = TRUE) xx <- distribution(probs) r <- diff(yy)/diff(xx) panel.abline(c( yy[1]-xx[1]*r , r), ..., identifier = identifier) } } prepanel.qqmathline <- function(x, y = x, distribution = qnorm, probs = c(0.25, 0.75), qtype = 7, groups = NULL, subscripts = TRUE, ...) { ans <- prepanel.default.qqmath(x, distribution = distribution, qtype = qtype, groups = groups, subscripts = subscripts, ...) y <- as.numeric(y) stopifnot(length(probs) == 2) distribution <- getFunctionOrName(distribution) getdy <- function(x) { diff(quantile(x, probs, names = FALSE, # was fast.quantile type = qtype, na.rm = TRUE)) } dy <- if (!is.null(groups)) sapply(split(y, groups[subscripts]), getdy) else getdy(y) if (!all(is.na(dy))) { ans$dy <- dy[!is.na(dy)] ans$dx <- rep(diff(distribution(probs)), length(ans$dy)) } ans } lattice/R/print.trellis.R0000644000176200001440000017520413657202215015050 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## accessors for a grid layouts nrow and ncol layoutNRow <- function(x) x$nrow layoutNCol <- function(x) x$ncol ## other accessors, for during (and sometimes after) plotting current.row <- function(prefix = lattice.getStatus("current.prefix")) lattice.getStatus("current.focus.row", prefix = prefix) current.column <- function(prefix = lattice.getStatus("current.prefix")) lattice.getStatus("current.focus.column", prefix = prefix) trellis.currentLayout <- function(which = c("packet", "panel"), prefix = lattice.getStatus("current.prefix")) { which <- match.arg(which) switch(which, packet = lattice.getStatus("current.packet.positions", prefix = prefix), panel = lattice.getStatus("current.panel.positions", prefix = prefix)) } panel.number <- function(prefix = lattice.getStatus("current.prefix")) { trellis.currentLayout("panel", prefix = prefix)[current.row(prefix = prefix), current.column(prefix = prefix)] } packet.number <- function(prefix = lattice.getStatus("current.prefix")) { trellis.currentLayout("packet", prefix = prefix)[current.row(prefix = prefix), current.column(prefix = prefix)] } which.packet <- function(prefix = lattice.getStatus("current.prefix")) { lattice.getStatus("current.cond.levels", prefix = prefix)[[current.row(prefix = prefix), current.column(prefix = prefix)]] } ## utility to create a full-fledged list describing a label from parts ## (used for main, sub, xlab, ylab) getLabelList <- function(label, text.settings, default.label = NULL) { if (!is.null(label)) { if (is.grob(label)) return(label) ans <- list(label = if (is.characterOrExpression(label)) label else if (is.list(label) && (is.null(names(label)) || names(label)[1] == "")) label[[1]] else default.label) if ("label" %in% names(text.settings)) text.settings$label <- NULL ans <- updateList(ans, text.settings) if (is.list(label) && !is.null(names(label))) { if (names(label)[1] == "") label <- label[-1] ans <- updateList(ans, label) } } else ans <- NULL if (is.null(ans$label) || (is.character(ans) && ans$label == "")) ans <- NULL else if (is.call(ans$label) || is.symbol(ans$label)) ans$label <- as.expression(ans$label) ans } drawInViewport <- function(obj, vp) { pushViewport(vp) grid.draw(obj) upViewport() } grobFromLabelList <- function(lab, name = "label", orient = 0) { emptyLabel <- function(lab) { is.null(lab) || length(lab) == 0 || (is.character(lab) && !any(nzchar(lab))) ## NOTE: lab could also be "empty" expression / call / symbol, but we're not checking } if (emptyLabel(lab)) return (NULL) if (is.grob(lab)) return(lab) process.lab <- function(label, rot = orient, x = NULL, y = NULL, just = "centre", hjust = NULL, vjust = NULL, check.overlap = FALSE, font = NULL, fontfamily = NULL, fontface = NULL, ...) { ans <- list(label = label, rot = rot, x = x, y = y, just = just, hjust = hjust, vjust = vjust, check.overlap = check.overlap) ans$gplist <- gpar(fontfamily = fontfamily, fontface = chooseFace(fontface, font), ...) ans } lab <- do.call(process.lab, lab) if (with(lab, emptyLabel(label))) return (NULL) if (is.null(lab$x)) lab$x <- if (orient == 0) ppoints(n = length(lab$label), a = 0.5) else 0.5 if (is.null(lab$y)) lab$y <- if (orient == 90) ppoints(n = length(lab$label), a = 0.5) else 0.5 textGrob(label = lab$label, x = lab$x, y = lab$y, name = name, just = lab$just, hjust = lab$hjust, vjust = lab$vjust, check.overlap = lab$check.overlap, rot = lab$rot, gp = lab$gplist) ## gpar(col = lab$col, ## fontfamily = lab$fontfamily, ## fontface = chooseFace(lab$fontface, lab$font), ## lineheight = lab$lineheight, ## alpha = lab$alpha, ## cex = lab$cex)) } evaluate.legend <- function(legend) { if (is.null(legend)) return(NULL) for (i in seq_along(legend)) { fun <- legend[[i]]$fun fun <- getFunctionOrName(fun) ## OK in case fun is a grob? if (is.function(fun)) fun <- do.call("fun", legend[[i]]$args, quote = TRUE) legend[[i]]$obj <- fun legend[[i]]$args <- NULL legend[[i]]$fun <- NULL } legend } panel.error <- function(e) { grid.text(gettextf("Error using packet %g\n%s", panel.number(), conditionMessage(e))) } ## S3 print method for "trellis" objects print.trellis <- function(x, ...) { printFunction <- lattice.getOption("print.function") if (is.null(printFunction)) printFunction <- plot.trellis printFunction(x, ...) invisible(x) } ## S3 plot method for "trellis" objects plot.trellis <- function(x, position = NULL, split = NULL, more = FALSE, newpage = TRUE, packet.panel = packet.panel.default, draw.in = NULL, panel.height = lattice.getOption("layout.heights")$panel, panel.width = lattice.getOption("layout.widths")$panel, save.object = lattice.getOption("save.object"), panel.error = lattice.getOption("panel.error"), prefix = NULL, ...) { ## make sure we have a device open if (is.null(dev.list())) trellis.device() else if (is.null(trellis.par.get())) trellis.device(device = .Device, new = FALSE) ## if necessary, save current settings and apply temporary ## settings in x$par.settings if (!is.null(x$par.settings)) { ## save current state, restore later opar <- trellis.par.get() ## get("lattice.theme", envir = .LatticeEnv) trellis.par.set(theme = x$par.settings) on.exit(trellis.par.set(opar, strict = 2L), add = TRUE) } ## do the same for lattice.options if (!is.null(x$lattice.options)) { ## save current state, restore later oopt <- lattice.options(x$lattice.options) on.exit(lattice.options(oopt), add = TRUE) } ## We'll also allow arguments to print.trellis (or plot.trellis) ## to be included within a trellis object. Partial matching is ## not done. if (!is.null(x$plot.args)) { supplied <- names(x$plot.args) ## Can't think of a clean way, so... if ("position" %in% supplied && missing(position)) position <- x$plot.args$position if ("split" %in% supplied && missing(split)) split <- x$plot.args$split if ("more" %in% supplied && missing(more)) more <- x$plot.args$more if ("newpage" %in% supplied && missing(newpage)) newpage <- x$plot.args$newpage if ("packet.panel" %in% supplied && missing(packet.panel)) packet.panel <- x$plot.args$packet.panel if ("draw.in" %in% supplied && missing(draw.in)) draw.in <- x$plot.args$draw.in if ("panel.height" %in% supplied && missing(panel.height)) panel.height <- x$plot.args$panel.height if ("panel.width" %in% supplied && missing(panel.width)) panel.width <- x$plot.args$panel.width if ("save.object" %in% supplied && missing(save.object)) save.object <- x$plot.args$save.object if ("panel.error" %in% supplied && missing(panel.error)) panel.error <- x$plot.args$panel.error if ("prefix" %in% supplied && missing(prefix)) prefix <- x$plot.args$prefix } panel.error <- getFunctionOrName(panel.error) bg <- trellis.par.get("background")$col new <- newpage && !lattice.getStatus("print.more") && is.null(draw.in) if (!is.null(draw.in)) { depth <- downViewport(draw.in) on.exit(upViewport(depth), add = TRUE) } on.exit(lattice.setStatus(print.more = more), add = TRUE) usual <- (is.null(position) && is.null(split)) ## This means this plot will be the first one on a new page, so ## delete all previously recorded information and reset counter if (new) { lattice.setStatus(.defaultLatticeStatus(), clean.first = TRUE) ## .LatticeEnv$lattice.status <- .defaultLatticeStatus() lattice.setStatus(plot.index = 0L) } ## get default prefix for grid viewport/object names pindex <- 1L + lattice.getStatus("plot.index") if (is.null(prefix)) prefix <- sprintf("plot_%02g", pindex) lattice.setStatus(plot.index = pindex) ## Set this so that panel and axis functions can use it, but set ## it again before exiting (in case some user action has changed ## it in the meantime) so that further calls to trellis.focus() ## etc. can use it. lattice.setStatus(current.prefix = prefix) on.exit(lattice.setStatus(current.prefix = prefix), add = TRUE) ## Initialize list for this prefix .LatticeEnv$lattice.status[[prefix]] <- .defaultLatticePrefixStatus() ## Equivalently ## lattice.setStatus(structure(list(.defaultLatticePrefixStatus()), ## names = prefix)) ## save the current object, if so requested. This used to be done ## at the end, so that it wouldn't happen if there were errors ## during printing. However, doing this now will allow things ## like trellis.panelArgs() to work in panel/axis functions, which ## I think is a better trade-off. ## FIXME: the problem with this is that if, e.g., the panel ## function calls print.trellis(), then the last object is not ## what one would expect. if (save.object) { lattice.setStatus(current.plot.saved = TRUE, prefix = prefix) ## assign("last.object", x, envir = .LatticeEnv) lattice.setStatus(last.object = x, prefix = prefix) } else lattice.setStatus(current.plot.saved = FALSE, prefix = prefix) ## Use general grid parameters in 'grid.pars', but for historical ## reasons, override by 'trellis.par.get("fontsize")$text' if set tp.fontsize <- trellis.par.get("fontsize")$text global.gpar <- if (is.null(tp.fontsize)) do.call(gpar, trellis.par.get("grid.pars")) else do.call(gpar, updateList(trellis.par.get("grid.pars"), list(fontsize = tp.fontsize))) if (!is.null(position)) { stopifnot (length(position) == 4) if (new) { grid.newpage() grid.rect(name=trellis.grobname("background", type=""), gp = gpar(fill = bg, col = "transparent")) } pushViewport(viewport(x = position[1], y = position[2], width = position[3] - position[1], height = position[4] - position[2], just = c("left","bottom"), name = trellis.vpname("position", prefix = prefix))) if (!is.null(split)) { stopifnot (length(split) == 4) pushViewport(viewport(layout = grid.layout(nrow = split[4], ncol = split[3]), name = trellis.vpname("split", prefix = prefix) )) pushViewport(viewport(layout.pos.row = split[2], layout.pos.col = split[1], name = trellis.vpname("split.location", prefix = prefix) )) } } else if (!is.null(split)) { stopifnot(length(split) == 4) if (new) { grid.newpage() grid.rect(name = trellis.grobname("background", type=""), gp = gpar(fill = bg, col = "transparent")) } pushViewport(viewport(layout = grid.layout(nrow = split[4], ncol = split[3]), name = trellis.vpname("split", prefix = prefix) )) pushViewport(viewport(layout.pos.row = split[2], layout.pos.col = split[1], name = trellis.vpname("split.location", prefix = prefix) )) } ## order.cond will be a multidimensional array, with ## length(dim(order.cond)) = number of conditioning ## variables. It's a numeric vector 1:(number.of.panels), with ## dim() = c(nlevels(g1), ..., nlevels(gn)), where g1, ..., gn are ## the conditioning variables. ## manipulating order.cond has 2 uses. Using normal indexing, the ## order of plots within a conditioning variable can be altered, ## or only a subset of the levels used. Also, using aperm, the ## order of conditioning can be altered. ## the information required to make the appropriate permutation ## and indexing is in the components index.cond and perm.cond of ## the trellis object ### FIXME: need some thinking here. ## ## Original version (up to 0.13 series): ## order.cond <- seq_len(prod(sapply(x$condlevels, length))) ## dim(order.cond) <- sapply(x$condlevels, length) ## ## first subset, then permute ## order.cond <- do.call("[", c(list(order.cond), x$index.cond, list(drop = FALSE))) ## order.cond <- aperm(order.cond, perm = x$perm.cond) ## ## New version: ## used.condlevels corresponds to the indexed and permuted object. ## These also have to be integer indices rather than character ## labels (necessary for 'packet.panel' computations). ## original.condlevels is required to interpret the results of ## packet.panel and associate them with packets in the original ## object (which are defined in terms of the original levels) original.condlevels <- used.condlevels <- lapply(x$condlevels, function(x) seq_along(x)) used.condlevels <- mapply("[", used.condlevels, x$index.cond, MoreArgs = list(drop = FALSE), SIMPLIFY = FALSE) used.condlevels <- used.condlevels[x$perm.cond] inverse.permutation <- order(x$perm.cond) # used later ## an array giving packet numbers corresponding to ## original.condlevels. The idea is to be able to figure out the ## packet given levels of the conditioning variables. The packets ## are naturally thought of as an array. The packet number simply ## counts positions of this array in the standard order ## (i.e. lower dimensions vary faster). adim <- sapply(original.condlevels, length) packet.array <- seq_len(prod(adim)) dim(packet.array) <- adim ## FIXME: trying to find a way to make order.cond unnecessary may ## make things simpler, but that's not a very immediate concern ## (and not clear how difficult either). ## order.cond <- seq_len(prod(sapply(x$condlevels, length))) ## dim(order.cond) <- sapply(x$condlevels, length) ## first subset, then permute ## order.cond <- do.call("[", c(list(order.cond), x$index.cond, list(drop = FALSE))) ## order.cond <- aperm(order.cond, perm = x$perm.cond) ## order.cond will be used as indices for (exactly) the following ## 1. panel.args ## 2. x.limits ## 3. y.limits ## may need x$(index|perm).cond later for strip drawing ## cond.max.levels <- dim(order.cond) cond.max.levels <- sapply(used.condlevels, length) number.of.cond <- length(cond.max.levels) panel.layout <- compute.layout(x$layout, cond.max.levels, skip = x$skip) panel <- getFunctionOrName(x$panel) # shall use "panel" in do.call strip <- getFunctionOrName(x$strip) strip.left <- getFunctionOrName(x$strip.left) axis.line <- trellis.par.get("axis.line") axis.text <- trellis.par.get("axis.text") ## make sure aspect ratio is preserved for aspect != "fill" but ## this may not always be what's expected. In fact, aspect should ## be "fill" whenever panel.width or panel.height are non-default. ## panel.width <- 1 if (!x$aspect.fill) panel.height[[1]] <- x$aspect.ratio * panel.width[[1]] ## Evaluate the legend / key grob(s): legend <- evaluate.legend(x$legend) ## legend is now a list of `grob's along with placement info xaxis.lty <- if (is.logical(x$x.scales$lty)) axis.line$lty else x$x.scales$lty xaxis.lwd <- if (is.logical(x$x.scales$lwd)) axis.line$lwd else x$x.scales$lwd xaxis.col.line <- if (is.logical(x$x.scales$col.line)) axis.line$col else x$x.scales$col.line xaxis.col.text <- if (is.logical(x$x.scales$col)) axis.text$col else x$x.scales$col xaxis.alpha.line <- if (is.logical(x$x.scales$alpha.line)) axis.line$alpha else x$x.scales$alpha.line xaxis.alpha.text <- if (is.logical(x$x.scales$alpha)) axis.text$alpha else x$x.scales$alpha xaxis.font <- if (is.logical(x$x.scales$font)) axis.text$font else x$x.scales$font xaxis.fontface <- if (is.logical(x$x.scales$fontface)) axis.text$fontface else x$x.scales$fontface xaxis.fontfamily <- if (is.logical(x$x.scales$fontfamily)) axis.text$fontfamily else x$x.scales$fontfamily xaxis.lineheight <- if (is.logical(x$x.scales$lineheight)) axis.text$lineheight else x$x.scales$lineheight xaxis.cex <- if (is.logical(x$x.scales$cex)) rep(axis.text$cex, length.out = 2) else x$x.scales$cex xaxis.rot <- if (is.logical(x$x.scales$rot)) c(0, 0) else x$x.scales$rot yaxis.lty <- if (is.logical(x$y.scales$lty)) axis.line$lty else x$y.scales$lty yaxis.lwd <- if (is.logical(x$y.scales$lwd)) axis.line$lwd else x$y.scales$lwd yaxis.col.line <- if (is.logical(x$y.scales$col.line)) axis.line$col else x$y.scales$col.line yaxis.col.text <- if (is.logical(x$y.scales$col)) axis.text$col else x$y.scales$col yaxis.alpha.line <- if (is.logical(x$y.scales$alpha.line)) axis.line$alpha else x$y.scales$alpha.line yaxis.alpha.text <- if (is.logical(x$y.scales$alpha)) axis.text$alpha else x$y.scales$alpha yaxis.font <- if (is.logical(x$y.scales$font)) axis.text$font else x$y.scales$font yaxis.fontface <- if (is.logical(x$y.scales$fontface)) axis.text$fontface else x$y.scales$fontface yaxis.fontfamily <- if (is.logical(x$y.scales$fontfamily)) axis.text$fontfamily else x$y.scales$fontfamily yaxis.lineheight <- if (is.logical(x$y.scales$lineheight)) axis.text$lineheight else x$y.scales$lineheight yaxis.cex <- if (is.logical(x$y.scales$cex)) rep(axis.text$cex, length.out = 2) else x$y.scales$cex yaxis.rot <- if (!is.logical(x$y.scales$rot)) x$y.scales$rot else if (x$y.scales$relation != "same" && is.logical(x$y.scales$labels)) c(90, 90) else c(0, 0) strip.col.default.bg <- rep(trellis.par.get("strip.background")$col, length.out = number.of.cond) strip.col.default.fg <- rep(trellis.par.get("strip.shingle")$col, length.out = number.of.cond) ## border is common (see strip.default) ## strip.border <- ## lapply(trellis.par.get("strip.border"), ## function(x) rep(x, length.out = number.of.cond)) ## Start layout calculations when only number of panels per page ## is pecified (this refers to the layout argument, not grid ## layouts) ## using device dimensions to calculate default layout: if (panel.layout[1] == 0) { ddim <- par("din") device.aspect <- ddim[2] / ddim[1] panel.aspect <- panel.height[[1]] / panel.width[[1]] plots.per.page <- panel.layout[2] m <- max (1, round(sqrt(panel.layout[2] * device.aspect / panel.aspect))) ## changes made to fix bug (PR#1744) n <- ceiling(plots.per.page/m) m <- ceiling(plots.per.page/n) panel.layout[1] <- n panel.layout[2] <- m } ## End layout calculations plots.per.page <- panel.layout[1] * panel.layout[2] cols.per.page <- panel.layout[1] rows.per.page <- panel.layout[2] number.of.pages <- panel.layout[3] lattice.setStatus(current.plot.multipage = number.of.pages > 1, prefix = prefix) ## these will also eventually be 'status' variables current.panel.positions <- matrix(0, rows.per.page, cols.per.page) current.packet.positions <- matrix(0, rows.per.page, cols.per.page) current.cond.levels <- vector(mode = "list", length = rows.per.page * cols.per.page) dim(current.cond.levels) <- c(rows.per.page, cols.per.page) ## ## following now relegated to packet.panel ## skip <- rep(x$skip, length.out = number.of.pages * rows.per.page * cols.per.page) x.alternating <- rep(x$x.scales$alternating, length.out = cols.per.page) y.alternating <- rep(x$y.scales$alternating, length.out = rows.per.page) x.relation.same <- x$x.scales$relation == "same" y.relation.same <- x$y.scales$relation == "same" ## get lists for main, sub, xlab, ylab main <- grobFromLabelList(getLabelList(x$main, trellis.par.get("par.main.text")), name = trellis.grobname("main", type="")) sub <- grobFromLabelList(getLabelList(x$sub, trellis.par.get("par.sub.text")), name = trellis.grobname("sub", type="")) xlab <- grobFromLabelList(getLabelList(x$xlab, trellis.par.get("par.xlab.text"), x$xlab.default), name = trellis.grobname("xlab", type="")) ylab <- grobFromLabelList(getLabelList(x$ylab, trellis.par.get("par.ylab.text"), x$ylab.default), name = trellis.grobname("ylab", type=""), orient = 90) xlab.top <- grobFromLabelList(getLabelList(x$xlab.top, trellis.par.get("par.xlab.text")), name = trellis.grobname("xlab.top", type="")) ylab.right <- grobFromLabelList(getLabelList(x$ylab.right, trellis.par.get("par.ylab.text")), name = trellis.grobname("ylab.right", type=""), orient = 90) ## get par.strip.text par.strip.text <- trellis.par.get("add.text") par.strip.text$lines <- 1 if (!is.null(x$par.strip.text)) par.strip.text[names(x$par.strip.text)] <- x$par.strip.text ## Shall calculate the per page Grid layout now: ## this layout will now be used for each page (this is quite ## complicated and unfortunately very convoluted) layoutCalculations <- calculateGridLayout(x, rows.per.page, cols.per.page, number.of.cond, panel.height, panel.width, main, sub, xlab, ylab, xlab.top, ylab.right, x.alternating, y.alternating, x.relation.same, y.relation.same, xaxis.rot, yaxis.rot, xaxis.cex, yaxis.cex, xaxis.lineheight, yaxis.lineheight, par.strip.text, legend) lattice.setStatus(layout.details = layoutCalculations, prefix = prefix) lattice.setStatus(as.table = x$as.table, prefix = prefix) page.layout <- layoutCalculations$page.layout pos.heights <- layoutCalculations$pos.heights pos.widths <- layoutCalculations$pos.widths n.row <- layoutNRow(page.layout) n.col <- layoutNCol(page.layout) ## commence actual plotting panel.counter <- 0 ## panel.number is available as an optional argument to the panel ## function (FIXME: to be deprecated). It's a strictly increasing ## sequential counter keeping track of which panel is being drawn. ## This is usually the same as, but can be different from ## packet.number, which is an index to which packet combination is ## being used. ## dev.hold/dev.flush. There's no clean way to deal with ## the possibility of erroring out before dev.flush() is ## called, because using on.exit() will be complicated ## unless we separate out each page into a separate ## function call. Instead, we keep track using a flag. dev.held <- FALSE # is dev.hold() turned on? on.exit(if(dev.held) dev.flush(), add = TRUE) ## FIXME: what happens when number of pages is 0? ## message("no of pages: ", number.of.pages) for (page.number in seq_len(number.of.pages)) { if (TRUE) ## FIXME: remove this after a few versions and reformat { dev.hold() dev.held <- TRUE ## In older versions, we used to decide here whether a new ## page was actually needed, i.e., whether there is ## anything to draw (o.w., why waste a page?). This is no ## longer possible because we don't know a priori what ## packet.panel() will return. if (usual) { if (new) grid.newpage() grid.rect(name = trellis.grobname("background", type=""), gp = gpar(fill = bg, col = "transparent")) new <- TRUE } pushViewport(viewport(layout = page.layout, gp = global.gpar, name = trellis.vpname("toplevel", prefix = prefix))) if (!is.null(main)) { drawInViewport(main, viewport(layout.pos.row = pos.heights$main, name= trellis.vpname("main", prefix = prefix))) } if (!is.null(sub)) { drawInViewport(sub, viewport(layout.pos.row = pos.heights$sub, name= trellis.vpname("sub", prefix = prefix))) } if (!is.null(xlab)) { drawInViewport(xlab, viewport(layout.pos.row = pos.heights$xlab, layout.pos.col = pos.widths$panel, name= trellis.vpname("xlab", prefix = prefix))) } if (!is.null(ylab)) { drawInViewport(ylab, viewport(layout.pos.col = pos.widths$ylab, layout.pos.row = pos.heights$panel, name= trellis.vpname("ylab", prefix = prefix))) } if (!is.null(xlab.top)) { drawInViewport(xlab.top, viewport(layout.pos.row = pos.heights$xlab.top, layout.pos.col = pos.widths$panel, name= trellis.vpname("xlab.top", prefix = prefix))) } if (!is.null(ylab.right)) { drawInViewport(ylab.right, viewport(layout.pos.col = pos.widths$ylab.right, layout.pos.row = pos.heights$panel, name= trellis.vpname("ylab.right", prefix = prefix))) } ## last.panel <- prod(sapply(x$index.cond, length)) ## Create a viewport encompassing all panels and strips, ## but don't do anything in it. This is useful later for ## trellis.focus() like operations. rowRange <- with(pos.heights, range(panel, strip, axis.panel)) colRange <- with(pos.widths, range(panel, strip.left, axis.panel)) pushViewport(viewport(layout.pos.row = rowRange, layout.pos.col = colRange, clip = "off", name = trellis.vpname("figure"))) upViewport() ## preliminary loop through possible positions, doing some ## calculations that allow some helpful status variables ## to be set. ## first, initialize status variables current.panel.positions[, ] <- 0 current.packet.positions[, ] <- 0 current.cond.levels[, ] <- list(NULL) for (row in seq_len(rows.per.page)) for (column in seq_len(cols.per.page)) { ## levels being used in this panel which.packet <- packet.panel(layout = panel.layout, condlevels = used.condlevels, page = page.number, row = row, column = column, skip = x$skip) if (!is.null(which.packet)) { ## permute to restore original order which.packet <- which.packet[inverse.permutation] current.cond.levels[[row, column]] <- which.packet ## packet.number should be same as packet.array[which.packet] ## ^^^^^^^^^^^ ## (length not fixed) packet.number <- do.call("[", c(list(x = packet.array), as.list(which.packet))) current.packet.positions[row, column] <- packet.number ## packet.number retrieves the appropriate ## entry of panel.args and [xy].limits. It has ## to be this way because otherwise ## non-trivial orderings will not work. ## But we also provide a simple incremental ## counter that may be used as a panel ## function argument panel.counter <- panel.counter + 1 current.panel.positions[row, column] <- panel.counter } } lattice.setStatus(current.cond.levels = current.cond.levels, prefix = prefix) lattice.setStatus(current.panel.positions = current.panel.positions, prefix = prefix) lattice.setStatus(current.packet.positions = current.packet.positions, prefix = prefix) ## loop through positions again, doing the actual drawing ## this time for (row in seq_len(rows.per.page)) for (column in seq_len(cols.per.page)) { lattice.setStatus(current.focus.row = row, current.focus.column = column, prefix = prefix) which.packet <- which.packet(prefix = prefix) if (!is.null(which.packet)) { packet.number <- packet.number(prefix = prefix) panel.number <- panel.number(prefix = prefix) ## needed? FIXME ## ## this gives the row position from the bottom ## actual.row <- if (x$as.table) ## (rows.per.page-row+1) else row pos.row <- pos.heights$panel[row] pos.col <- pos.widths$panel[column] xscale.comps <- if (x.relation.same) x$xscale.components(lim = x$x.limits, ## (FIXME: needs work) packet.list = ... top = TRUE, ## rest passed on to ## calculateAxisComponents ## in the default ## case: at = x$x.scales$at, used.at = x$x.used.at, num.limit = x$x.num.limit, labels = x$x.scales$labels, logsc = x$x.scales$log, abbreviate = x$x.scales$abbreviate, minlength = x$x.scales$minlength, n = x$x.scales$tick.number, # for pretty() nint = x$x.scales$tick.number, # for axisTicks() (log) equispaced.log = x$x.scales$equispaced.log, format.posixt = x$x.scales$format) else x$xscale.components(lim = x$x.limits[[packet.number]], ## FIXME: needs work packet.list = ... top = FALSE, ## rest passed on to ## calculateAxisComponents ## in the default ## case: at = if (is.list(x$x.scales$at)) x$x.scales$at[[packet.number]] else x$x.scales$at, used.at = x$x.used.at[[packet.number]], num.limit = x$x.num.limit[[packet.number]], labels = if (is.list(x$x.scales$labels)) x$x.scales$labels[[packet.number]] else x$x.scales$labels, logsc = x$x.scales$log, abbreviate = x$x.scales$abbreviate, minlength = x$x.scales$minlength, n = x$x.scales$tick.number, nint = x$x.scales$tick.number, equispaced.log = x$x.scales$equispaced.log, format.posixt = x$x.scales$format) yscale.comps <- if (y.relation.same) x$yscale.components(lim = x$y.limits, ## FIXME: needs work packet.list = ... right = TRUE, ## rest passed on to ## calculateAxisComponents ## in the default ## case: at = x$y.scales$at, used.at = x$y.used.at, num.limit = x$y.num.limit, labels = x$y.scales$labels, logsc = x$y.scales$log, abbreviate = x$y.scales$abbreviate, minlength = x$y.scales$minlength, n = x$y.scales$tick.number, nint = x$y.scales$tick.number, equispaced.log = x$y.scales$equispaced.log, format.posixt = x$y.scales$format) else x$yscale.components(lim = x$y.limits[[packet.number]], ## FIXME: needs work packet.list = ... right = FALSE, ## rest passed on to ## calculateAxisComponents ## in the default ## case: at = if (is.list(x$y.scales$at)) x$y.scales$at[[packet.number]] else x$y.scales$at, used.at = x$y.used.at[[packet.number]], num.limit = x$y.num.limit[[packet.number]], labels = if (is.list(x$y.scales$labels)) x$y.scales$labels[[packet.number]] else x$y.scales$labels, logsc = x$y.scales$log, abbreviate = x$y.scales$abbreviate, minlength = x$y.scales$minlength, n = x$y.scales$tick.number, nint = x$y.scales$tick.number, equispaced.log = x$y.scales$equispaced.log, format.posixt = x$y.scales$format) xscale <- xscale.comps$num.limit yscale <- yscale.comps$num.limit ############################################ ### drawing panel background ## ############################################ pushViewport(viewport(layout.pos.row = pos.row, layout.pos.col = pos.col, xscale = xscale, yscale = yscale, clip = trellis.par.get("clip")$panel, name = trellis.vpname("panel", column = column, row = row, prefix = prefix, clip.off = FALSE))) panel.bg <- trellis.par.get("panel.background") if (!is.null(panel.bg$col) && (panel.bg$col != "transparent")) panel.fill(col = panel.bg$col) upViewport() ############################################ ### drawing the axes ## ############################################ ### Note: axes should always be drawn before the panel, so that ### background grids etc. can be drawn. ### whether or not axes are drawn, we'll create viewports for them ### anyway, so that users can later interactively add axes/other stuff ### if they wish. First up, we'll have a 'strip.column.row.off' ### viewport for the top axes, then another one for those on the left ### (there can be strips on the left too), and then a ### 'panel.column.row.off' viewport for the other 2 (no strips allowed ### there). The names may seem a bit unintuitive, and perhaps they ### are, but some justification is provided in help(trellis.focus) pushViewport(viewport(layout.pos.row = pos.row - 1, layout.pos.col = pos.col, xscale = xscale, clip = "off", name = trellis.vpname("strip", column = column, row = row, prefix = prefix, clip.off = TRUE))) ## X-axis above x$axis(side = "top", scales = x$x.scales, components = xscale.comps, as.table = x$as.table, rot = xaxis.rot[2], text.col = xaxis.col.text, text.alpha = xaxis.alpha.text, text.cex = xaxis.cex[2], text.font = xaxis.font, text.fontfamily = xaxis.fontfamily, text.fontface = xaxis.fontface, text.lineheight = xaxis.lineheight, line.col = xaxis.col.line, line.lty = xaxis.lty, line.lwd = xaxis.lwd, line.alpha = xaxis.alpha.line, prefix = prefix) upViewport() ## Y-axis to the left pushViewport(viewport(layout.pos.row = pos.row, layout.pos.col = pos.col - 1, yscale = yscale, clip = "off", name = trellis.vpname("strip.left", column = column, row = row, prefix = prefix, clip.off = TRUE))) x$axis(side = "left", scales = x$y.scales, components = yscale.comps, as.table = x$as.table, rot = yaxis.rot[1], text.col = yaxis.col.text, text.alpha = yaxis.alpha.text, text.cex = yaxis.cex[1], text.font = yaxis.font, text.fontfamily = yaxis.fontfamily, text.fontface = yaxis.fontface, text.lineheight = yaxis.lineheight, line.col = yaxis.col.line, line.lty = yaxis.lty, line.lwd = yaxis.lwd, line.alpha = yaxis.alpha.line, prefix = prefix) upViewport() ## X-axis bottom and Y-axis right pushViewport(viewport(layout.pos.row = pos.row, layout.pos.col = pos.col, xscale = xscale, yscale = yscale, clip = "off", name = trellis.vpname("panel", column = column, row = row, prefix = prefix, clip.off = TRUE))) ## X-axis below x$axis(side = "bottom", scales = x$x.scales, components = xscale.comps, as.table = x$as.table, rot = xaxis.rot[1], text.col = xaxis.col.text, text.alpha = xaxis.alpha.text, text.cex = xaxis.cex[1], text.font = xaxis.font, text.fontfamily = xaxis.fontfamily, text.fontface = xaxis.fontface, text.lineheight = xaxis.lineheight, line.col = xaxis.col.line, line.lty = xaxis.lty, line.lwd = xaxis.lwd, line.alpha = xaxis.alpha.line, prefix = prefix) ## Y-axis to the right x$axis(side = "right", scales = x$y.scales, components = yscale.comps, as.table = x$as.table, rot = yaxis.rot[2], text.col = yaxis.col.text, text.alpha = yaxis.alpha.text, text.cex = yaxis.cex[2], text.font = yaxis.font, text.fontfamily = yaxis.fontfamily, text.fontface = yaxis.fontface, text.lineheight = yaxis.lineheight, line.col = yaxis.col.line, line.lty = yaxis.lty, line.lwd = yaxis.lwd, line.alpha = yaxis.alpha.line, prefix = prefix) ## N.B.: We'll need this viewport again later ## to draw a border around it. However, this ## must be postponed till after the panel is ## drawn, since otherwise the border is liable ## to be obscured. upViewport() ############################################ ### done drawing axes ## ############################################ ############################################ ### drawing the panel ## ############################################ ## viewport already created for drawing background downViewport(trellis.vpname("panel", column = column, row = row, prefix = prefix, clip.off = FALSE)) ## pushViewport(viewport(layout.pos.row = pos.row, ## layout.pos.col = pos.col, ## xscale = xscale, ## yscale = yscale, ## clip = trellis.par.get("clip")$panel, ## name = ## trellis.vpname("panel", ## column = column, ## row = row, ## prefix = prefix, ## clip.off = FALSE))) pargs <- c(x$panel.args[[packet.number]], x$panel.args.common) #, ## FIXME: include prefix = prefix? Could be ## important in very rare cases, but let's ## wait till someone actually has a relevant ## use-case. ## if (!("..." %in% names(formals(panel)))) ## pargs <- pargs[intersect(names(pargs), names(formals(panel)))] ## if (is.null(panel.error)) ## do.call("panel", pargs) ## else ## tryCatch(do.call("panel", pargs), ## error = function(e) panel.error(e)) if (is.null(panel.error)) checkArgsAndCall(panel, pargs) else tryCatch(checkArgsAndCall(panel, pargs), error = function(e) panel.error(e)) upViewport() ############################################ ### finished drawing panel ## ############################################ ######################################################################### ### Draw the box around panels. This used to be done with clipping ## ### on, which caused some subtle and apparently puzzling side effects. ## ######################################################################### downViewport(trellis.vpname("panel", column = column, row = row, prefix = prefix, clip.off = TRUE)) grid.rect(name = trellis.grobname("border", type="panel"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd, alpha = axis.line$alpha, fill = "transparent")) upViewport() ######################################### ### draw strip(s) on top ### ######################################### if (!is.logical(strip)) # logical <==> FALSE { pushViewport(viewport(layout.pos.row = pos.row - 1, layout.pos.col = pos.col, clip = "off", ## was: trellis.par.get("clip")$strip, name = trellis.vpname("strip", column = column, row = row, prefix = prefix, clip.off = FALSE))) for(i in seq_len(number.of.cond)) { ## Here, by which.given, I mean which ## in the original order, not the ## permuted order which.given <- x$perm.cond[i] which.panel <- which.packet lattice.setStatus(current.which.given = which.given, current.which.panel = which.panel, prefix = prefix) strip(which.given = which.given, which.panel = which.panel, ## panel.number = panel.number, ## packet.number = packet.number, var.name = names(x$condlevels), factor.levels = as.character(x$condlevels[[x$perm.cond[i]]]), shingle.intervals = if (is.list(x$condlevels[[x$perm.cond[i]]])) do.call("rbind", x$condlevels[[x$perm.cond[i]]]) else NULL, horizontal = TRUE, bg = strip.col.default.bg[i], fg = strip.col.default.fg[i], par.strip.text = par.strip.text) } upViewport() } ######################################### ### draw strip(s) on left ### ######################################### if (!is.logical(strip.left)) # logical <==> FALSE { pushViewport(viewport(layout.pos.row = pos.row, layout.pos.col = pos.col - 1, clip = trellis.par.get("clip")$strip, name = trellis.vpname("strip.left", column = column, row = row, prefix = prefix, clip.off = FALSE))) for(i in seq_len(number.of.cond)) { ## Here, by which.given, I mean which ## in the original packet order, not ## the permuted order which.given <- x$perm.cond[i] which.panel <- which.packet lattice.setStatus(current.which.given = which.given, current.which.panel = which.panel, prefix = prefix) strip.left(which.given = which.given, which.panel = which.panel, ## panel.number = panel.number, ## packet.number = packet.number, var.name = names(x$condlevels), factor.levels = as.character(x$condlevels[[x$perm.cond[i]]]), shingle.intervals = if (is.list(x$condlevels[[x$perm.cond[i]]])) do.call("rbind", x$condlevels[[x$perm.cond[i]]]) else NULL, horizontal = FALSE, bg = strip.col.default.bg[i], fg = strip.col.default.fg[i], par.strip.text = par.strip.text) } upViewport() } } } ## legend / key plotting if (!is.null(legend)) { locs <- names(legend) for (i in seq_along(legend)) { key.space <- locs[i] key.gf <- legend[[i]]$obj switch(key.space, left = drawInViewport(key.gf, viewport(layout.pos.col = pos.widths$key.left, layout.pos.row = range(pos.heights$panel, pos.heights$strip), name = trellis.vpname("legend", side = "left", prefix = prefix))), right = drawInViewport(key.gf, viewport(layout.pos.col = pos.widths$key.right, layout.pos.row = range(pos.heights$panel, pos.heights$strip), name = trellis.vpname("legend", side = "right", prefix = prefix))), top = drawInViewport(key.gf, viewport(layout.pos.row = pos.heights$key.top, layout.pos.col = range(pos.widths$panel, pos.widths$strip.left), name = trellis.vpname("legend", side = "top", prefix = prefix))), bottom = drawInViewport(key.gf, viewport(layout.pos.row = pos.heights$key.bottom, layout.pos.col = range(pos.widths$panel, pos.widths$strip.left), name = trellis.vpname("legend", side = "bottom", prefix = prefix))), inside = { ## There are two choices here --- ## either treat the whole figure region ## as the rectangle, or use just the ## region covered by the panels. This ## is user-controllable through ## lattice.options("legend.bbox"). legend.bbox <- lattice.getOption("legend.bbox") switch(legend.bbox, full = pushViewport(viewport(layout.pos.row = c(1, n.row), layout.pos.col = c(1, n.col), name = trellis.vpname("legend.region", prefix = prefix))), panel = pushViewport(viewport(layout.pos.row = range(pos.heights$panel, pos.heights$strip), layout.pos.col = range(pos.widths$panel, pos.widths$strip.left), name = trellis.vpname("legend.region", prefix = prefix)))) key.corner <- if (is.null(legend[[i]]$corner)) c(0,1) else legend[[i]]$corner key.x <- if (is.null(legend[[i]]$x)) key.corner[1] else legend[[i]]$x key.y <- if (is.null(legend[[i]]$y)) key.corner[2] else legend[[i]]$y drawInViewport(key.gf, viewport(x = unit(key.x, "npc") + unit(0.5 - key.corner[1], "grobwidth", list(key.gf)), y = unit(key.y, "npc") + unit(0.5 - key.corner[2], "grobheight", list(key.gf)), name = trellis.vpname("legend", side = "inside", prefix = prefix))) upViewport(1) }) } } pushViewport(viewport(layout.pos.row = c(1, n.row), layout.pos.col = c(1, n.col), name = trellis.vpname("page", prefix = prefix))) if (!is.null(x$page)) x$page(page.number) upViewport() upViewport() ## dev.hold/dev.flush. dev.flush() dev.held <- FALSE } } if (!is.null(position)) { if (!is.null(split)) { upViewport() upViewport() } upViewport() } else if (!is.null(split)) { upViewport() upViewport() } lattice.setStatus(current.focus.row = 0, current.focus.column = 0, vp.highlighted = FALSE, vp.depth = 0, prefix = prefix) invisible() } lattice/R/settings.R0000644000176200001440000016530314413024235014071 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA col.whitebg <- function() list(background = list(col="transparent"), plot.polygon = list(col="#c8ffc8"), box.rectangle = list(col="darkgreen"), box.umbrella = list(col="darkgreen"), dot.line = list(col="gray90"), dot.symbol = list(col="darkgreen"), plot.line = list(col="darkgreen"), plot.symbol = list(col="darkgreen"), ##regions=list(col=rev(hsv(h=250:349/1000, v=30:129/150,s=.5, ##gamma = .6))) regions = list(col = heat.colors(100)), strip.shingle = list(col = c("#ff7f00", "#00ff00", "#00ffff", "#0080ff", "#ff00ff", "#ff0000", "#ffff00")), strip.background = list(col = c("#ffe5cc", "#ccffcc", "#ccffff", "#cce6ff", "#ffccff", "#ffcccc", "#ffffcc")), reference.line = list(col="gray90"), superpose.line = list(col = c("darkgreen","red","royalblue", "brown","orange","turquoise", "orchid"), lty = 1:7), superpose.symbol = list(pch = c(1,3,6,0,5,16,17), cex = rep(.7, 7), col = c("darkgreen","red","royalblue", "brown","orange","turquoise", "orchid"))) ## this function is used to make the superpose.polygon colors less ## saturated versions of the symbol and line colors lower.saturation <- function(x, f = 0.2, space = c("RGB", "HCL")) { ## lower saturation in RGB or HCL space? space <- match.arg(tolower(space), c("rgb", "hcl")) ## for HCL space ideally colorspace::lighten() should be used if((space == "hcl") && requireNamespace("colorspace")) { return(colorspace::lighten(x, amount = 1 - f)) } ## for RGB space the old implementation from lattice is used, ## for HCL space (if colorspace is unavailable) an approximation in LUV is used RGB <- col2rgb(x) if(space == "rgb") { RGB[] <- 255 - RGB RGB[] <- round(f * RGB) RGB[] <- 255 - RGB } else { ## adjust L coordinate of HCL/LUV only, chroma is left as it is LUV <- convertColor(t(RGB), from = "sRGB", to = "Luv", scale.in = 255) Lold <- pmin(100, pmax(0, LUV[, "L"])) LUV[, "L"] <- 100 - (100 - Lold) * f RGB[] <- t(convertColor(LUV, from = "Luv", to = "sRGB", scale.out = 255)) } rgb(RGB["red", ], RGB["green", ], RGB["blue", ], maxColorValue = 255) } ## make a 'shading' function from region colors, for use in ## wireframe(shade = TRUE). 'pref' controls the amount of matte / ## glossy-ness. makeShadePalette <- function(col.regions, ..., min = 0.05, pref = 0.75) { cramp <- colorRamp(col.regions, ...) function(irr, ref, height) { ## All arguments will be scalars currently. ## Better alternative: use colorspace::darken() RGB <- cramp(height) RGB[] <- (min + (1-min) * irr * ref^pref) * RGB # darken rgb(RGB[, 1], RGB[, 2], RGB[, 3], maxColorValue = 255) } } ## Construct a custom theme based on supplied colors (originally in ## latticeExtra). custom_theme <- function(symbol, fill, region, reference = "gray90", bg = "transparent", fg = "black", strip.bg = rep("gray95", 7), strip.fg = rep("gray70", 7), ...) { theme <- list(plot.polygon = list(col = fill[1], border = fg[1]), box.rectangle = list(col= symbol[1]), box.umbrella = list(col= symbol[1]), dot.line = list(col = reference), dot.symbol = list(col = symbol[1]), plot.line = list(col = symbol[1]), plot.symbol = list(col= symbol[1]), reference.line = list(col = reference), superpose.line = list(col = symbol), superpose.symbol = list(col = symbol), superpose.polygon = list(col = fill, border = fg), regions = list(col = colorRampPalette(region)(100)), shade.colors = list(palette = makeShadePalette(region)), strip.background = list(col = strip.bg), strip.shingle = list(col = strip.fg), strip.border = list(col = fg), background = list(col = bg), add.line = list(col = fg), add.text = list(col = fg), box.dot = list(col = fg), axis.line = list(col = fg), axis.text = list(col = fg), strip.border = list(col = fg), box.3d = list(col = fg), par.xlab.text = list(col = fg), par.ylab.text = list(col = fg), par.zlab.text = list(col = fg), par.main.text = list(col = fg), par.sub.text = list(col = fg)) modifyList(modifyList(classic.theme("pdf"), theme), simpleTheme(...)) } ## (v0.21-7) Extended to make it easy to provide user-supplied colors. ## Default symbol colors are from Okabe-Ito, reordered to match classic theme somewhat better. ## Default fill colors are lightened versions of the symbol colors. ## Default region colors are the sequential HCL palette "YlGnBu" (approximating the one from ColorBrewer). ## Old standard.theme() / canonical.theme() renamed to classic.theme() canonical.theme <- function(...) standard.theme(...) standard.theme <- function(name, color = TRUE, symbol = palette.colors(palette = "Okabe-Ito")[c(6, 2, 4, 7, 3, 5, 8)], fill = NULL, region = hcl.colors(14, palette = "YlGnBu", rev = TRUE), reference = "gray90", bg = "transparent", fg = "black", ...) { if (is.null(fill)) fill <- if (!missing(symbol)) lower.saturation(symbol, 0.4, space = "HCL") else c("#94C6FF", "#FFD6AD", "#76E3B8", "#FFBBA9", "#BCE1FF", "#FFF691", "#FFC1E1") if (!missing(name)) classic.theme(name = name, color = color) else if (!color) classic.theme(color = FALSE) else custom_theme(symbol = symbol, fill = fill, region = region, reference = reference, bg = bg, fg = fg, ...) } classic.theme <- function(name = .Device, color = name != "postscript") { ## For the purpose of this function, the only differences in the ## settings/themes arise from the difference in the default ## colors. So, I will first set up the appropriate colors ## according to 'name', and then use those to create the ## theme. The first 16 colors correspond to trellis.settings ## colors, the 17th is the background color. if (color) { ## color colors can.col <- if (name %in% c("windows", "X11")) c("#000000", "#00ffff", "#ff00ff", "#00ff00", "#ff7f00", "#007eff", "#ffff00", "#ff0000", "#c6ffff", "#ffc3ff", "#c8ffc8", "#ffd18f", "#a9e2ff", "#ffffc3", "#ff8c8a", "#aaaaaa", "#909090") else if (name %in% c("postscript", "pdf", "xfig")) c("#000000", "#00ffff", "#ff00ff", "#00ff00", "#ff7f00", "#0080ff", "#ffff00", "#ff0000", "#ccffff", "#ffccff", "#ccffcc", "#ffe5cc", "#cce6ff", "#ffffcc", "#ffcccc", "#e6e6e6", "transparent") else ## default, same as X11 for now c("#000000", "#00FFFF", "#FF00FF", "#00FF00", "#FF7F00", "#007EFF", "#FFFF00", "#FF0000", "#C6FFFF", "#FFC3FF", "#C8FFC8", "#FFD18F", "#A9E2FF", "#FFFFC3", "#FF8C8A", "#AAAAAA", "#909090") } else ## b&w colors, same for all devices (8:15 mostly unnecessary) can.col <- c("#000000", "#999999", "#4C4C4C", "#E6E6E6", "#F2F2F2", "#B2B2B2", "#000000", "#030303", "#050505", "#080808", "#0A0A0A", "#0D0D0D", "#0F0F0F", "#121212", "#151515", "#AAAAAA", "transparent") ## The following is the canonical definition of what elements are ## valid in any setting. Adding something here should be necessary ## and sufficient. ## Note: For any component with a $font entry, more general ## specifications using $fontfamily and $fontface is also allowed ## (see ?grid::gpar for details). If set, fontsize$text will ## override get.gpar("fontsize") (which in turn usually defaults ## to the device pointsize). ## color settings, modified later if postscript or color = FALSE ans <- list(grid.pars = list(), ## set globally at the beginning fontsize = list(text = 12, points = 8), background = list(alpha = 1, col = can.col[17]), panel.background = list(col = "transparent"), clip = list(panel = "on", strip = "on"), add.line = list(alpha = 1, col = can.col[1], lty = 1, lwd = 1), add.text = list(alpha = 1, cex = 1, col = can.col[1], font = 1, lineheight = 1.2), plot.polygon = list(alpha = 1, col = can.col[2], border = "black", lty = 1, lwd = 1), box.dot = list(alpha = 1, col = can.col[1], cex = 1, font = 1, pch = 16), box.rectangle = list(alpha = 1, col = can.col[2], fill = "transparent", lty = 1, lwd = 1), box.umbrella = list(alpha = 1, col = can.col[2], lty = 2, lwd = 1), dot.line = list(alpha = 1, col = can.col[16], lty = 1, lwd = 1), dot.symbol = list(alpha = 1, cex = 0.8, col = can.col[2], font = 1, pch = 16), plot.line = list(alpha = 1, col = can.col[2], lty = 1, lwd = 1), plot.symbol = list(alpha = 1, cex = 0.8, col = can.col[2], font = 1, pch = 1, fill = "transparent"), reference.line = list(alpha = 1, col = can.col[16], lty = 1, lwd = 1), strip.background = list(alpha = 1, col = can.col[c(12, 11, 9, 13, 10, 15, 14)]), strip.shingle = list(alpha = 1, col = can.col[c(5, 4, 2, 6, 3, 8, 7)]), strip.border = list(alpha = 1, col = rep(can.col[1], 7), lty = rep(1, 7), lwd = rep(1, 7)), superpose.line = list(alpha = 1, col = can.col[2:8], lty = rep(1, 7), lwd = rep(1, 7)), superpose.symbol = list(alpha = rep(1, 7), cex = rep(0.8, 7), col = can.col[2:8], fill = lower.saturation(can.col[2:8]), ## WAS: fill = rep("transparent", 7), font = rep(1, 7), pch = rep(1, 7)), superpose.polygon= list(alpha = rep(1, 7), col = lower.saturation(can.col[2:8]), ## WAS can.col[2:8] border = rep("black", 7), lty = rep(1, 7), lwd = rep(1, 7)), regions = list(alpha = 1, col = rev(cm.colors(100))), shade.colors = list(alpha = 1, palette = function(irr, ref, height, saturation = .9) { hsv(h = height, s = 1 - saturation * (1 - (1-ref)^0.5), v = irr) }), axis.line = list(alpha = 1, col = can.col[1], lty = 1, lwd = 1), axis.text = list(alpha = 1, cex = .8, col = can.col[1], font = 1, lineheight = 1), ## NEW: controls widths of tick marks and padding of labels axis.components = list(left = list(tck = 1, pad1 = 1, pad2 = 1), top = list(tck = 1, pad1 = 1, pad2 = 1), right = list(tck = 1, pad1 = 1, pad2 = 1), bottom = list(tck = 1, pad1 = 1, pad2 = 1)), ## NEW: controls widths of basic layout's components layout.heights = list(top.padding = 1, main = 1, main.key.padding = 1, key.top = 1, xlab.top = 1, key.axis.padding = 1, axis.top = 1, strip = 1, panel = 1, ## shouldn't be changed axis.panel = 1, ## can be useful between = 1, axis.bottom = 1, axis.xlab.padding = 1, xlab = 1, xlab.key.padding = 1, key.bottom = 1, key.sub.padding = 1, sub = 1, bottom.padding = 1), layout.widths = list(left.padding = 1, key.left = 1, key.ylab.padding = 1, ylab = 1, ylab.axis.padding = 1, axis.left = 1, axis.panel = 1, ## can be useful strip.left = 1, panel = 1, ## shouldn't be changed between = 1, axis.right = 1, axis.key.padding = 1, ylab.right = 1, key.right = 1, right.padding = 1), box.3d = list(alpha = 1, col = can.col[1], lty = 1, lwd = 1), par.title.text = list(alpha = 1, cex = 1.2, col = can.col[1], font = 1, lineheight = 1), # legend title (not used for key yet) par.xlab.text = list(alpha = 1, cex = 1, col = can.col[1], font = 1, lineheight = 1), par.ylab.text = list(alpha = 1, cex = 1, col = can.col[1], font = 1, lineheight = 1), par.zlab.text = list(alpha = 1, cex = 1, col = can.col[1], font = 1, lineheight = 1), par.main.text = list(alpha = 1, cex = 1.2, col = can.col[1], font = 2, lineheight = 1), par.sub.text = list(alpha = 1, cex = 1, col = can.col[1], font = 2, lineheight = 1)) if (color) { if (name == "postscript" || name == "pdf") { ans$plot.symbol$col <- can.col[6] ans$plot.line$col <- can.col[6] ans$dot.symbol$col <- can.col[6] ans$box.rectangle$col <- can.col[6] ans$box.umbrella$col <- can.col[6] ans$superpose.symbol$col <- c(can.col[c(6, 3, 4, 8)], "orange", "darkgreen", "brown") ans$superpose.symbol$col[c(3, 6)] <- ans$superpose.symbol$col[c(6, 3)] ans$superpose.line$col <- ans$superpose.symbol$col } } else { ## black and white settings ans$plot.polygon$col <- can.col[5] ### ans$box.dot$col <- can.col[1] ans$box.rectangle$col <- can.col[1] ans$box.umbrella$col <- can.col[1] ### ans$box.umbrella$lty <- 2 ans$dot.line$col <- can.col[4] ans$dot.symbol$col <- can.col[1] ### ans$dot.symbol$cex <- 0.85 ans$plot.line$col <- can.col[1] ans$plot.symbol$col <- can.col[1] ## changing this to be like barplot ## ans$regions$col <- gray(29:128/128) ans$regions$col <- grey(seq(0.3^2.2, 0.9^2.2, length.out = 100)^(1/2.2)) ans$shade.colors$palette <- function(irr, ref, height, w = .5) grey(w * irr + (1 - w) * (1 - (1-ref)^.4)) ### ans$reference.line$col <- can.col[4] ans$strip.background$col <- can.col[rep(5, 7)] ans$strip.shingle$col <- can.col[rep(6, 7)] ans$superpose.line$col <- can.col[rep(1, 7)] ans$superpose.line$lty <- 1:7 ans$superpose.symbol$col <- can.col[rep(1, 7)] ans$superpose.symbol$cex <- rep(0.7, 7) ans$superpose.symbol$pch <- c(1,3,6,0,5,16,17) ans$superpose.polygon$col <- grey( (c(6, 12, 7, 11, 8, 10, 9)/15)^.8 ) ##ans$superpose.symbol$pch <- c("o","+",">","s","w","#","{") } ans } ## trellis.par.grep <- ## function(pattern, ## theme = trellis.par.get(), ## ...) ## { ## nms <- names(theme) ## id <- grep(pattern, nms) ## ## if match, leave in return value, o.w. apply recursively ## if (length(id)) id <- -id ## id now non-matches ## for (nm in nms[id]) ## { ## print(nm) ## theme[[nm]] <- ## if (is.list(theme[[nm]])) ## trellis.par.grep(pattern, theme[[nm]], ...) ## else ## NULL ## } ## if (all(sapply(theme, is.null))) NULL else theme ## } trellis.par.get <- function(name = NULL) { ## the default device is opened if none already open if (is.null(dev.list())) trellis.device() lattice.theme <- get("lattice.theme", envir = .LatticeEnv) ## just in case settings for the current device haven't been ## created yet, which may happen if the device is opened by x11(), ## say, (i.e., not by trellis.device()) and no trellis object has ## been printed on this device yet. if (is.null(lattice.theme[[.Device]])) { trellis.device(device = .Device, new = FALSE) lattice.theme <- get("lattice.theme", envir = .LatticeEnv) } if (is.null(name)) lattice.theme[[.Device]] else if (name %in% names(lattice.theme[[.Device]])) lattice.theme[[.Device]][[name]] else NULL } trellis.par.set <- function(name, value, ..., theme, warn = TRUE, strict = FALSE) { ## the default device is opened if none already open if (is.null(dev.list())) { trellis.device() if (warn) warning("Note: The default device has been opened to honour attempt to modify trellis settings") } ## if (name %in% names(lattice.theme[[.Device]])) NEEDED as a safeguard ? ## if (!is.list(value)) stop("value must be a list") lattice.theme <- get("lattice.theme", envir = .LatticeEnv) ## make sure a list for this device is present if (is.null(lattice.theme[[.Device]])) { trellis.device(device = .Device, new = FALSE) lattice.theme <- get("lattice.theme", envir = .LatticeEnv) } ## WAS: lattice.theme[[.Device]][[name]] <- value if (missing(theme)) { if (!missing(value)) { theme <- list(value) names(theme) <- name } else if (!missing(name) && is.list(name)) { theme <- name } else theme <- list(...) } else { if (is.character(theme)) theme <- get(theme) if (is.function(theme)) theme <- theme() if (!is.list(theme)) { warning("Invalid 'theme' specified") theme <- NULL } } if (strict) { if (strict > 1L) lattice.theme[[.Device]] <- theme else lattice.theme[[.Device]][names(theme)] <- theme } else lattice.theme[[.Device]] <- updateList(lattice.theme[[.Device]], theme) assign("lattice.theme", lattice.theme, envir = .LatticeEnv) invisible() } trellis.device <- function(device = getOption("device"), color = !(dev.name == "postscript"), theme = lattice.getOption("default.theme"), new = TRUE, retain = FALSE, ...) { ## Get device function if (is.character(device)) { ## to make sure this works even if package grDevices is not attached if (new || is.null(dev.list())) { device.call <- try(get(device), silent = TRUE) if (inherits(device.call, "try-error")) device.call <- try(utils::getFromNamespace(device, "grDevices"), silent = TRUE) if (inherits(device.call, "try-error")) stop(gettextf("Could not find device function '%s'", device)) } dev.name <- device } else { device.call <- device dev.name <- deparse(substitute(device)) } ## Start the new device if necessary. ## new = FALSE ignored if no devices open. ## FIXME: remove this warning in some future version if ("bg" %in% names(list(...))) warning("'trellis.device' has changed, 'bg' may not be doing what you think it is") if (new || is.null(dev.list())) { device.call(...) lattice.setStatus(print.more = FALSE) } ## In the olden days, the defaults were device specific, and given ## by 'canonical.theme(name = .Device, color = color)'. From R ## 2.3.0, this was changed so that all (color) devices now have ## the same defaults, namely 'canonical.theme(name = "pdf", color ## = color)'. The old default can be reinstated by putting ## 'options(lattice.theme = "canonical.theme")' during startup, or ## 'lattice.options(default.theme = "canonical.theme")' after ## loading lattice. ## Update: From lattice 0.21, canonical.theme has been updated to ## use a HCL based color palette by default, and ## 'canonical.theme()' has been renamed to 'classic.theme()'. ## Make sure there's an entry for this device in the theme list lattice.theme <- get("lattice.theme", envir = .LatticeEnv) if (!(.Device %in% names(lattice.theme))) { lattice.theme[[.Device]] <- standard.theme(color = color) assign("lattice.theme", lattice.theme, envir = .LatticeEnv) } ## If retain = FALSE, overwrite with default settings for device if (!retain) trellis.par.set(standard.theme(color = color)) ## get theme as list if (!is.null(theme) && !is.list(theme)) { if (is.character(theme)) theme <- get(theme) if (is.function(theme)) theme <- theme() if (!is.list(theme)) { warning("Invalid 'theme' specified") theme <- NULL } } ## apply theme if (!is.null(theme)) trellis.par.set(theme) return(invisible()) } lset <- function(theme = col.whitebg()) { .Defunct("trellis.par.set") } show.settings <- function(x = NULL) { old.settings <- trellis.par.get() on.exit(trellis.par.set(old.settings)) if (!is.null(x)) trellis.par.set(x) theme <- trellis.par.get() d <- c("superpose.symbol", "superpose.line", "strip.background", "strip.shingle", "dot.[symbol, line]", "box.[dot, rectangle, umbrella]", "add.[line, text]", "reference.line", "plot.[symbol, line]", "plot.shingle[plot.polygon]", "histogram[plot.polygon]", "barchart[plot.polygon]", "superpose.polygon", "regions") d <- factor(d, levels = d) ## We only draw a border box for some panels. To do this, we make ## axis.line globally transparent, and then draw the border on a ## case-by-case basis. But to do that, we need to store the ## original axis.line settings. par.box <- trellis.par.get("axis.line") panel.box <- function() { panel.fill(col = "transparent", border = adjustcolor(par.box$col, par.box$alpha), lty = par.box$lty, lwd = par.box$lwd) } xyplot(d ~ d | d, prepanel = function(x, y) { list(ylim = c(0, 1), xlim = as.character(x), xat = 1) }, panel = function(x, y) { cpl <- current.panel.limits() # ylim = c(0, 1) rsx <- function(u) # (ReScaleX) map from [0,1] { cpl$xlim[1] + u * diff(cpl$xlim) } switch(as.character(x), "superpose.symbol" = { superpose.symbol <- trellis.par.get("superpose.symbol") len <- max(2, sapply(superpose.symbol, length)) panel.superpose(x = rep(rsx(ppoints(len)), len), y = rep(ppoints(len), each = len), groups = gl(len, len), subscripts = 1:(len*len)) }, "superpose.line" = { superpose.line <- trellis.par.get("superpose.line") len <- max(2, sapply(superpose.line, length)) panel.superpose(x = rep(rsx(c(0,1)), len), y = rep(ppoints(1:len), each = 2), groups = gl(len, 2), subscripts = 1:(2*len), type = "l") }, "strip.background" = { strip.background <- trellis.par.get("strip.background") strip.border <- trellis.par.get("strip.border") len <- max(2, sapply(strip.background, length), sapply(strip.border, length)) panel.rect(y = ppoints(len), height = 0.5 / len, xleft = cpl$xlim[1], xright = cpl$xlim[2], col = adjustcolor(strip.background$col, strip.background$alpha), border = strip.border$col, lty = strip.border$lty, lwd = strip.border$lwd) }, "strip.shingle" = { strip.shingle <- trellis.par.get("strip.shingle") len <- max(2, sapply(strip.shingle, length)) panel.rect(y = ppoints(len), height = 0.5 / len, xleft = cpl$xlim[1], xright = cpl$xlim[2], col = adjustcolor(strip.shingle$col, strip.shingle$alpha), border = "transparent") }, "dot.[symbol, line]" = { panel.dotplot(x = rsx(ppoints(5, a = 0)), y = ppoints(5, a = 0)) panel.box() }, "box.[dot, rectangle, umbrella]" = { panel.bwplot(x = rsx(ppoints(5)), y = rep(0.5, 5), box.width = 0.15) panel.box() }, "add.[line, text]" = { add.line <- trellis.par.get("add.line") xx <- seq(0.1, 0.9, length.out = 50) yy <- 0.5 + .45 * sin(0.1 + 11 * xx) panel.lines(x = rsx(xx), y = yy, col = add.line$col, lty = add.line$lty, lwd = add.line$lwd) panel.text(labels = c("Hello", "World"), x = rsx(c(.25, .75)), y = c(0.25, 0.75)) panel.box() }, "reference.line" = { panel.grid() panel.box() }, "plot.[symbol, line]" = { ## plot.symbol <- trellis.par.get("plot.symbol") ## plot.line <- trellis.par.get("plot.line") ## x <- seq(.1, .9, length.out = 20) ## y <- .9 * sin(.1+11*x) xx <- seq(0.1, 0.9, length.out = 20) yy <- 0.5 + .4 * sin(0.1 + 11 * xx) panel.xyplot(x = rsx(xx + 0.05), y = yy + 0.01, type = "l") panel.xyplot(x = rsx(xx - 0.05), y = yy - 0.01) panel.box() }, "plot.shingle[plot.polygon]" = { xx <- seq(0.1, 0.4, length.out = 5) yy <- ppoints(5) panel.barchart(x = rsx(xx + 0.5), y = yy, origin = rsx(xx), reference = FALSE, horizontal = TRUE, box.width = 1/10) panel.box() }, "histogram[plot.polygon]" = { xx <- ppoints(7, 0) panel.barchart(x = rsx(xx), y = (2:8)/9, horizontal = FALSE, origin = 1/18, box.width = diff(rsx(xx))[1], reference = FALSE) panel.box() }, "barchart[plot.polygon]" = { xx <- ppoints(6) panel.barchart(x = rev(rsx(xx)), y = xx, origin = cpl$xlim[1], box.width = 1/12) panel.box() }, "superpose.polygon" = { superpose.polygon <- trellis.par.get("superpose.polygon") len <- max(2, sapply(superpose.polygon, length)) xx <- ppoints(len) panel.barchart(x = rsx(rev(xx)), y = rep(0.5, len), groups = gl(len, 1), subscripts = seq_len(len), stack = FALSE, box.width = 0.9) panel.box() }, "regions" = { panel.levelplot(x = do.breaks(cpl$xlim, 98), y = rep(0.5, 99), z = 1:99 + 0.5, at = 1:100, region = TRUE, subscripts = 1:99) panel.box() }) }, ## layout = c(4, 4), par.settings = modifyList(theme, list(axis.line = list(col = "transparent"), clip = list(panel = "off"))), as.table = TRUE, strip = FALSE, xlab = "", ylab = "", between = list(x = 1, y = 0.5), scales = list(relation = "free", y = list(draw = FALSE, axs = "i"), x = list(tck = 0, axs = "r"))) } ## show.settings.old <- function(x = NULL) ## { ## old.settings <- trellis.par.get() ## on.exit(trellis.par.set(old.settings)) ## if (!is.null(x)) trellis.par.set(x) ## theme <- trellis.par.get() ## n.row <- 13 ## n.col <- 9 ## heights.x <- rep(1, n.row) ## heights.units <- rep("lines", n.row) ## heights.units[c(2, 5, 8, 11)] <- "null" ## widths.x <- rep(1, n.row) ## widths.units <- rep("lines", n.row) ## widths.units[c(2, 4, 6, 8)] <- "null" ## page.layout <- ## grid.layout(nrow = n.row, ncol = n.col, ## widths = unit(widths.x, widths.units), ## heights = unit(heights.x, heights.units)) ## if (!lattice.getStatus("print.more")) grid.newpage() ## lattice.setStatus(print.more = FALSE) ## grid.rect(gp = gpar(fill = theme$background$col, ## col = "transparent")) ## pushViewport(viewport(layout = page.layout, ## gp = gpar(fontsize = theme$fontsize$text))) ## gp.box <- ## gpar(col = theme$axis.line$col, ## lty = theme$axis.line$lty, ## lwd = theme$axis.line$lwd, ## alpha = theme$axis.line$alpha, ## fill = "transparent") ## ## superpose.symbol ## superpose.symbol <- theme$superpose.symbol ## len <- max(2, sapply(superpose.symbol, length)) ## pushViewport(viewport(layout.pos.row = 2, ## layout.pos.col = 2, ## yscale = c(0,len+1), ## xscale = c(0,len+1))) ## panel.superpose(x = rep(1:len, len), ## y = rep(1:len, each = len), ## groups = gl(len, len), ## subscripts = 1:(len*len)) ## popViewport() ## grid.text(label = "superpose.symbol", ## vp = viewport(layout.pos.row = 3, layout.pos.col = 2)) ## ## superpose.line ## superpose.line <- theme$superpose.line ## len <- max(2, sapply(superpose.line, length)) ## pushViewport(viewport(layout.pos.row = 2, ## layout.pos.col = 4, ## yscale = c(0,len+1), ## xscale = c(0, 1))) ## panel.superpose(x = rep(c(0,1), len), ## y = rep(1:len, each = 2), ## groups = gl(len, 2), ## subscripts = 1:(2*len), ## type = "l") ## popViewport() ## grid.text(label = "superpose.line", ## vp = viewport(layout.pos.row = 3, layout.pos.col = 4)) ## ## strip.background ## strip.background <- theme$strip.background ## strip.border <- theme$strip.border ## len <- ## max(sapply(strip.background, length), ## sapply(strip.border, length)) ## pushViewport(viewport(layout.pos.row = 2, ## layout.pos.col = 6, ## yscale = c(0, len+1), ## xscale = c(0, 1))) ## grid.rect(y = unit(1:len, "native"), ## height = unit(0.5, "native"), ## gp = ## gpar(fill = strip.background$col, ## alpha = strip.background$alpha, ## col = strip.border$col, ## lty = strip.border$lty, ## lwd = strip.border$lwd)) ## popViewport() ## grid.text(label = "strip.background", ## vp = viewport(layout.pos.row = 3, layout.pos.col = 6)) ## ## strip.shingle ## strip.shingle <- theme$strip.shingle ## len <- max(sapply(strip.shingle, length)) ## pushViewport(viewport(layout.pos.row = 2, ## layout.pos.col = 8, ## yscale = c(0,len+1), ## xscale = c(0,1))) ## grid.rect(y = unit(1:len, "native"), ## height = unit(0.5, "native"), ## gp = ## gpar(fill = strip.shingle$col, ## alpha = strip.shingle$alpha, ## col = "transparent", lwd = 0.0001)) ## popViewport() ## grid.text(label = "strip.shingle", ## vp = viewport(layout.pos.row = 3, layout.pos.col = 8)) ## ## dot.[symbol, line] ## pushViewport(viewport(layout.pos.row = 5, ## layout.pos.col = 2, ## yscale = extend.limits(c(0,6)), ## xscale = c(0,6))) ## panel.dotplot(x = 1:5, y = 1:5) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "dot.[symbol, line]", ## vp = viewport(layout.pos.row = 6, layout.pos.col = 2)) ## ## box.[dot, rectangle, umbrella] ## pushViewport(viewport(layout.pos.row = 5, ## layout.pos.col = 4, ## yscale = c(-2, 2), ## xscale = c(0,6))) ## panel.bwplot(x = 1:5, y = rep(0, 5)) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "box.[dot, rectangle, umbrella]", ## vp = viewport(layout.pos.row = 6, layout.pos.col = 4)) ## ## add.[line, text] ## add.text <- theme$add.text ## add.line <- theme$add.line ## pushViewport(viewport(layout.pos.row = 5, ## layout.pos.col = 6, ## yscale = c(-1,1), ## xscale = c(0,1))) ## x <- seq(.1, .9, length.out = 50) ## y <- .9 * sin(.1+11*x) ## llines(x = x, y = y, type = "l", col = add.line$col, ## lty = add.line$lty, lwd = add.line$lwd) ## ltext(labels = c("Hello", "World"), ## x = c(.25, .75), y = c(-.5, .5)) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "add.[line, text]", ## vp = viewport(layout.pos.row = 6, layout.pos.col = 6)) ## ## reference.line ## pushViewport(viewport(layout.pos.row = 5, ## layout.pos.col = 8, ## yscale = c(0,4), ## xscale = c(0,4))) ## panel.grid() ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "reference.line", ## vp = viewport(layout.pos.row = 6, layout.pos.col = 8)) ## ## plot.[symbol, line] ## plot.symbol <- theme$plot.symbol ## plot.line <- theme$plot.line ## pushViewport(viewport(layout.pos.row = 8, ## layout.pos.col = 2, ## yscale = c(-1.1,1.1), ## xscale = c(-.1,1.1))) ## x <- seq(.1, .9, length.out = 20) ## y <- .9 * sin(.1+11*x) ## panel.xyplot(x = x+.05, y = y+.1, type = "l") ## panel.xyplot(x = x-.05, y = y-.1) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "plot.[symbol, line]", ## vp = viewport(layout.pos.row = 9, layout.pos.col = 2)) ## ## plot.shingle[plot.polygon] ## plot.polygon <- theme$plot.polygon ## pushViewport(viewport(layout.pos.row = 8, ## layout.pos.col = 4, ## yscale = extend.limits(c(0,6)), ## xscale = extend.limits(c(1,10)))) ## grid.rect(x = c(3.5, 4.5, 5.5, 6.5, 7.5), width = rep(5,5), ## y = c(1,2,3,4,5), height = rep(.5, ,5), ## default.units = "native", ## gp = ## gpar(fill = plot.polygon$col, ## col = plot.polygon$border, ## alpha = plot.polygon$alpha, ## lty = plot.polygon$lty, ## lwd = plot.polygon$lwd)) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "plot.shingle[plot.polygon]", ## vp = viewport(layout.pos.row = 9, layout.pos.col = 4)) ## ## histogram[plot.polygon] ## pushViewport(viewport(layout.pos.row = 8, ## layout.pos.col = 6, ## yscale = extend.limits(c(0,7)), ## xscale = extend.limits(c(0.5,7.5)))) ## panel.histogram(x = rep(1:7, 1:7), breaks = 0:7 + 0.5, type = "count") ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "histogram[plot.polygon]", ## vp = viewport(layout.pos.row = 9, layout.pos.col = 6)) ## ## barchart[plot.polygon] ## pushViewport(viewport(layout.pos.row = 8, ## layout.pos.col = 8, ## yscale = extend.limits(c(0.5,6.5)), ## xscale = c(-1,7))) ## panel.barchart(x = 6:1, y = 1:6) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "barchart[plot.polygon]", ## vp = viewport(layout.pos.row = 9, layout.pos.col = 8)) ## ## superpose.polygon ## superpose.polygon <- trellis.par.get("superpose.polygon") ## len <- max(2, sapply(superpose.polygon, length)) ## pushViewport(viewport(layout.pos.row = 11, ## layout.pos.col = 2, ## yscale = extend.limits(c(-.45, .45)), ## xscale = c(-1, len+1))) ## panel.barchart(x = len:1, y = rep(0, len), ## groups = gl(len, 1), ## subscripts = 1:len, ## stack = FALSE) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "superpose.polygon", ## vp = viewport(layout.pos.row = 12, layout.pos.col = 2)) ## ## regions ## regions <- theme$regions ## len <- length(regions$col) ## pushViewport(viewport(layout.pos.row = 11, ## layout.pos.col = 4, ## xscale = c(0,len+1))) ## grid.rect(x = 1:len, width = 1, ## default.units = "native", ## gp = ## gpar(col = "transparent", ## fill = regions$col, ## alpha = regions$alpha)) ## grid.rect(gp = gp.box) ## popViewport() ## grid.text(label = "regions", ## vp = viewport(layout.pos.row = 12, layout.pos.col = 4)) ## invisible() ## } ## non-graphical options and layout defaults (in terms of grid units) lattice.getOption <- function(name) { get("lattice.options", envir = .LatticeEnv)[[name]] } ## FIXME: lattice.options(foo == 1) doesn't work? lattice.options <- function(...) { ## this would have been really simple if only forms allowed were ## lattice.options("foo", "bar") and ## lattice.options(foo=1, bar=2). But it could also be ## lattice.options(foo=1, "bar"), which makes some juggling necessary new <- list(...) if (is.null(names(new)) && length(new) == 1 && is.list(new[[1]])) new <- new[[1]] old <- .LatticeEnv$lattice.options ## any reason to prefer get("lattice.options", envir = .LatticeEnv)? ## if no args supplied, returns full options list if (length(new) == 0) return(old) nm <- names(new) if (is.null(nm)) return(old[unlist(new)]) ## typically getting options, not setting isNamed <- nm != "" ## typically all named when setting, but could have mix if (any(!isNamed)) nm[!isNamed] <- unlist(new[!isNamed]) ## so now everything has non-"" names, but only the isNamed ones should be set ## everything should be returned, however retVal <- old[nm] names(retVal) <- nm nm <- nm[isNamed] ## this used to be ## modified <- updateList(retVal[nm], new[nm]) ## .LatticeEnv$lattice.options[names(modified)] <- modified ## but then calling lattice.options(foo = NULL) had no effect ## because foo would be missing from modified. So, we now do: .LatticeEnv$lattice.options <- updateList(old, new[nm]) ## return changed entries invisibly invisible(retVal) } .defaultLatticeOptions <- function() list(save.object = TRUE, panel.error = "panel.error", drop.unused.levels = list(cond = TRUE, data = TRUE), default.theme = getOption("lattice.theme"), ## for back compatibility, usually NULL legend.bbox = "panel", ## for key$space = "inside" banking = banking, histogram.breaks = NULL, default.args = list(as.table = FALSE, aspect = "fill", auto.key = FALSE, between = list(x=0, y=0), grid = FALSE, ##page = NULL, ##main = NULL, ##sub = NULL, ##par.strip.text = NULL, ##layout = NULL, skip = FALSE, strip = strip.default, xscale.components = xscale.components.default, yscale.components = yscale.components.default, axis = axis.default), ## extends limits by this amount, to provide padding for ## numeric and factor scales respectively. Note that the ## value for numeric is multiplicative, while factor is ## additive axis.padding = list(numeric = 0.07, factor = 0.6), ## ticks too close to the limits will not be drawn unless ## explicitly requested. Limits will be contracted by this ## proportion, and anything outside will be skipped. skip.boundary.labels = 0.02, ## separator for interaction when generating artificial ## factor (see 'allow.multiple' argument in ?xyplot) interaction.sep = " * ", ## default panel functions panel.contourplot = "panel.contourplot", panel.levelplot = "panel.levelplot", panel.levelplot.raster = "panel.levelplot.raster", panel.parallel = "panel.parallel", panel.densityplot = "panel.densityplot", panel.splom = "panel.splom", panel.wireframe = "panel.wireframe", panel.dotplot = "panel.dotplot", panel.qq = "panel.qq", panel.stripplot = "panel.stripplot", panel.xyplot = "panel.xyplot", panel.qqmath = "panel.qqmath", panel.barchart = "panel.barchart", panel.bwplot = "panel.bwplot", panel.histogram = "panel.histogram", panel.cloud = "panel.cloud", panel.pairs = "panel.pairs", ## default prepanel functions prepanel.default.bwplot = "prepanel.default.bwplot", prepanel.default.cloud = "prepanel.default.cloud", prepanel.default.densityplot = "prepanel.default.densityplot", prepanel.default.histogram = "prepanel.default.histogram", prepanel.default.levelplot = "prepanel.default.levelplot", prepanel.default.parallel = "prepanel.default.parallel", prepanel.default.qq = "prepanel.default.qq", prepanel.default.qqmath = "prepanel.default.qqmath", prepanel.default.splom = "prepanel.default.splom", prepanel.default.xyplot = "prepanel.default.xyplot", prepanel.default.dotplot = "prepanel.default.bwplot", prepanel.default.barchart = "prepanel.default.bwplot", prepanel.default.wireframe = "prepanel.default.cloud", prepanel.default.contourplot = "prepanel.default.levelplot", ## Complicated grid unit calculations can be slow. Sometimes ## these can be optimized at the cost of potential loss of ## accuracy. This option controls whether such optimization ## should be applied. ## Currently, the only situation where this applies is for ## relation != free (which can be slow for multi-page output ## because the same calculations involving the height of ## multiple strings are repeated). Optimizing converts into ## absolute units, which may give wrong results when the plot ## is replayed on a different device. optimize.grid = FALSE, ## Axis units. Rather than messing with these, end-users ## should manipulate corresponding settings via ## trellis.par.set() axis.units = list(outer = list(left = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), top = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), right = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), bottom = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm"))), inner = list(left = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), top = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), right = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")), bottom = list(tick = list(x = 2, units = "mm"), pad1 = list(x = 2, units = "mm"), pad2 = list(x = 2, units = "mm")))), ## axis.units = ## list(outer = ## list(left = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## top = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## right = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## bottom = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc"))), ## inner = ## list(left = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## top = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## right = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")), ## bottom = ## list(tick = list(x = 0.01, units = "snpc"), ## pad1 = list(x = 0.01, units = "snpc"), ## pad2 = list(x = 0.01, units = "snpc")))), layout.heights = ## list(top.padding = list(x = 2, units = "mm", data = NULL), ## main = list(x = 0, units = "grobheight", data = textGrob(label="")), ## main.key.padding = list(x = 2, units = "mm", data = NULL), ## key.top = list(x = 0, units = "grobheight", data = textGrob(label="")), ## key.axis.padding = list(x = 2, units = "mm", data = NULL), ## axis.top = list(x = 0, units = "mm", data = NULL), ## strip = list(x = 1, units = "lines", data = NULL), ## panel = list(x = 1, units = "null", data = NULL), ## axis.panel = list(x = 0, units = "mm", data = NULL), ## between = list(x = 5, units = "mm", data = NULL), ## axis.bottom = list(x = 0, units = "mm", data = NULL), ## axis.xlab.padding = list(x = 2, units = "mm", data = NULL), ## xlab = list(x = 0, units = "grobheight", data = textGrob(label="")), ## xlab.key.padding = list(x = 2, units = "mm", data = NULL), ## key.bottom = list(x = 0, units = "grobheight", data = textGrob(label="")), ## key.sub.padding = list(x = 2, units = "mm", data = NULL), ## sub = list(x = 0, units = "grobheight", data = textGrob(label="")), ## bottom.padding = list(x = 2, units = "mm", data = NULL)), ## layout.widths = ## list(left.padding = list(x = 2, units = "mm", data = NULL), ## key.left = list(x = 0, units = "grobwidth", data = textGrob(label="")), ## key.ylab.padding = list(x = 2, units = "mm", data = NULL), ## ## changed in 2.1.0 ## ylab = list(x = 0, units = "grobwidth", data = textGrob(label="")), ## ylab.axis.padding = list(x = 2, units = "mm", data = NULL), ## axis.left = list(x = 0, units = "mm", data = NULL), ## axis.panel = list(x = 0, units = "mm", data = NULL), ## panel = list(x = 1, units = "null", data = NULL), ## between = list(x = 5, units = "mm", data = NULL), ## axis.right = list(x = 0, units = "mm", data = NULL), ## axis.key.padding = list(x = 2, units = "mm", data = NULL), ## key.right = list(x = 0, units = "grobwidth", data = textGrob(label="")), ## right.padding = list(x = 2, units = "mm", data = NULL)), list(top.padding = list(x = 0.01, units = "snpc", data = NULL), main = list(x = 0, units = "grobheight", data = textGrob(label="")), main.key.padding = list(x = 0.01, units = "snpc", data = NULL), key.top = list(x = 0, units = "grobheight", data = textGrob(label="")), xlab.top = list(x = 0, units = "grobheight", data = textGrob(label="")), key.axis.padding = list(x = 0.01, units = "snpc", data = NULL), axis.top = list(x = 0, units = "mm", data = NULL), strip = list(x = 1, units = "lines", data = NULL), panel = list(x = 1, units = "null", data = NULL), axis.panel = list(x = 0, units = "mm", data = NULL), between = list(x = 5, units = "mm", data = NULL), axis.bottom = list(x = 0, units = "mm", data = NULL), axis.xlab.padding = list(x = 0.01, units = "snpc", data = NULL), xlab = list(x = 0, units = "grobheight", data = textGrob(label="")), xlab.key.padding = list(x = 0.01, units = "snpc", data = NULL), key.bottom = list(x = 0, units = "grobheight", data = textGrob(label="")), key.sub.padding = list(x = 0.01, units = "snpc", data = NULL), sub = list(x = 0, units = "grobheight", data = textGrob(label="")), bottom.padding = list(x = 0.01, units = "snpc", data = NULL)), layout.widths = list(left.padding = list(x = 0.01, units = "snpc", data = NULL), key.left = list(x = 0, units = "grobwidth", data = textGrob(label="")), key.ylab.padding = list(x = 0.01, units = "snpc", data = NULL), ylab = list(x = 0, units = "grobwidth", data = textGrob(label="")), ylab.axis.padding = list(x = 0.01, units = "snpc", data = NULL), axis.left = list(x = 0, units = "mm", data = NULL), axis.panel = list(x = 0, units = "mm", data = NULL), strip.left = list(x = 1, units = "lines", data = NULL), panel = list(x = 1, units = "null", data = NULL), between = list(x = 5, units = "mm", data = NULL), axis.right = list(x = 0, units = "mm", data = NULL), axis.key.padding = list(x = 0.01, units = "snpc", data = NULL), ylab.right = list(x = 0, units = "grobwidth", data = textGrob(label="")), key.right = list(x = 0, units = "grobwidth", data = textGrob(label="")), right.padding = list(x = 0.01, units = "snpc", data = NULL)), highlight.gpar = list(col = "red", lwd = 2, fill = "transparent") ) ## Interface to internal storage for use by plot.trellis, ## trellis.focus, etc. The optional argument prefix allows one level ## of nesting for storing plot-specific settings (for example, ## multiple plots in a page, or the panel function of one plot calling ## plot.trellis() again). lattice.getStatus <- function(name, prefix = NULL) { if (is.null(prefix)) get("lattice.status", envir = .LatticeEnv)[[name]] else get("lattice.status", envir = .LatticeEnv)[[prefix]][[name]] } lattice.setStatus <- function (..., prefix = NULL, clean.first = FALSE) { ## if clean.first = TRUE, remove previously existing things. This ## is done whenever a new page is started, as otherwise crud from ## previous calls may keep piling up. dots <- list(...) if (is.null(names(dots)) && length(dots) == 1 && is.list(dots[[1]])) dots <- dots[[1]] if (length(dots) == 0) return() lattice.status <- if (clean.first) list() else get("lattice.status", envir = .LatticeEnv) if (is.null(prefix)) lattice.status[names(dots)] <- dots else lattice.status[[prefix]][names(dots)] <- dots assign("lattice.status", lattice.status, envir = .LatticeEnv) invisible() } .defaultLatticeStatus <- function() list(print.more = FALSE, plot.index = 1) ## keeps track of multiple plots in a page .defaultLatticePrefixStatus <- function() list(current.plot.saved = FALSE, current.plot.multipage = FALSE, current.focus.row = 0, current.focus.column = 0, vp.highlighted = FALSE) ## keeps track of multiple plots in a page simpleTheme <- function(col, alpha, cex, pch, lty, lwd, font, fill, border, col.points, col.line, alpha.points, alpha.line) { ans <- list(plot.symbol = list(), plot.line = list(), plot.polygon = list(), superpose.symbol = list(), superpose.line = list(), superpose.polygon = list()) setValue <- function(value, name, targets) { for (t in targets) ans[[t]][[name]] <<- value } if (!missing(col)) setValue(col, "col", 1:6) if (!missing(alpha)) setValue(alpha, "alpha", 1:6) if (!missing(cex)) setValue(cex, "cex", c(1, 4)) if (!missing(pch)) setValue(pch, "pch", c(1, 4)) if (!missing(lty)) setValue(lty, "lty", 1:6) if (!missing(lwd)) setValue(lwd, "lwd", 1:6) if (!missing(font)) setValue(font, "font", c(1, 4)) if (!missing(fill)) setValue(fill, "fill", c(1, 3, 4, 6)) if (!missing(border)) setValue(border, "border", c(3, 6)) if (!missing(col.points)) setValue(col.points, "col", c(1, 4)) if (!missing(col.line)) setValue(col.line, "col", c(2, 5)) if (!missing(alpha.points)) setValue(alpha.points, "alpha", c(1, 4)) if (!missing(alpha.line)) setValue(alpha.line, "alpha", c(2, 5)) ## ensure first three only have scalars for (nm in c("plot.symbol", "plot.line", "plot.polygon")) ans[[nm]] <- lapply(ans[[nm]], head, 1) ans } lattice/R/common.R0000644000176200001440000006342213070415115013517 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### Copyright (C) 2001-2005 Saikat DebRoy ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA prepanel.null <- function() { list(xlim = rep(NA_real_, 2), ylim = rep(NA_real_, 2), dx = NA_real_, dy = NA_real_) } cupdate <- function(index, maxim) { ## This unexported function is used to handle arbitrary number of ## conditioning variables : every time it is called, it increments ## the "current" level of the conditioning variables suitably, ## i.e., it tries to increment the level of the 1st conditining ## variable (the one which varies fastest along panel order) and ## if it happens to be at its maximum (last) value, it sets it to ## the first value AND increments the "current" level of the 2nd ## (next) conditioning variable recursively. if(length(index)!=length(maxim)||length(maxim)<=0) stop("Inappropriate arguments") index[1] <- index[1] + 1 if (index[1] > maxim[1] && length(maxim) > 1) c(1, cupdate(index[-1], maxim[-1])) else index } ## a function similar to (but with much less bells and whistles than) ## interaction, with exactly 2 factors, and levels ordered like that ## in f:g (the point is to have a 'sep' argument). Solely intended ## for use below in latticeParseFormula interaction2 <- function (f, g, sep = ":") { ans <- f:g levels(ans) <- as.vector(t(outer(levels(f), levels(g), paste, sep = sep))) ans } latticeParseFormula <- function(model, data, dimension = 2, subset = TRUE, groups = NULL, multiple = FALSE, outer = FALSE, subscripts = FALSE, drop = NULL) ## this function mostly written by Saikat { ## local function to get length 1 name from expressions (deparse ## can split long expressions into several pieces), typically for ## subsequent use as labels. Could be either of the following: expr2char <- function(x) paste(deparse(x), collapse = "") ## expr2char <- function(x) deparse(x)[1] ## by this time, groups is usually already evaluated. To make ## things slightly more convenient, we will now also allow groups ## to be of the form groups = ~g, in which case g will be ## evaluated now if (inherits(groups, "formula")) { groupVar <- as.character(groups)[2] groups <- eval(parse(text = groupVar), data, environment(groups)) } if (is.null(drop)) drop <- TRUE if (is.list(drop)) { drop.unused.cond <- if (is.null(drop$cond)) TRUE else drop$cond drop.unused.data <- if (is.null(drop$data)) TRUE else drop$data } else { drop.unused.cond <- drop drop.unused.data <- drop } parseSide <- function(model) { model.vars <- list() while (length(model) == 3 && model[[1]] == as.name("+")) { model.vars <- c(model.vars, model[[3]]) model <- model[[2]] } rev(c(model.vars, model)) } parseCond <- function(model) { ## WAS: model <- eval(parse(text = paste("~", deparse(model))))[[2]] ## but that's not good (PR#7395) model <- substitute(~m, list(m = model))[[2]] model.vars <- list() while (length(model) == 3 && (model[[1]] == as.name("*") || model[[1]] == as.name("+"))) { model.vars <- c(model.vars, model[[3]]) model <- model[[2]] } rev(c(model.vars, model)) } lrep <- function(x, n) { save.attr <- attributes(x) x <- rep(x, n) attributes(x) <- save.attr x } concat <- function(arglist) { if (length(arglist) == 1) arglist[[1]] else if (any(sapply(arglist, is.factor))) { factor(unlist(lapply(arglist, as.character))) } else if (any(sapply(arglist, is.shingle))) { stop("shingles can not be concatenated") } else do.call("c", arglist) } if (!inherits(model, "formula")) stop("model must be a formula object") if (multiple && !outer && !is.null(groups)) { ## ignore multiple = TRUE multiple <- FALSE warning("'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')") } ans <- if (dimension == 2) { list(left = NULL, right = NULL, condition = NULL, left.name = character(0), right.name = character(0)) } else if (dimension == 3) { list(left = NULL, right.x = NULL, right.y = NULL, condition = NULL, left.name = character(0), right.x.name = character(0), right.y.name = character(0)) } else stop(gettextf("invalid dimension '%s'", as.character(dimension))) if (length(model) == 3) { ## ~ if (multiple) { varsLHS <- parseSide(model[[2]]) nLHS <- length(varsLHS) } else { varsLHS <- list(model[[2]]) nLHS <- 1 } } else { ## ~ nLHS <- 1 } modelRHS <- model[[length(model)]] if (length(modelRHS) == 3 && modelRHS[[1]] == as.name("|")) modelRHS <- modelRHS[[2]] ## Note that when dimension = 3, multiple does not apply to RHS env <- environment(model) modelRHS <- model[[length(model)]] if (length(modelRHS) == 3 && modelRHS[[1]] == as.name("|")) { modelRHS.vars <- parseCond(modelRHS[[3]]) modelRHS <- modelRHS[[2]] if (multiple && dimension == 2) { varsRHS <- parseSide(modelRHS) nRHS <- length(varsRHS) } else { varsRHS <- list(modelRHS) nRHS <- 1 } ans$condition <- vector("list", length(modelRHS.vars)) names(ans$condition) <- sapply(modelRHS.vars, expr2char) for (i in seq_along(modelRHS.vars)) { ans$condition[[i]] <- lrep(as.factorOrShingle(eval(modelRHS.vars[[i]], data, env), subset, drop = drop.unused.cond), nLHS * nRHS) } } else if (multiple && dimension == 2) { varsRHS <- parseSide(modelRHS) nRHS <- length(varsRHS) } else { varsRHS <- list(modelRHS) nRHS <- 1 } if (length(model) == 3) { ## Note: special case if tmp is a matrix. This probably means ## we are dealing with the parametric 3-D surface rendering ## option in wireframe. subset will be ignored in that case. ## allow.multiple must be effectively FALSE in that case ans$left.name <- expr2char(model[[2]]) ans$left <- lrep(concat(lapply(varsLHS, function(i) { tmp <- eval(i, data, env) if (!is.matrix(tmp)) tmp <- if (is.factor(tmp) || is.shingle(tmp)) tmp[subset, drop = drop.unused.data] else tmp[subset] if (inherits(tmp, "POSIXt")) tmp <- as.POSIXct(tmp) tmp })), nRHS) } if (dimension == 2) { ## this part belongs in the first if block, but we need nobs ## later in either case, so keeping it here. tmp <- eval(varsRHS[[1]], data, env) if (is.matrix(tmp)) tmp <- as.data.frame(tmp) ### This was a attempted new feature that turned out not to be such a ### good idea. It would change '~x | a' to 'rownames(data) ~ x | a', ### which is good for dot plot, but not good for bwplot. So, back to ### old behaviour... ## else if (length(model) == 2 && is.data.frame(data) && ## (is.vector(tmp, "numeric") || is.factor(tmp)) && ## is.null(names(tmp))) ## { ## names(tmp) <- rownames(data) # for dotplot(~x, data) ## } nobs <- if (is.data.frame(tmp)) nrow(tmp) else length(tmp) if (nLHS == 1 && nRHS == 1) { if (is.data.frame(tmp)) ans$right <- tmp[subset, ] ## doesn't do the drop=TRUE thing for factors/shingles else ans$right <- if (is.factor(tmp) || is.shingle(tmp)) tmp[subset, drop = drop.unused.data] else tmp[subset] } else { ans$right <- concat(lapply(varsRHS, function(i) { tmp <- eval(i, data, env) tmp <- if (is.factor(tmp) || is.shingle(tmp)) tmp[subset, drop = drop.unused.data] else tmp[subset] tmp <- lrep(tmp, nLHS) if (inherits(tmp, "POSIXt")) tmp <- as.POSIXct(tmp) tmp })) } ans$right.name <- expr2char(modelRHS) nRows <- length(ans$right)/(nLHS * nRHS) } else if (dimension == 3 && length(modelRHS) == 3 && (modelRHS[[1]] == "*" || modelRHS[[1]] == "+")) { ## Note that when dimension = 3, multiple does not apply to ## RHS, but nLHS may be > 1 ## Note: special case if tmp is a matrix. This probably means ## we are dealing with the parametric 3-D surface rendering ## option in wireframe. subset will be ignored in that case ## allow.multiple must be effectively FALSE in that case tmp <- eval(modelRHS[[2]], data, env) nobs <- length(tmp) if (!is.matrix(tmp)) ## see note above tmp <- if (is.factor(tmp) || is.shingle(tmp)) tmp[subset, drop = drop.unused.data] else tmp[subset] ans$right.x <- lrep(tmp, nLHS) if (inherits(ans$right.x, "POSIXt")) ans$right.x <- as.POSIXct(ans$right.x) tmp <- eval(modelRHS[[3]], data, env) if (!is.matrix(tmp)) ## see note above tmp <- if (is.factor(tmp) || is.shingle(tmp)) tmp[subset, drop = drop.unused.data] else tmp[subset] ans$right.y <- lrep(tmp, nLHS) if (inherits(ans$right.y, "POSIXt")) ans$right.y <- as.POSIXct(ans$right.y) ans$right.x.name <- expr2char(modelRHS[[2]]) ans$right.y.name <- expr2char(modelRHS[[3]]) nRows <- length(ans$right.x)/nLHS } else stop("invalid model") if (nLHS > 1) LHSgroups <- rep(gl(nLHS, nRows, labels = sapply(varsLHS, expr2char)), nRHS) if (nRHS > 1) RHSgroups <- gl(nRHS, nRows*nLHS, labels = sapply(varsRHS, expr2char)) newFactor <- if (nLHS > 1 && nRHS > 1) { interaction2(LHSgroups, RHSgroups, sep = lattice.getOption("interaction.sep")) ## WAS: factor(paste(LHSgroups, RHSgroups, sep=" * ")) } else if (nLHS > 1) LHSgroups else if (nRHS > 1) RHSgroups else NULL if (nLHS == 1 && nRHS == 1) { ## subscripts is supposed to provide indices to rows in the ## original data frame. When both nLHS and nRHS are 1, this is ## simple --- it's seq(length = length of variables)[subset] ## (note that groups is never subsetted, so groups[subscripts] ## matches subsetted data, indeed, that's how 'groups' is used ## in panel functions. if (!is.null(groups)) ans$groups <- groups if (subscripts) ans$subscr <- seq_len(nobs)[subset] } else if (outer) { if (!is.null(groups)) ans$groups <- rep(groups, nLHS * nRHS) if (!is.null(newFactor)) { if (is.null(ans$condition)) ans$condition <- list(newFactor) else ans$condition[[length(ans$condition) + 1]] <- newFactor } else stop("newFactor cannot be NULL; you have found a bug!") ## note that groups[subscripts] must match rest of (subsetted) ## data. This matters when groups is non-null and is repeated ## nLHS * nRHS times. It doesn't matter otherwise, but doing ## it this way doesn't cause any trouble either. So there. if (subscripts) ans$subscr <- as.vector(matrix(seq_len(nobs * nLHS * nRHS), nrow = nobs)[subset, ]) } else { ## that is, nLHS * nRHS > 1, outer = FALSE if (is.null(groups) && !is.null(newFactor)) ans$groups <- newFactor else stop("newFactor != NULL && groups == NULL does not hold; you have found a bug!") ## In this case, groups is something generated artificially, ## and is always exactly as long as the rest of the subsetted ## variables. So subscr has to be a simple seq, as long as the ## new groups. if (subscripts) ans$subscr <- seq_len(length(newFactor)) ## check if (length(newFactor) != nRows * nLHS * nRHS) stop("Length check mismatch; you have found a bug!") } ans } banking <- function(dx, dy = 1) { if (is.list(dx)) { dy <- dx[[2]] dx <- dx[[1]] } if (length(dx)!=length(dy)) stop("Non matching lengths") id <- dx!=0 & dy!=0 & !is.na(dx) & !is.na(dy) if (any(id)) { r <- abs(dx[id]/dy[id]) median(r) } else 1 } ## method in Visualizing Data: needs x-range and y-range as well. Not ## sure what the best way to extend the API is; for now, we will just ## define (but not export) an implementation weighted.banking <- function(dx, dy = 1, xrange = sum(dx), yrange = sum(dy)) { if (is.list(dx)) { if (is.null(names(dx))) names(dx) <- c("dx", "dy") dy <- abs(dx[["dy"]]) dx <- abs(dx[["dx"]]) } if (length(dx)!=length(dy)) stop("Non matching lengths") id <- dx!=0 & dy!=0 & !is.na(dx) & !is.na(dy) if (any(id)) { ndx <- dx / xrange ndy <- dy / yrange obj <- function(a) { sum(atan(a * ndy / ndx) * sqrt(ndx^2 + a^2 * ndy^2) ) / sum(sqrt(ndx^2 + a^2 * ndy^2)) - base::pi / 4 } ## r <- abs(dx[id]/dy[id]) ## median(r) ## transform to have arg between 0 and 1 objtan <- function(x) obj(tan(base::pi * x / 2)) u <- uniroot(f = objtan, lower = 0.01, upper = 0.99) aspect.ratio <- tan(base::pi * u$root / 2) aspect.ratio * xrange / yrange } else 1 } extend.limits <- function(lim, length = 1, axs = "r", prop = if (axs == "i") 0 else lattice.getOption("axis.padding")$numeric) { ## if (!is.numeric(lim)) NA if (all(is.na(lim))) NA_real_ # or lim? else if (is.character(lim) ) { c(1, length(lim)) + c(-1, 1) * if (axs == "i") 0.5 else lattice.getOption("axis.padding")$factor } else if (length(lim) == 2) { if (lim[1] > lim[2]) { ccall <- match.call() ccall$lim <- rev(lim) ans <- eval.parent(ccall) return (rev(ans)) } if (!missing(length) && !missing(prop)) stop("'length' and 'prop' cannot both be specified") if (length <= 0) stop("'length' must be positive") if (!missing(length)) { prop <- (as.numeric(length) - as.numeric(diff(lim))) / (2 * as.numeric(diff(lim))) } if (lim[1]==lim[2]) lim + 0.5 * c(-length,length) else { d <- diff(as.numeric(lim)) lim + prop * d * c(-1,1) } } else { print(lim) stop("improper length of 'lim'") } } ### this is a catch-common-arguments function that intercepts several ### common arguments. These are currently documented in ?xyplot, ### under \dots (...). Some arguments of trellis.skeleton are also ### formal arguments to xyplot, and are documented as such. These are ### indicated below with a comment. This is useful to keep track of ### documented arguments, because the formal codoc system doesn't work ### here (trellis.skeleton is not exported and hence not formally ### documented). ### one special exception is 'subscripts'. A 'subscripts' argument is ### required in the panel functions for panel.identify etc to work ### properly. However, not all high level functions always pass a ### suitable 'subscripts' argument to its panel function (but some, ### like 'splom' and 'levelplot' do). For those that do not, a ### 'subscripts=TRUE' argument can change the behaviour. The others ### don't have a 'subscripts' argument (as it is redundant), but we'll ### capture and ignore it here to keep the interface consistent. trellis.skeleton <- function(formula = NULL, cond, aspect = default.args$aspect, # argument in xyplot as.table = default.args$as.table, between = default.args$between, key = NULL, legend = NULL, page = default.args$page, main = default.args$main, sub = default.args$sub, par.strip.text = default.args$par.strip.text, layout = default.args$layout, skip = default.args$skip, strip = default.args$strip.default, # argument in xyplot strip.left = FALSE, xlab.default = NULL, ylab.default = NULL, xlab = NULL, # argument in xyplot ylab = NULL, # argument in xyplot xlab.top = NULL, ylab.right = NULL, panel, # argument in xyplot xscale.components = default.args$xscale.components, yscale.components = default.args$yscale.components, axis = default.args$axis, subscripts = TRUE, # ignored, for reasons given above index.cond = NULL, perm.cond = NULL, ..., par.settings = NULL, plot.args = NULL, lattice.options = NULL) { default.args <- lattice.getOption("default.args") if (is.null(skip)) skip <- FALSE foo <- list(formula = formula, as.table = as.table, aspect.fill = (aspect == "fill"), ## key = key, legend = construct.legend(legend = legend, key = key), panel = panel, page = page, layout = layout, skip = skip, strip = if (is.logical(strip) && strip) "strip.default" else strip, strip.left = if (is.logical(strip.left) && strip.left) strip.custom(horizontal = FALSE) else strip.left, xscale.components = xscale.components, yscale.components = yscale.components, axis = axis, xlab = xlab, ylab = ylab, xlab.default = xlab.default, ylab.default = ylab.default, xlab.top = xlab.top, ylab.right = ylab.right, main = main, sub = sub, x.between = 0, y.between = 0, par.settings = par.settings, plot.args = plot.args, lattice.options = lattice.options, par.strip.text = par.strip.text, index.cond = index.cond, perm.cond = perm.cond) if (!is.null(between$x)) foo$x.between <- between$x if (!is.null(between$y)) foo$y.between <- between$y foo$condlevels <- lapply(cond, levels) list(foo = foo, dots = list(...)) } cond.orders <- function(foo, ...) ## function to determine order of panels within a cond. variable ## foo: trellis object-to-be ## calculate actual values for index.cond and perm.cond. ## index.cond can be a function, in which case it would be used to ## determing order of levels within conditioning variables ## Question: should these be determined at run-time? Wouldn't be ## impossible, but has the disadvantage that looking at the ## trellis object will be totally uninformative in the default ## case (when both would be NULL). In a sense, this is fine, since ## having index.cond be a function is similar to having a prepanel ## function. After all, the results depend only on the panel ## contents, and those cannot be changed via update. { ## the following to be used for changing order of conditioning ## variables and indexing their levels. The object foo already has ## components index.cond and perm.cond as whatever was passed to ## the original function call. If these are NULL, suitable ## defaults need to be computed. If foo$index.cond is a function, ## index.cond has to be computed appropriately. index.cond <- vector(mode = "list", length = length(foo$condlevels)) for (i in seq_along(foo$condlevels)) index.cond[[i]] <- seq_along(foo$condlevels[[i]]) perm.cond <- seq_len(length(foo$condlevels)) if (!is.null(foo$perm.cond)) { if (all(sort(foo$perm.cond) == perm.cond)) perm.cond <- foo$perm.cond else stop("Invalid value of perm.cond") } if (!is.null(foo$index.cond)) { if (is.list(foo$index.cond) && length(foo$index.cond) == length(index.cond)) { for (i in seq_along(foo$condlevels)) index.cond[[i]] <- index.cond[[i]][foo$index.cond[[i]]] } else if (is.function(foo$index.cond)) { FUN <- foo$index.cond nplots <- length(foo$panel.args) panel.order <- numeric(nplots) for (count in seq_len(nplots)) { if (is.list(foo$panel.args[[count]])) { pargs <- c(foo$panel.args.common, foo$panel.args[[count]], list(...)) prenames <- names(formals(FUN)) if (!("..." %in% prenames)) pargs <- pargs[intersect(names(pargs), prenames)] panel.order[count] <- do.call("FUN", pargs) } else ## this happens for empty panels { is.na(panel.order) <- count # panel.order[count] <- NA } } dim(panel.order) <- sapply(foo$condlevels, length) for (i in seq_along(foo$condlevels)) index.cond[[i]] <- order(apply(panel.order, i, mean, na.rm = TRUE)) } else stop("Invalid value of index.cond") } list(index.cond = index.cond, perm.cond = perm.cond) } compute.layout <- function(layout, cond.max.level, skip = FALSE) { if (all(skip)) stop("skip cannot be all TRUE") number.of.cond <- length(cond.max.level) nplots <- prod(cond.max.level) if (is.null(layout)) { layout <- c(0,1,1) if (number.of.cond == 1) layout[2] <- nplots else { layout[1] <- cond.max.level[1] layout[2] <- cond.max.level[2] } skip <- rep(skip, length.out = max(layout[1] * layout[2], layout[2])) plots.per.page <- length(skip) - length(skip[skip]) layout[3] <- ceiling(nplots/plots.per.page) # + 1 } else if (length(layout) == 1) stop("layout must have at least 2 elements") else if (length(layout) == 2 || length(layout) == 3) { if (all(is.na(layout[1:2])) || ## stop("Row and column cannot both be NA in layout.") all(layout[1:2] < 1) || ## stop("At least one of row and column must be positive in layout.") isTRUE(layout[2] < 1)) stop("Inadmissible value of layout.") if (is.na(layout[1])) layout[1] <- ceiling(nplots / layout[2]) if (is.na(layout[2])) layout[2] <- ceiling(nplots / layout[1]) skip <- rep(skip, length.out = max(layout[1] * layout[2], layout[2])) plots.per.page <- length(skip) - length(skip[skip]) min.page <- ceiling(nplots / plots.per.page) # + 1 if (length(layout) == 2) layout[3] <- min.page else ## length(layout) == 3 { if (layout[3] < 1) stop("invalid value for layout") if (layout[3] > min.page) warning("More pages in layout than seem to be necessary.") } } layout } compute.packet <- function(cond, levels) { id <- !(do.call("pmax", lapply(cond, is.na))) stopifnot(any(id)) for (i in seq_along(cond)) { var <- cond[[i]] id <- id & ( if (is.shingle(var)) ((var >= levels(var)[[levels[i]]][1]) & (var <= levels(var)[[levels[i]]][2])) else (as.numeric(var) == levels[i]) ) } id } lattice/R/make.groups.R0000644000176200001440000000264313070415115014460 0ustar liggesusers ### Copyright (C) 2005-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA make.groups <- function(...) { tmp <- list(...) nms <- as.character(substitute(list(...)))[-1] if (is.null(names(tmp))) names(tmp) <- nms else { unnamed <- names(tmp) == "" names(tmp)[unnamed] <- nms[unnamed] } if (all(sapply(tmp, is.data.frame))) { cbind(do.call(rbind, tmp), which = rep(gl(length(tmp), 1, labels = names(tmp)), sapply(tmp, nrow))) } else data.frame(data = unlist(tmp), which = rep(gl(length(tmp), 1, labels = names(tmp)), sapply(tmp, length))) } lattice/R/panel.smooth.R0000644000176200001440000001440213070415115014630 0ustar liggesusers ### Copyright (C) 2001-2011 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## previously part of panels.R (r676) panel.loess <- function(x, y, span = 2/3, degree = 1, family = c("symmetric", "gaussian"), evaluation = 50, lwd = plot.line$lwd, lty = plot.line$lty, col, col.line = plot.line$col, type, ## ignored horizontal = FALSE, ..., identifier = "loess") { x <- as.numeric(x) y <- as.numeric(y) ok <- is.finite(x) & is.finite(y) if (sum(ok) < 1) return() if (!missing(col)) { if (missing(col.line)) col.line <- col } plot.line <- trellis.par.get("plot.line") if (horizontal) { smooth <- loess.smooth(y[ok], x[ok], span = span, family = family, degree = degree, evaluation = evaluation) panel.lines(x = smooth$y, y = smooth$x, col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } else { smooth <- loess.smooth(x[ok], y[ok], span = span, family = family, degree = degree, evaluation = evaluation) panel.lines(x = smooth$x, y = smooth$y, col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } smooth } prepanel.loess <- function(x, y, span = 2/3, degree = 1, family = c("symmetric", "gaussian"), evaluation = 50, horizontal = FALSE, ...) { x <- as.numeric(x) y <- as.numeric(y) ok <- is.finite(x) & is.finite(y) if (sum(ok) < 1) return(prepanel.null()) if (horizontal) { smooth <- loess.smooth(y[ok], x[ok], span = span, family = family, degree = degree, evaluation = evaluation) list(xlim = range(x, smooth$y, finite = TRUE), ylim = range(y, smooth$x, finite = TRUE), dx = diff(smooth$y), dy = diff(smooth$x)) } else { smooth <- loess.smooth(x[ok], y[ok], span = span, family = family, degree = degree, evaluation = evaluation) list(xlim = range(x, smooth$x, finite = TRUE), ylim = range(y, smooth$y, finite = TRUE), dx = diff(smooth$x), dy = diff(smooth$y)) } } # panel.smooth <- # function(x, y, span = 2/3, degree = 1, zero.line = FALSE, # family = c("symmetric", "gaussian"), # evaluation = 50, # lwd = plot.line$lwd, lty = plot.line$lty, # col = plot.line$col, ...) # { # if (zero.line) abline(h=0, ...) # panel.loess(x, y, span = span, family = family, # degree = degree, evaluation = evaluation, ...) # panel.xyplot(x, y, ...) # } ## base R function exists ## panel.loess <- ## function(x, y, span = 2/3, degree = 1, ## family = c("symmetric", "gaussian"), ## evaluation = 50, ## lwd = plot.line$lwd, ## lty = plot.line$lty, ## col, ## col.line = plot.line$col, ## type, ## ignored ## horizontal = FALSE, ## ..., ## identifier = "loess") panel.spline <- function(x, y, npoints = 101, lwd = plot.line$lwd, lty = plot.line$lty, col, col.line = plot.line$col, type, # ignored horizontal = FALSE, ..., keep.data = FALSE, identifier = "spline") { x <- as.numeric(x) y <- as.numeric(y) ok <- is.finite(x) & is.finite(y) if (sum(ok) < 1) return() if (!missing(col)) { if (missing(col.line)) col.line <- col } plot.line <- trellis.par.get("plot.line") if (horizontal) { args <- list(x = y[ok], y = x[ok], ..., keep.data = keep.data) smooth <- checkArgsAndCall(smooth.spline, args) yy <- do.breaks(range(y[ok]), npoints) p <- predict(smooth, x = yy) panel.lines(p$y, p$x, col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } else { args <- list(x = x[ok], y = y[ok], ..., keep.data = keep.data) smooth <- checkArgsAndCall(smooth.spline, args) xx <- do.breaks(range(x[ok]), npoints) p <- predict(smooth, x = xx) panel.lines(p$x, p$y, col = col.line, lty = lty, lwd = lwd, ..., identifier = identifier) } smooth } prepanel.spline <- function(x, y, npoints = 101, horizontal = FALSE, ..., keep.data = FALSE) { x <- as.numeric(x) y <- as.numeric(y) ok <- is.finite(x) & is.finite(y) if (sum(ok) < 1) return(prepanel.null()) if (horizontal) { args <- list(x = y[ok], y = x[ok], ..., keep.data = keep.data) smooth <- checkArgsAndCall(smooth.spline, args) yy <- do.breaks(range(y[ok]), npoints) p <- predict(smooth, x = yy) list(xlim = range(x, p$y, finite = TRUE), ylim = range(y, p$x, finite = TRUE), dx = diff(p$y), dy = diff(p$x)) } else { args <- list(x = x[ok], y = y[ok], ..., keep.data = FALSE) smooth <- checkArgsAndCall(smooth.spline, args) xx <- do.breaks(range(x[ok]), npoints) p <- predict(smooth, x = xx) list(xlim = range(x, p$x, finite = TRUE), ylim = range(y, p$y, finite = TRUE), dx = diff(p$x), dy = diff(p$y)) } } lattice/R/axis.R0000644000176200001440000010651514145167203013202 0ustar liggesusers### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## (By popular demand) function to get axis limits of current panel current.panel.limits <- function(unit = "native") { list(xlim = convertX(unit(c(0,1), "npc"), unit, valueOnly=TRUE), ylim = convertY(unit(c(0,1), "npc"), unit, valueOnly=TRUE)) } ## Functions to compute axis tick mark positions and labels. From ## lattice 0.14 onwards, there will be user specifiable functions (one ## each for the x and y axes) that does this. The function defined ## here is intended to serve as the default choice for that function. ## The goal is to make anything reasonable possible, so suggested ## changes to the API will be considered. The tentative plan is to ## specify them as optional arguments, e.g. xyplot(..., ## xscale.components = function(lim, ...) list(...)) ## NOTE: A LOT OF CODE WILL NEED TO BE CHANGED ELSEWHERE TO SUPPORT ## THIS. ONE APPROACH MIGHT BE TO EXPOSE THE API AND DEAL WITH THE ## DETAILS AFTER R 2.4.0 IS RELEASED. ## This function is intended to work with one packet at a time. It ## will be called only once when relation=same, and once for each ## packet otherwise. The major difference is that there can be ## different things on opposite sides (left/right or top/bottom), ## e.g. both transformed and original axes on log transformed data. ## The output can be a list with tick locations, labels, etc. I also ## considered allowing it to be a ``grob''. (I don't necessarily ## endorse the idea of having a grid dependency built into the Trellis ## object, as opposed to just the plotting procedure, but that ship ## has sailed a long time back: xlab, main, etc can already be grobs.) ## However, this is difficult to implement, and I don't even know how ## to design a grob that will be properly coordinated with the axes. ## Anyone who can figure that out will also be capable of writing a ## custom axis function. ## Output formats: The output is a list of the form ## list(num.limit = ..., left=..., right=...) or ## list(num.limit = ..., bottom=..., top=...) ## num.limit is the numeric range suggested ## right and top can be logical: TRUE means same as left/bottom, FALSE ## means to be omitted. Prior default behaviour corresponds to TRUE ## for relation=same, FALSE otherwise. They can also be like ## left/bottom, whose possible values are described next. ## One thing to remember is that tick marks and labels are treated ## separately. This strategy has worked successfully in the past, and ## I'm not willing to give it up (mostly because I'm not really sure ## how to create a single grob that combines both, and then can be ## used to determine widths/heights (even if I could, I'm sure the ## calculations will be slower)). So, the output will be like ## left = ## list(ticks = list(at = ..., tck = ...), ## labels = ## list(at = ..., labels = ..., check.overlap = TRUE)) ## or ## left = ## list(ticks = list(at = ..., tck = ...), ## labels = textGrob("foo")) xscale.components.default <- function(lim, packet.number = 0, packet.list = NULL, top = TRUE, ...) { comps <- calculateAxisComponents(lim, packet.list = packet.list, packet.number = packet.number, ...) list(num.limit = comps$num.limit, bottom = list(ticks = list(at = comps$at, tck = 1), labels = list(at = comps$at, labels = comps$labels, check.overlap = comps$check.overlap)), top = top) } ## should be same as above with s/bottom/left/g and s/top/right/g yscale.components.default <- function(lim, packet.number = 0, packet.list = NULL, right = TRUE, ...) { comps <- calculateAxisComponents(lim, packet.list = packet.list, packet.number = packet.number, ...) list(num.limit = comps$num.limit, left = list(ticks = list(at = comps$at, tck = 1), labels = list(at = comps$at, labels = comps$labels, cex = 1, check.overlap = comps$check.overlap)), right = right) } ## default function to draw axes. This (or its user-specified ## replacement) will be called once for each side of each panel, ## regardless of whether relation == "same". axis.default <- function(side = c("top", "bottom", "left", "right"), scales, components, as.table, labels = c("default", "yes", "no"), ticks = c("default", "yes", "no"), ..., prefix = lattice.getStatus("current.prefix")) { side <- match.arg(side) labels <- match.arg(labels) ticks <- match.arg(ticks) row <- lattice.getStatus("current.focus.row", prefix = prefix) column <- lattice.getStatus("current.focus.column", prefix = prefix) panel.layout <- trellis.currentLayout("panel", prefix = prefix) layout.dim <- dim(panel.layout) determineStatus <- function(x) { ## whether the relevant component of 'components' wants us to ## draw something here if (is.null(x) || (is.logical(x) && !x)) FALSE else TRUE } lastPanel <- function() { ## is this the last panel? In that case, it is considered to ## be ``on the boundary'' on the right side. ((pn <- panel.number(prefix = prefix)) > 0 && pn == max(panel.layout)) } atBoundary <- function() { switch(side, top = if (as.table) row == 1 else row == layout.dim[1], bottom = if (!as.table) row == 1 else row == layout.dim[1], left = column == 1, right = column == layout.dim[2] || lastPanel()) } ## FIXME: what about scales$relation ? do.ticks <- switch(ticks, yes = TRUE, no = FALSE, default = scales$draw && determineStatus(components[[side]]) && (if (scales$relation == "same") atBoundary() else TRUE)) do.labels <- switch(labels, yes = TRUE, no = FALSE, default = scales$draw && (if (scales$relation == "same") { atBoundary() && ## rule: if (alternating[row/column] %in% c(2, 3)) for ## a ``boundary'' panel, then draw, otherwise don't. switch(side, top = rep(scales$alternating, length.out = column)[column] %in% c(2, 3), bottom = rep(scales$alternating, length.out = column)[column] %in% c(1, 3), left = rep(scales$alternating, length.out = row)[row] %in% c(1, 3), right = rep(scales$alternating, length.out = row)[row] %in% c(2, 3)) } else TRUE)) if (do.ticks || do.labels) { comp.list <- switch(side, top = if (is.logical(components[["top"]]) && components[["top"]]) components[["bottom"]] else components[["top"]], bottom = components[["bottom"]], left = components[["left"]], right = if (is.logical(components[["right"]]) && components[["right"]]) components[["left"]] else components[["right"]]) scales.tck <- switch(side, left = , bottom = scales$tck[1], right = , top = scales$tck[2]) if (!is.logical(comp.list)) ## must be FALSE if it is { if (do.ticks) panel.axis(side = side, at = comp.list$ticks$at, labels = FALSE, draw.labels = FALSE, check.overlap = FALSE, outside = TRUE, ticks = TRUE, tck = scales.tck * comp.list$ticks$tck, ...) if (do.labels) panel.axis(side = side, at = comp.list$labels$at, labels = comp.list$labels$labels, draw.labels = TRUE, check.overlap = comp.list$labels$check.overlap, outside = TRUE, ticks = FALSE, tck = scales.tck * comp.list$ticks$tck, ...) } } } ## FIXME: Long term goal: some of the following code is possibly too ## cautious. A review might make the code simpler without substantial ## drawbacks (the point being that we know exactly how the code is ## being called). calculateAxisComponents <- function(x, ..., ## ignored, but needs to be caught: packet.number, packet.list, abbreviate = NULL, minlength = 4) ## This aims to be a general function which given a general ## 'range' x and optional at, generates the locations of tick ## marks and corresponding labels. ## x is guaranteed to be given (possibly NA). Possible cases ## correspond to factors (character/expression), shingle (see ## below), "POSIXt", "date" and usual numeric. The last case will ## be default, and will be changed later if necessary. ## Theres no need to handle shingles specially. Shingles can also ## be thought of as numeric, and thus the default is more ## appropriate for functions like xyplot. In functions like ## bwplot, things will be adjusted elsewhere when one of the ## variables is a shingle. ## Note that at and labels will never be TRUE (it's set up that ## way), so it's enough to check if they are is.logical(), which ## means they are not explicitly specified. ## The variables about log scales are required for cases where at ## is explicitly specified. In such cases, at will be ## log(at,base=logbase), but labels would correspond to at. { if (all(is.na(x))) return(list(at = numeric(0), labels = numeric(0), check.overlap = TRUE, num.limit = c(0,1))) ## Get ticks and labels depending on x (generic defined below) ans <- formattedTicksAndLabels(x, ...) ## remove labels outside limits rng <- range(ans$num.limit) ok <- ans$at >= min(rng) & ans$at <= max(rng) ans$at <- ans$at[ok] ans$labels <- ans$labels[ok] ## abbreviate labels if requested if (is.logical(abbreviate) && abbreviate) ans$labels <- abbreviate(ans$labels, minlength) ans } formattedTicksAndLabels <- function(x, ...) UseMethod("formattedTicksAndLabels") ## quick and dirty fix: have methods for all sorts of objects, even ## ones in other packages (like chron) formattedTicksAndLabels.default <- function(x, at = FALSE, used.at = NULL, labels = FALSE, logsc = FALSE, ..., num.limit = NULL, abbreviate = NULL, minlength = 4, format.posixt = NULL, equispaced.log = TRUE) ## meant for when x is numeric { rng <- if (length(x) == 2) as.numeric(x) else range(as.numeric(x)) ## str(list(x = x, num.limit = num.limit, ## rng = rng, equispaced.log = equispaced.log)) ## handle log scale (most other methods ignore logsc) if (is.logical(logsc) && logsc) logsc <- 10 have.log <- !is.logical(logsc) if (have.log) logbase <- if (is.numeric(logsc)) logsc else if (logsc == "e") exp(1) else stop("Invalid value of 'log'") logpaste <- if (have.log) paste(as.character(logsc), "^", sep = "") else "" ## will check for overlap only when neither at nor labels is specified check.overlap <- if (is.logical(at) && is.logical(labels)) TRUE else FALSE if (is.logical(at)) ## at not explicitly specified { at <- if (have.log && !equispaced.log) # FIXME: num.limit instead of rng? checkArgsAndCall(axisTicks, list(usr = log10(logbase^rng), log = TRUE, axp = NULL, ...)) else checkArgsAndCall(pretty, list(x = x[is.finite(x)], ...)) } else if (have.log && (length(at) > 0)) ## 'at' specified but not NULL { if (is.logical(labels)) labels <- as.character(at) at <- log(at, base = logbase) } if (is.logical(labels)) { if (have.log && !equispaced.log) { labels <- as.character(at) at <- log(at, logbase) } else labels <- paste(logpaste, format(at, trim = TRUE), sep = "") } list(at = at, labels = labels, check.overlap = check.overlap, num.limit = rng) } formattedTicksAndLabels.date <- function(x, at = FALSE, used.at = NULL, ..., num.limit = NULL, labels = FALSE, logsc = FALSE, abbreviate = NULL, minlength = 4, format.posixt = NULL) { ## handle log scales (not very meaningful, though) if (is.logical(logsc) && logsc) logsc <- 10 have.log <- !is.logical(logsc) || logsc logbase <- if (is.numeric(logsc)) logsc else exp(1) ## will check for overlap only when neither at nor labels is specified check.overlap <- if (is.logical(at) && is.logical(labels)) TRUE else FALSE if (is.logical(at)) ## at not explicitly specified { at <- as.integer(pretty(x[is.finite(x)], ...)) class(at) <- "date" datelabels <- as.character(at) } else if (have.log && (length(at) > 0)) { if (is.logical(labels)) labels <- as.character(at) at <- log(at, base = logbase) } list(at = at, labels = if (is.logical(labels)) datelabels else labels, check.overlap = check.overlap, num.limit = if (length(x) == 2) as.numeric(x) else as.numeric(range(x))) } ## The next two are actually identical formattedTicksAndLabels.character <- function (x, at = FALSE, used.at = NULL, labels = FALSE, logsc = FALSE, ..., num.limit = NULL, abbreviate = NULL, minlength = 4, format.posixt = NULL) { retain <- if (is.null(used.at) || any(is.na(used.at))) TRUE else used.at ## OLD: ans <- list(at = if (is.logical(at)) seq_along(x)[retain] else at, ## labels = if (is.logical(labels)) x[retain] else labels, ## check.overlap = FALSE) ans <- list() ans$at <- if (is.logical(at)) seq_along(x)[retain] else at ans$labels <- if (is.logical(labels)) { if (all(ans$at %in% seq_along(x))) x[ans$at] else ## meaningless at, since not corresponding to values as.character(ans$at) # best guess } else labels ans$check.overlap <- FALSE ans$num.limit <- c(-1, 1) * lattice.getOption("axis.padding")$factor + if (is.null(num.limit) || any(is.na(num.limit))) c(1, length(x)) ## WAS range(ans$at), not sure why else num.limit ans } formattedTicksAndLabels.expression <- function(x, at = FALSE, used.at = NULL, labels = FALSE, logsc = FALSE, ..., num.limit = NULL, abbreviate = NULL, minlength = 4, format.posixt = NULL) { retain <- if (is.null(used.at) || any(is.na(used.at))) TRUE else used.at ans <- list() ans$at <- if (is.logical(at)) seq_along(x)[retain] else at ans$labels <- if (is.logical(labels)) { if (all(ans$at %in% seq_along(x))) x[ans$at] else ## meaningless at, since not corresponding to values as.character(ans$at) # best guess } else labels ans$num.limit <- c(-1, 1) * lattice.getOption("axis.padding")$factor + if (is.null(num.limit) || any(is.na(num.limit))) ## range(ans$at) c(1, length(x)) else num.limit ans } ## method for "Date" (using pretty.Date) ## and POXIXct (using pretty.POSIXt) formattedTicksAndLabels.Date <- formattedTicksAndLabels.POSIXct <- function(x, at = FALSE, used.at = NULL, labels = FALSE, logsc = FALSE, ..., num.limit = NULL, abbreviate = NULL, minlength = 4, format.posixt = NULL) { num.lim <- if (length(x) == 2) as.numeric(x) else range(as.numeric(x), na.rm = TRUE) if (!is.logical(labels)) ## no need to do anything { if (missing(at) || length(at) != length(labels)) stop("'at' missing or incompatible with 'labels'") return(list(at = at, labels = labels, check.overlap = FALSE, num.limit = num.lim)) } mat <- is.logical(at) if (mat) ## at not explicitly specified { ## at <- prettyDate_TMP(x, ...) ## FIXME: should be pretty() eventually at <- pretty(x, ...) ## FIXME: should be pretty() eventually if (is.null(format.posixt)) labels <- attr(at, "labels") else labels <- format(at, format = format.posixt) } else { if (is.null(format.posixt)) format.posixt <- "" labels <- format(at, format = format.posixt) } list(at = as.numeric(at), labels = labels, check.overlap = mat, num.limit = num.lim) } ## chron 'chron' objects: dates and times formattedTicksAndLabels.chron <- function(x, at = FALSE, ...) { if (!inherits(x, "times")) x <- chron::chron(x) x <- as.POSIXct(x) attr(x, "tzone") <- "GMT" if (!is.logical(at)) { ## at was explicitly specified at <- as.POSIXct(at) attr(at, "tzone") <- "GMT" } ans <- formattedTicksAndLabels(x, at = at, ...) ans$at <- ans$at / 86400 ans$num.limit <- ans$num.limit / 86400 ans } ## chron 'dates' objects: only dates (no times here because caught by 'chron' method) formattedTicksAndLabels.dates <- function(x, ...) { if (!inherits(x, "times")) x <- chron::chron(x) formattedTicksAndLabels(as.Date(x), ...) } ## chron 'times' objects: only times (no dates here because caught by 'dates' method) formattedTicksAndLabels.times <- function(x, labels = FALSE, ..., format.posixt = NULL, simplify = TRUE) { ans <- formattedTicksAndLabels(chron::chron(dates = x), labels = labels, format.posixt = format.posixt, ...) if (is.logical(labels)) { ## labels not specified if (is.null(format.posixt)) { ## format not specified at <- chron::chron(times = ans$at) ## format.times will revert to numeric format if any > 1 if (max(abs(at)) <= 1) ## 'x' might exceed 1 labels <- format(at - floor(at), simplify = simplify) else labels <- format(at, simplify = simplify) ans$labels <- labels } } ans } OLD_formattedTicksAndLabels.times <- function(x, at = FALSE, used.at = NULL, num.limit = NULL, labels = FALSE, logsc = FALSE, abbreviate = NULL, minlength = 4, simplify = TRUE, ..., format.posixt = NULL) { ## most arguments ignored for now check.overlap <- if (is.logical(at) && is.logical(labels)) TRUE else FALSE if (!inherits(x, "times")) x <- chron::chron(x) bad <- is.na(x) | abs(as.vector(x)) == Inf ## rng <- extend.limits(range(as.numeric(x[!bad]))) rng <- range(as.numeric(x[!bad])) tmp <- pretty(rng, ...) att <- attributes(x) at <- structure(tmp, # [tmp >= rng[1] & tmp <= rng[2]], format = att$format, origin = att$origin, class = att$class) if (inherits(at, "chron")) class(at) <- class(at)[-1] if (is.logical(labels)) ## labels unspecified { if (!inherits(x, "dates")) { at[c(1, length(at))] <- range(x) if (max(at) == 1) labels <- format(at - trunc(at), simplify = simplify) else labels <- format(at, simplify = simplify) } else labels <- format(at, simplify = simplify) } ## invisible(list(n = n, at = at, labels = labels)) list(at = as.numeric(at), labels = labels, check.overlap = check.overlap, num.limit = if (length(x) == 2) as.numeric(x) else rng) } panel.axis <- function(side = c("bottom", "left", "top", "right"), at = pretty(scale.range), labels = TRUE, draw.labels = TRUE, check.overlap = FALSE, outside = FALSE, ticks = TRUE, half = !outside, ## whether only half of the ticks will be labeled which.half = switch(side, bottom = "lower", left = "upper", top = "upper", right = "lower"), tck = as.numeric(ticks), rot = if (is.logical(labels)) 0 else c(90, 0), text.col = axis.text$col, text.alpha = axis.text$alpha, text.cex = axis.text$cex, text.font = axis.text$font, text.fontfamily = axis.text$fontfamily, text.fontface = axis.text$fontface, text.lineheight = axis.text$lineheight, line.col = axis.line$col, line.lty = axis.line$lty, line.lwd = axis.line$lwd, line.alpha = axis.line$alpha) { side <- match.arg(side) at.missing <- missing(at) orientation <- if (outside) "outer" else "inner" cpl <- current.panel.limits() scale.range <- range(switch(side, left = cpl$ylim, top = cpl$xlim, right = cpl$ylim, bottom = cpl$xlim)) axis.line <- trellis.par.get("axis.line") axis.text <- trellis.par.get("axis.text") rot <- rep(rot, length.out = 2) ## for x- and y-axes respectively if (is.null(at) || length(at) == 0) return() ## get labels from at if unspecified if (is.logical(labels)) labels <- if (labels) format(at, trim = TRUE) else NULL else if (at.missing) warning("specifying 'labels' but not 'at' may lead to unexpected results") if (check.overlap) ## remove ticks close to limits { pad <- lattice.getOption("skip.boundary.labels") scale.range <- extend.limits(scale.range, prop = -pad) } ## skip ticks outside (or close to) axis limits keep.at <- at >= scale.range[1] & at <= scale.range[2] at <- at[keep.at] labels <- labels[keep.at] nal <- length(at) / 2 + 0.5 all.id <- seq_along(at) lower.id <- all.id <= nal upper.id <- all.id >= nal axid <- if (half) { if (which.half == "lower") lower.id else upper.id } else rep(TRUE, length(all.id)) if (!any(axid)) return(invisible()) gp.line <- gpar(col = line.col, alpha = line.alpha, lty = line.lty, lwd = line.lwd) gp.text <- gpar(col = text.col, cex = text.cex, alpha = text.alpha, fontface = chooseFace(text.fontface, text.font), fontfamily = text.fontfamily, lineheight = text.lineheight) ## We now compute some spacing information based on settings ## (combining trellis settings and the (newer) lattice.options). ## These can only be controlled via these settings and not by ## arguments to this function, for convenience for one thing, and ## also because the same settings will be used elsewhere to leave ## appropriate space. ## unit representing tick marks axis.units <- lattice.getOption("axis.units")[[orientation]][[side]] ## axis.units is of the form: ## list(outer = list(left = list(tick=, pad1=, pad2=), top = list(...), ...), ## inner = list(...) ) axis.settings <- trellis.par.get("axis.components")[[side]] tck.unit.x <- tck * axis.settings$tck * axis.units$tick$x tck.unit <- unit(x = tck.unit.x, units = axis.units$tick$units) lab.unit <- if (any(tck.unit.x > 0)) tck.unit + unit(x = axis.settings$pad1 * axis.units$pad1$x, units = axis.units$pad1$units) else unit(x = axis.settings$pad1 * axis.units$pad1$x, units = axis.units$pad1$units) orient.factor <- if (outside) -1 else 1 if (ticks && any(tck.unit.x != 0)) switch(side, bottom = grid.segments(x0 = unit(at[axid], "native"), x1 = unit(at[axid], "native"), y0 = unit(0, "npc"), y1 = orient.factor * tck.unit, name = trellis.grobname("ticks.bottom", type="panel"), gp = gp.line), top = grid.segments(x0 = unit(at[axid], "native"), x1 = unit(at[axid], "native"), y0 = unit(1, "npc"), y1 = unit(1, "npc") - orient.factor * tck.unit, name = trellis.grobname("ticks.top", type="panel"), gp = gp.line), left = grid.segments(y0 = unit(at[axid], "native"), y1 = unit(at[axid], "native"), x0 = unit(0, "npc"), x1 = orient.factor * tck.unit, name = trellis.grobname("ticks.left", type="panel"), gp = gp.line), right = grid.segments(y0 = unit(at[axid], "native"), y1 = unit(at[axid], "native"), x0 = unit(1, "npc"), x1 = unit(1, "npc") - orient.factor * tck.unit, name = trellis.grobname("ticks.right", type="panel"), gp = gp.line)) if (draw.labels && !is.null(labels)) { { just <- if (outside) switch(side, bottom = if (rot[1] == 0) c("centre", "top") else c("right", "centre"), top = if (rot[1] == 0) c("centre", "bottom") else c("left", "centre"), left = if (rot[2] == 90) c("centre", "bottom") else c("right", "centre"), right = if (rot[2] == 90) c("centre", "top") else c("left", "centre")) else switch(side, bottom = if (rot[1] == 0) c("centre", "bottom") else c("left", "centre"), top = if (rot[1] == 0) c("centre", "top") else c("right", "centre"), left = if (rot[2] == 90) c("centre", "top") else c("left", "centre"), right = if (rot[2] == 90) c("centre", "bottom") else c("right", "centre")) } switch(side, bottom = grid.text(label = labels[axid], x = unit(at[axid], "native"), y = orient.factor * lab.unit, rot = rot[1], check.overlap = check.overlap, just = just, name = trellis.grobname("ticklabels.bottom", type="panel"), gp = gp.text), top = grid.text(label = labels[axid], x = unit(at[axid], "native"), y = unit(1, "npc") - orient.factor * lab.unit, rot = rot[1], check.overlap = check.overlap, just = just, name = trellis.grobname("ticklabels.top", type="panel"), gp = gp.text), left = grid.text(label = labels[axid], y = unit(at[axid], "native"), x = orient.factor * lab.unit, rot = rot[2], check.overlap = check.overlap, just = just, name = trellis.grobname("ticklabels.left", type="panel"), gp = gp.text), right = grid.text(label = labels[axid], y = unit(at[axid], "native"), x = unit(1, "npc") - orient.factor * lab.unit, rot = rot[2], check.overlap = check.overlap, just = just, name = trellis.grobname("ticklabels.right", type="panel"), gp = gp.text)) } invisible() } ## Temporary hacks that should be removed ## prettyDate copied here temporarily. ## remove after it appears in R 2.12 ? if (FALSE) { prettyDate_TMP <- function(x, n = 5, min.n = n %/% 2, ...) { isDate <- inherits(x, "Date") x <- as.POSIXct(x) if (isDate) # the timezone *does* matter attr(x, "tzone") <- "GMT" zz <- range(x, na.rm = TRUE) if (diff(as.numeric(zz)) == 0)# one value only zz <- zz + c(0,60) ## specify the set of pretty timesteps MIN <- 60 HOUR <- MIN * 60 DAY <- HOUR * 24 YEAR <- DAY * 365.25 MONTH <- YEAR / 12 steps <- list("1 sec" = list(1, format = "%S", start = "mins"), "2 secs" = list(2), "5 secs" = list(5), "10 secs" = list(10), "15 secs" = list(15), "30 secs" = list(30, format = "%H:%M:%S"), "1 min" = list(1*MIN, format = "%H:%M"), "2 mins" = list(2*MIN, start = "hours"), "5 mins" = list(5*MIN), "10 mins" = list(10*MIN), "15 mins" = list(15*MIN), "30 mins" = list(30*MIN), "1 hour" = list(1*HOUR), "3 hours" = list(3*HOUR, start = "days"), "6 hours" = list(6*HOUR, format = "%b %d %H:%M"), "12 hours" = list(12*HOUR), "1 DSTday" = list(1*DAY, format = "%b %d"), "2 DSTdays" = list(2*DAY), "1 week" = list(7*DAY, start = "weeks"), "halfmonth" = list(MONTH/2, start = "months"), "1 month" = list(1*MONTH, format = "%b"), "3 months" = list(3*MONTH, start = "years"), "6 months" = list(6*MONTH, format = "%Y-%m"), "1 year" = list(1*YEAR, format = "%Y"), "2 years" = list(2*YEAR, start = "decades"), "5 years" = list(5*YEAR), "10 years" = list(10*YEAR), "20 years" = list(20*YEAR, start = "centuries"), "50 years" = list(50*YEAR), "100 years" = list(100*YEAR), "200 years" = list(200*YEAR), "500 years" = list(500*YEAR), "1000 years" = list(1000*YEAR)) ## carry forward 'format' and 'start' to following steps for (i in seq_along(steps)) { if (is.null(steps[[i]]$format)) steps[[i]]$format <- steps[[i-1]]$format if (is.null(steps[[i]]$start)) steps[[i]]$start <- steps[[i-1]]$start steps[[i]]$spec <- names(steps)[i] } ## crudely work out number of steps in the given interval xspan <- diff(as.numeric(zz)) nsteps <- sapply(steps, function(s) { xspan / s[[1]] }) init.i <- which.min(abs(nsteps - n)) ## calculate actual number of ticks in the given interval calcSteps <- function(s) { startTime <- trunc_POSIXt_TMP(min(zz), units = s$start) ## FIXME: should be trunc() eventually if (identical(s$spec, "halfmonth")) { at <- seq(startTime, max(zz), by = "months") at2 <- as.POSIXlt(at) at2$mday <- 15L at <- structure(sort(c(as.POSIXct(at), as.POSIXct(at2))), tzone = attr(at, "tzone")) } else { at <- seq(startTime, max(zz), by = s$spec) } at <- at[(min(zz) <= at) & (at <= max(zz))] at } init.at <- calcSteps(steps[[init.i]]) init.n <- length(init.at) - 1L ## bump it up if below acceptable threshold while (init.n < min.n) { init.i <- init.i - 1 if (init.i == 0) stop("range too small for min.n") init.at <- calcSteps(steps[[init.i]]) init.n <- length(init.at) - 1L } makeOutput <- function(at, s) { flabels <- format(at, s$format) ans <- if (isDate) as.Date(round(at, "days")) else as.POSIXct(at) attr(ans, "labels") <- flabels ans } if (init.n == n) ## perfect return(makeOutput(init.at, steps[[init.i]])) if (init.n > n) { ## too many ticks new.i <- init.i + 1 new.i <- min(new.i, length(steps)) } else { ## too few ticks new.i <- init.i - 1 new.i <- max(new.i, 1) } new.at <- calcSteps(steps[[new.i]]) new.n <- length(new.at) - 1L ## work out whether new.at or init.at is better if (new.n < min.n) new.n <- -Inf if (abs(new.n - n) < abs(init.n - n)) return(makeOutput(new.at, steps[[new.i]])) else return(makeOutput(init.at, steps[[init.i]])) } trunc_POSIXt_TMP <- function(x, units = c("secs", "mins", "hours", "days", "weeks", "months", "years", "decades", "centuries"), start.on.monday = TRUE) { x <- as.POSIXlt(x) if (units %in% c("secs", "mins", "hours", "days")) return(base::trunc.POSIXt(x, units)) x <- base::trunc.POSIXt(x, "days") if (length(x$sec)) switch(units, weeks = { x$mday <- x$mday - x$wday if (start.on.monday) x$mday <- x$mday + ifelse(x$wday > 0L, 1L, -6L) }, months = { x$mday <- 1 }, years = { x$mday <- 1 x$mon <- 0 }, decades = { x$mday <- 1 x$mon <- 0 x$year <- (x$year %/% 10) * 10 }, centuries = { x$mday <- 1 x$mon <- 0 x$year <- (x$year %/% 100) * 100 }) x } } lattice/R/scales.R0000644000176200001440000005030114410476343013502 0ustar liggesusers### Copyright (C) 2001-2006 Deepayan Sarkar ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## Can't think of a way to ensure partial matching except by doing it explicitly complete_names <- function(x, template, allow.invalid = FALSE) { pid <- pmatch(names(x), names(template), duplicates.ok = TRUE) if (allow.invalid) { x <- x[!is.na(pid)] pid <- pid[!is.na(pid)] } else { if (any(is.na(pid))) warning("Invalid or ambiguous component names: ", paste(names(x)[which(is.na(pid))], collapse = ", ") ) } if (any(duplicated(pid))) stop("Multiple matches to component name") names(x) <- names(template)[pid] x } ## FIXME: how should we handle unrecognized arguments? construct.scales <- function(draw = TRUE, axs = "r", tck = 1, tick.number = 5, at = FALSE, labels = FALSE, log = FALSE, alternating = TRUE, relation = "same", abbreviate = FALSE, minlength = 4, limits = NULL, format = NULL, equispaced.log = TRUE, lty = FALSE, lwd = FALSE, cex = FALSE, rot = FALSE, col = FALSE, col.line = col, alpha = FALSE, alpha.line = alpha, font = FALSE, fontfamily = FALSE, fontface = FALSE, lineheight = FALSE, ..., ## NOTE: ... is currently ignored x = NULL, y = NULL) { ## top-level values x.scales <- y.scales <- list(draw = draw, axs = axs, tck = tck, tick.number = tick.number, at = at, labels = labels, log = log, alternating = alternating, relation = relation, abbreviate = abbreviate, minlength = minlength, limits = limits, format = format, equispaced.log = equispaced.log, lty = lty, lwd = lwd, cex = cex, rot = rot, col = col, col.line = col.line, alpha = alpha, alpha.line = alpha.line, font = font, fontfamily = fontfamily, fontface = fontface, lineheight = lineheight) ## override by component-specific values if (!is.null(x)) { if (is.character(x)) x <- list(relation = x) x <- complete_names(x, x.scales) x.scales[names(x)] <- x } if (!is.null(y)) { if (is.character(y)) y <- list(relation = y) y <- complete_names(y, y.scales) y.scales[names(y)] <- y } if (is.logical(x.scales$alternating)) x.scales$alternating <- if (x.scales$alternating) c(1,2) else 1 if (is.logical(y.scales$alternating)) y.scales$alternating <- if (y.scales$alternating) c(1,2) else 1 for (nm in c("tck", "cex", "rot")) { x.scales[[nm]] <- rep(x.scales[[nm]], length.out = 2) y.scales[[nm]] <- rep(y.scales[[nm]], length.out = 2) } if (x.scales$relation == "same" && (is.list(x.scales$at) || is.list(x.scales$labels))) stop("the 'at' and 'labels' components of 'scales' may not be lists when 'relation = \"same\"'") if (y.scales$relation == "same" && (is.list(y.scales$at) || is.list(y.scales$labels))) stop("the 'at' and 'labels' components of 'scales' may not be lists when 'relation = \"same\"'") list(x.scales = x.scales, y.scales = y.scales) } construct.3d.scales <- function(draw = TRUE, axs = "r", tck = 1, lty = FALSE, lwd = FALSE, distance = c(1,1,1), tick.number = 5, cex = FALSE, rot = FALSE, at = FALSE, labels = FALSE, col = FALSE, col.line = col, alpha = FALSE, alpha.line = col, log = FALSE, font = FALSE, fontfamily = FALSE, fontface = FALSE, lineheight = FALSE, arrows = TRUE, relation = "same", format = NULL, abbreviate = FALSE, minlength = 4, ..., x = NULL, y = NULL, z = NULL) { x.scales <- y.scales <- z.scales <- list(draw = draw, axs = axs, tck = tck, lty = lty, lwd = lwd, tick.number = tick.number, cex = cex, rot = rot, font = font, fontfamily = fontfamily, fontface = fontface, lineheight = lineheight, at = at, labels = labels, col = col, col.line = col.line, alpha = alpha, alpha.line = alpha.line, log = log, arrows = arrows, relation = relation, format = format, abbreviate = abbreviate, minlength = minlength) distance <- rep(distance, length.out = 3) x.scales$distance <- distance[1] y.scales$distance <- distance[2] z.scales$distance <- distance[3] if (!is.null(x)) { if (is.character(x)) x <- list(relation = x) x <- complete_names(x, x.scales) x.scales[names(x)] <- x } if (!is.null(y)) { if (is.character(y)) y <- list(relation = y) y <- complete_names(y, y.scales) y.scales[names(y)] <- y } if (!is.null(z)) { if (is.character(z)) z <- list(relation = z) z <- complete_names(z, z.scales) z.scales[names(z)] <- z } list(x.scales = x.scales, y.scales = y.scales, z.scales = z.scales) } ## FIXME: the following function uses a very unstructured patchwork of ## logic. Need to change it to use some sort of method dispatch to ## work with different types of limits (dates, factors, etc) limitsFromLimitlist <- function(have.lim, lim, relation, limitlist, used.at, numlimitlist, axs, npackets) ## have.lim: logical, whether xlim/ylim was explicitly specified ## lim: the specified limit if have.lim = TRUE ## relation: same/free/sliced ## limitlist: list of limits from prepanel calculations, one for each panel ## numlimitlist: (optional) numeric locations for factors (lim ## will be levels including unused ones) ## axs: "r", "i" etc, passed on to extend.limits ## return value depends on relation. (See limits.and.aspect below, ## where this is used, for partial enlightenment.) { if (relation == "same") { ## The problem here is that we need to figure out the overall ## limit required from the limits of each panel. This could be ## a problem for two reasons. First, some panels could have no ## data in them, in which case the corresponding limits would ## be NA. Secondly, the limits could be either numeric or ## character vectors (the latter for factors). When relation = ## same, the type should be same across panels. When numeric, ## we just take range, leaving out NAs. But what about ## factors? Is it OK to assume that all the non-NA vectors ## would be exactly the same ? They should be, since levels(x) ## would not change even if not all levels are ## represented. So, I'm just taking unique of all the vectors ## concatenated, excluding NA's ## Additional complication: Need to preserve class of limits, ## to be used later in tick location/label calculation. Not a ## problem in other cases, but here unlist-ing loses the ## class. #if (!have.lim) ## always calculate the limits from prepanel first: ## should check that all classes are the same. How ? What ## about NA's ? Arrgh! ## to handle NA's, how about: all.na <- unlist(lapply(limitlist, function(x) all(is.na(x)))) class.lim <- ## retain non-NA limitlists only lapply(limitlist[!all.na], class) ## class.lim is a list now, may be length 0 limits <- unlist(limitlist) ## loses the class attribute ## if (length(limits) > 0) if (sum(!is.na(limits)) > 0) { if (is.character(limits)) { limits <- unique(limits[!is.na(limits)]) slicelen <- diff(extend.limits(limits, axs = axs)) } else ## if (is.numeric(limits)) # or dates etc { limits <- extend.limits(range(as.numeric(limits), finite = TRUE), axs = axs) slicelen <- diff(range(limits, finite = TRUE)) } ## hopefully put back appropriate class of limits: ## FIXME: date changes may have messed this up if (length(class.lim) > 0) class(limits) <- if (all(class.lim[[1]] == "integer")) "numeric" else class.lim[[1]] ## (have to handle "integer" specially, since variable ## specifications like 1:10 are rather common, and ## class() <- "integer" would turn the limits into ## integers) } else { limits <- c(0,1) slicelen <- 1 } if (have.lim) { if (is.list(lim)) stop("limits cannot be a list when relation = same") old.limits <- limits limits <- lim ## lim overrides prepanel except NAs if (!is.character(limits) && !is.character(old.limits)) { limits[is.na(limits)] <- old.limits[is.na(limits)] } slicelen <- ## this no longer works for dates (R 2.6) ## if (is.numeric(lim)) diff(range(lim)) ## else length(lim) + 2 if (is.character(limits)) length(limits) + 2 else diff(range(as.numeric(limits))) } ans <- list(limits = limits, slicelen = slicelen) } else if (relation == "sliced") { if (have.lim) { if (is.list(lim)) { limits <- rep(lim, length.out = npackets) } else warning("Explicitly specified limits ignored") } slicelen <- limitlist for (i in seq_along(limitlist)) { slicelen[[i]] <- ## if (is.numeric(limitlist[[i]])) if (!is.character(limitlist[[i]])) { if (any(is.finite(limitlist[[i]]))) ## range unnecessary, but... diff(range(as.numeric(limitlist[[i]]), finite = TRUE)) else NA_real_ } else if (!any(is.na(numlimitlist[[i]]))) diff(range(as.numeric(numlimitlist[[i]]))) else NA_real_ } slicelen <- (if (axs == "i") 1 else 1 + 2 * lattice.getOption("axis.padding")$numeric) * max(unlist(slicelen), na.rm = TRUE) for (i in seq_along(limitlist)) { if (is.numeric(limitlist[[i]])) limitlist[[i]] <- extend.limits(limitlist[[i]], length = slicelen) } for (i in seq_along(numlimitlist)) { if (!all(is.na(numlimitlist[[i]]))) numlimitlist[[i]] <- extend.limits(as.numeric(numlimitlist[[i]]), length = slicelen) } ans <- list(limits = limitlist, used.at = used.at, numlimitlist = numlimitlist, slicelen = slicelen) } else if (relation == "free") { if (have.lim) { ## This is the only situation where limits can be a list ## (doesn't make sense when relation="same", ignored when ## relation="sliced"). Even if limits is not a list (but ## is specified), it will be treated as a list, and ## repeated as necessary (see further comments below). if (!is.list(lim)) lim <- list(lim) ## There's a subtle consideration here. It is possible ## for some panels to have nothing in them (or only NA's). ## Such panels usually have their prepanel functions ## return NA. When 'limits' is specified as a list, this ## will be interpreted as the limit specification for the ## non-empty panels only (this is an arbitrary choice, but ## it usually makes more sense, even though it's less ## general than the other choice). ## which ones are non-NA? id <- which(sapply(limitlist, function(x) !all(is.na(x)))) ## replace these with the limits supplied, except if the ## supplied limits are NULL, in which case retain limits ## calculated by prepanel. old.limitlist <- limitlist limitlist[id] <- lim which.null <- sapply(limitlist, is.null) limitlist[which.null] <- old.limitlist[which.null] ## lim overrides prepanel except NAs for (i in seq_along(limitlist)) { if (!is.character(limitlist[[i]]) && !is.character(old.limitlist[[i]])) { isna <- is.na(limitlist[[i]]) limitlist[[i]][isna] <- old.limitlist[[i]][isna] } } } for (i in seq_along(limitlist)) { if (!all(is.na(limitlist[[i]])) && !is.character(limitlist[[i]])) limitlist[[i]] <- ## preserves class extend.limits(limitlist[[i]], axs = axs) ## o.w., keep it as it is } slicelen <- numeric(length(limitlist)) for (i in seq_along(limitlist)) slicelen[i] <- if (!is.character(limitlist[[i]])) diff(range(as.numeric(limitlist[[i]]))) else if (!any(is.na(numlimitlist[[i]]))) diff(range(numlimitlist[[i]])) else NA_real_ ans <- list(limits = limitlist, used.at = used.at, numlimitlist = numlimitlist, slicelen = slicelen) } ans } limits.and.aspect <- function(prepanel.default, prepanel = NULL, have.xlim = FALSE, xlim = NULL, have.ylim = FALSE, ylim = NULL, x.relation, y.relation, panel.args.common = list(), panel.args = list(), aspect, banking = lattice.getOption("banking"), npackets = length(panel.args), x.axs = "r", y.axs = "r", ...) ## extra arguments for prepanel (for qqmathline) { prepanel.default.function <- getFunctionOrName(prepanel.default) prepanel <- getFunctionOrName(prepanel) if (npackets<1) stop("need at least one panel") x.limits <- vector("list", npackets) y.limits <- vector("list", npackets) x.used.at <- vector("list", npackets) y.used.at <- vector("list", npackets) x.num.limit <- vector("list", npackets) y.num.limit <- vector("list", npackets) dxdy <- vector("list", npackets) for (count in seq_len(npackets)) { if (is.list(panel.args[[count]])) { pargs <- c(panel.args.common, panel.args[[count]], list(...)) tem <- do.call(prepanel.default.function, pargs) if (is.function(prepanel)) ## results will 'overwrite' defaults { prenames <- names(formals(prepanel)) if (!("..." %in% prenames)) pargs <- pargs[intersect(names(pargs), prenames)] pretem <- do.call("prepanel", pargs) ## prepanel() over-rides defaults except NAs - e.g. ylim = c(0, NA) if (!is.null(pretem$xlim) && !is.character(pretem$xlim)) if (any(isna <- is.na(pretem$xlim))) pretem$xlim[isna] <- tem$xlim[isna] if (!is.null(pretem$ylim) && !is.character(pretem$ylim)) if (any(isna <- is.na(pretem$ylim))) pretem$ylim[isna] <- tem$ylim[isna] tem <- updateList(tem, pretem) ## tem[names(pretem)] <- pretem } x.limits[[count]] <- tem$xlim y.limits[[count]] <- tem$ylim x.used.at[[count]] <- if (is.null(tem$xat)) NA else tem$xat y.used.at[[count]] <- if (is.null(tem$yat)) NA else tem$yat x.num.limit[[count]] <- if (is.null(tem$xat)) NA else range(tem$xat) y.num.limit[[count]] <- if (is.null(tem$yat)) NA else range(tem$yat) dxdy[[count]] <- list(dx = tem$dx, dy = tem$dy) } else ## this happens for empty panels { x.limits[[count]] <- c(NA_real_, NA_real_) y.limits[[count]] <- c(NA_real_, NA_real_) x.used.at[[count]] <- NA_real_ y.used.at[[count]] <- NA_real_ x.num.limit[[count]] <- NA_real_ y.num.limit[[count]] <- NA_real_ dxdy[[count]] <- list(dx = NA_real_, dy = NA_real_) } } ## Some explanation might be helpful here. The for loop above ## creates a list of xlims/ylims. Each of these might be either ## numeric (when x/y is numeric, shingle or POSIXt etc), or levels ## of a factor (that's how prepanel.default.functions are set ## up). However, at this point, all x.limits[[i]] must be of the ## same type. Returned limits must be in accordance with this ## type. The only exception is when relation = "free", in which ## case they may be different. This could happen if [xy]lim or ## limits is supplied as a list in the high level function. x.limits <- limitsFromLimitlist(have.lim = have.xlim, lim = xlim, relation = x.relation, limitlist = x.limits, used.at = x.used.at, numlimitlist = x.num.limit, axs = x.axs, npackets = npackets) y.limits <- limitsFromLimitlist(have.lim = have.ylim, lim = ylim, relation = y.relation, limitlist = y.limits, used.at = y.used.at, numlimitlist = y.num.limit, axs = y.axs, npackets = npackets) if (is.character(aspect)) { if (aspect == "xy") { aspect <- median(sapply(dxdy, banking) * y.limits$slicelen / x.limits$slicelen, na.rm = TRUE) ### old aspect calculation ## aspect <- median(unlist(lapply(dxdy, banking)), ## na.rm = TRUE) * y.limits$slicelen / ## x.limits$slicelen ## if (y.relation == "free" || x.relation == "free") ## warning("'aspect=xy' when 'relation=free' is not sensible") } else if (aspect == "iso") { aspect <- median(y.limits$slicelen / x.limits$slicelen, na.rm = TRUE) if (y.relation == "free" || x.relation == "free") warning("'aspect=\"iso\"' approximate since 'relation=\"free\"'") } else aspect <- 1 } list(x.limits = x.limits$limits, y.limits = y.limits$limits, x.used.at = x.limits$used.at, y.used.at = y.limits$used.at, x.num.limit = x.limits$numlimitlist, y.num.limit = y.limits$numlimitlist, aspect.ratio = aspect, prepanel.default = prepanel.default, prepanel = prepanel) } lattice/R/strip.R0000644000176200001440000002533213070415115013366 0ustar liggesusers ### Copyright (C) 2001-2006 Deepayan Sarkar ### ### ### This file is part of the lattice package for R. ### It is made available under the terms of the GNU General Public ### License, version 2, or at your option, any later version, ### incorporated herein by reference. ### ### This program is distributed in the hope that it will be ### useful, but WITHOUT ANY WARRANTY; without even the implied ### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ### PURPOSE. See the GNU General Public License for more ### details. ### ### You should have received a copy of the GNU General Public ### License along with this program; if not, write to the Free ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ### MA 02110-1301, USA ## convenient shortcut to create custom strip functions from ## strip.default. Looks a bit dicey, may not always work :-/ strip.custom <- function(...) { args <- list(...) function(...) { dots <- list(...) do.call("strip.default", updateList(dots, args)) } } paste.and.draw <- function(left, right, sep = " : ", horizontal = TRUE, center = TRUE, showl = TRUE, showr = TRUE, gp = gpar()) { ## We are already in a viewport. Essentially want to draw ## paste(left, right, sep = sep) in the middle. The catch is, ## left and right (maybe even sep) may be expressions. The easy ## solution is to draw sep in the middle and left and right on ## either side. The better solution is to combine and then ## center. if (showl || showr) { shows <- showl && showr wsep <- unit(0.5 * shows, "strwidth", list(sep)) offset <- unit(0.5, "npc") if (center) offset <- offset + (if (showl) unit(0.5, "strwidth", list(left)) else unit(0, "mm")) - (if (showr) unit(0.5 * showr, "strwidth", list(right)) else unit(0, "mm")) if (horizontal) { if (shows) grid.text(sep, x = offset, name = trellis.grobname("sep", type="strip"), gp = gp) if (showl) grid.text(left, x = offset - wsep, name = trellis.grobname("textl", type="strip"), gp = gp, just = "right") if (showr) grid.text(right, x = offset + wsep, name = trellis.grobname("textr", type="strip"), gp = gp, just = "left") } else { if (shows) grid.text(sep, y = offset, name = trellis.grobname("sep", type="strip.left"), gp = gp, rot = 90) if (showl) grid.text(left, y = offset - wsep, name = trellis.grobname("textl", type="strip.left"), gp = gp, just = "right", rot = 90) if (showr) grid.text(right, y = offset + wsep, name = trellis.grobname("textr", type="strip.left"), gp = gp, just = "left", rot = 90) } } } strip.default <- function(which.given, which.panel, ## packet.number, ## panel.number, var.name, factor.levels, shingle.intervals = NULL, strip.names = c(FALSE, TRUE), strip.levels = c(TRUE, FALSE), sep = " : ", style = 1, horizontal = TRUE, ## FIXME: not sure how to incorporate alpha in strip colors bg = trellis.par.get("strip.background")$col[which.given], fg = trellis.par.get("strip.shingle")$col[which.given], par.strip.text = trellis.par.get("add.text")) { if (horizontal) pushViewport(viewport(y = (which.given-0.5)/length(which.panel), height = 1/length(which.panel), clip = trellis.par.get("clip")$strip, name = paste(lattice.getStatus("current.prefix"), "strip.default", which.given, sep = "."))) else pushViewport(viewport(x = 1 - (which.given-0.5)/length(which.panel), width = 1/length(which.panel), clip = trellis.par.get("clip")$strip, name = paste(lattice.getStatus("current.prefix"), "strip.left.default", which.given, sep = "."))) gp.text <- gpar(col = par.strip.text$col, alpha = par.strip.text$alpha, lineheight = par.strip.text$lineheight, fontfamily = par.strip.text$fontfamily, fontface = chooseFace(par.strip.text$fontface, par.strip.text$font), cex = par.strip.text$cex) name <- var.name[which.given] level <- which.panel[which.given] strip.names <- rep(strip.names, length.out = 2) strip.levels <- rep(strip.levels, length.out = 2) ## str(shingle.intervals) formatLabel <- function(s, abbreviate = par.strip.text$abbr, minlength = par.strip.text$minl, dot = par.strip.text$dot) { if (is.null(abbreviate)) abbreviate <- FALSE if (is.null(minlength)) minlength <- 4 if (is.null(dot)) dot <- FALSE if (abbreviate) abbreviate(s, minlength = minlength, dot = dot) else s } factor.levels <- formatLabel(factor.levels) if (!is.null(shingle.intervals)) { ## This usually indicates shingles, as opposed to factors. ## 'style' will be completely ignored, and shingle.intervals ## encoded using bg and fg. Names and levels are both game. if (horizontal) type <- "strip" else type <- "strip.left" grid.rect(name = trellis.grobname("bg", type = type), gp = gpar(fill = bg, col = bg)) t <- range(shingle.intervals) r <- (range(shingle.intervals[level,]) - t[1]) / diff(t) if (horizontal) grid.rect(x = unit(r %*% c(.5,.5),"npc"), width = max(unit(c(diff(r), 1), c("npc", "mm"))), name = trellis.grobname("fg", type="strip"), gp = gpar(col = fg, fill = fg)) else grid.rect(y = unit(r %*% c(.5,.5),"npc"), height = max(unit( c(diff(r), 1), c("npc", "mm"))), name = trellis.grobname("fg", type="strip.left"), gp = gpar(col = fg, fill = fg)) paste.and.draw(name, factor.levels[level], sep = sep, horizontal = horizontal, showl = strip.names[2], showr = strip.levels[2], gp = gp.text) } else { ## Behaviour depends on 'style'. Will separate out coloring ## and text based on 'style'. num <- length(factor.levels) ## coloring: ## background: all except style = 2 if (style != 2) { if (horizontal) type <- "strip" else type <- "strip.left" grid.rect(name = trellis.grobname("bg", type = type), gp = gpar(fill = bg, col = bg)) } ## foreground: needed only for style = 2, 3 and 4 if (num > 0 && style %in% c(2, 3, 4)) { if (horizontal) { grid.rect(x = unit((2*level-1)/(2*num), "npc"), width = unit(1/num, "npc"), name = trellis.grobname("fg", type = "strip"), gp = gpar(fill = fg, col = fg)) } else { grid.rect(y = unit((2*level-1)/(2*num), "npc"), height = unit(1/num, "npc"), name = trellis.grobname("fg", type = "strip.left"), gp = gpar(fill = fg, col = fg)) } } ## text: [names|levels] centered only if style = 1 or 3 if (style %in% c(1, 3)) { paste.and.draw(name, factor.levels[level], sep = sep, horizontal = horizontal, showl = strip.names[1], showr = strip.levels[1], gp = gp.text) } ## remaining cases else if (num > 0) { ## either all levels or only one lid <- if (style %in% c(2, 4)) 1:num else level if (horizontal) { grid.text(label = factor.levels[lid], x = (2 * lid - 1) / (2 * num), name = trellis.grobname("fg", type = "strip"), gp = gp.text) } else { grid.text(label = factor.levels[lid], y = (2 * lid - 1) / (2 * num), rot = 90, name = trellis.grobname("fg", type = "strip.left"), gp = gp.text) } } } upViewport() ## border is drawn with clipping off if (horizontal) pushViewport(viewport(y = (which.given-0.5)/length(which.panel), height = 1/length(which.panel), clip = "off", name = paste(lattice.getStatus("current.prefix"), "strip.default.off", which.given, sep = "."))) else pushViewport(viewport(x = 1 - (which.given-0.5)/length(which.panel), width = 1/length(which.panel), clip = "off", name = paste(lattice.getStatus("current.prefix"), "strip.left.default.off", which.given, sep = "."))) strip.border <- trellis.par.get("strip.border") ## draw border for strip if (horizontal) type <- "strip" else type <- "strip.left" grid.rect(name = trellis.grobname("border", type = type), gp = gpar(col = rep(strip.border$col, length.out = which.given)[which.given], lty = rep(strip.border$lty, length.out = which.given)[which.given], lwd = rep(strip.border$lwd, length.out = which.given)[which.given], alpha = rep(strip.border$alpha, length.out = which.given)[which.given], fill = "transparent")) upViewport() } lattice/LICENSE.note0000644000176200001440000000102013070415115013636 0ustar liggesusers This software is distributed under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As of writing, this essentially boils down to two possible licenses, GPL version 2 and version 3. Copies of these licenses are available in files GPL-2 and GPL-3 in the sources of this package, as well as at http://www.r-project.org/Licenses/ They can also be viewed from within R using RShowDoc("GPL-2") RShowDoc("GPL-3") lattice/demo/0000755000176200001440000000000013070415115012620 5ustar liggesuserslattice/demo/intervals.R0000644000176200001440000000376013070415115014760 0ustar liggesusers library(lattice) ## prepanel and panel function for displaying confidence intervals prepanel.ci <- function(x, y, lx, ux, subscripts, ...) { x <- as.numeric(x) lx <- as.numeric(lx[subscripts]) ux <- as.numeric(ux[subscripts]) list(xlim = range(x, ux, lx, finite = TRUE)) } panel.ci <- function(x, y, lx, ux, subscripts, pch = 16, ...) { x <- as.numeric(x) y <- as.numeric(y) lx <- as.numeric(lx[subscripts]) ux <- as.numeric(ux[subscripts]) panel.abline(h = unique(y), col = "grey") panel.arrows(lx, y, ux, y, col = 'black', length = 0.25, unit = "native", angle = 90, code = 3) panel.xyplot(x, y, pch = pch, ...) } ## constructing an example for confidence intervals for medians (see ## ?boxplot.stats for a discussion of what the intervals mean) singer.split <- with(singer, split(height, voice.part)) singer.ucl <- sapply(singer.split, function(x) { st <- boxplot.stats(x) c(st$stats[3], st$conf) }) singer.ucl <- as.data.frame(t(singer.ucl)) names(singer.ucl) <- c("median", "lower", "upper") singer.ucl$voice.part <- factor(rownames(singer.ucl), levels = rownames(singer.ucl)) singer.ucl with(singer.ucl, dotplot(voice.part ~ median, lx = lower, ux = upper, prepanel = prepanel.ci, panel = panel.ci)) singer.split <- with(singer, split(height, voice.part)) singer.ucl <- sapply(singer.split, function(x) { st <- boxplot.stats(x) c(st$stats[3], st$conf) }) singer.ucl <- as.data.frame(t(singer.ucl)) names(singer.ucl) <- c("median", "lower", "upper") singer.ucl$voice.part <- factor(rownames(singer.ucl), levels = rownames(singer.ucl)) singer.ucl with(singer.ucl, xyplot(voice.part ~ median, lx = lower, ux = upper, prepanel = prepanel.ci, panel = panel.ci)) lattice/demo/00Index0000644000176200001440000000021113070415115013744 0ustar liggesuserslattice Lattice Demos intervals Confidence intervals panel Custom panel functions labels Labels in lattice displays lattice/demo/labels.R0000644000176200001440000000320413070415115014204 0ustar liggesusers ## Demo of expressions x <- rnorm(400) y <- rnorm(400) a <- gl(4, 100) xyplot(y ~ x | a, aspect = "fill", strip = function(factor.levels, strip.names, var.name, ...) { strip.default(factor.levels = expression(alpha, beta, gamma, delta), strip.names = TRUE, var.name = expression(frac(epsilon, 2)), ...) }, par.strip.text = list(lines = 2), xlab=list(expression(sigma[i]), cex = 2), ylab=expression(gamma^2), main=expression(pi*sum(x, i=0, n)), scales= list(relation = "free", x=list(at=c(-2, 0, 2), labels=expression(frac(-pi, 2), 0, frac(pi, 2))), y=list(at=c(-2, 0, 2), labels=expression(alpha, beta, gamma))), key = list(space="right", transparent = TRUE, title = expression(e[i[1]]^{alpha + 2 ^ beta}), cex.title = 2, points=list(pch=1:2), text = list(c('small', 'BIG'), cex = c(.8, 3)), lines = list(lty = 1:2), text=list(expression(theta, zeta))), sub=expression(frac(demonstrating, expressions))) ## grob's as xlab, ylab qq(gl(2, 100) ~ c(runif(100, min = -2, max = 2), rnorm(100)), xlab = textGrob(rep("Uniform", 2), x = unit(.5, "npc") + unit(c(.5, 0), "mm"), y = unit(.5, "npc") + unit(c(0, .5), "mm"), gp = gpar(col = c("black", "red"), cex = 3)), ylab = textGrob(rep("Normal", 2), rot = 90, x = unit(.5, "npc") + unit(c(.5, 0), "mm"), y = unit(.5, "npc") + unit(c(0, .5), "mm"), gp = gpar(col = c("black", "red"), cex = 3)), main = "Q-Q plot") lattice/demo/panel.R0000644000176200001440000000701413070415115014044 0ustar liggesusers panel.stackedDens <- function(x, y, overlap = 0.3, horizontal = TRUE, alpha = plot.polygon$alpha, border = plot.polygon$border, lty = plot.polygon$lty, lwd = plot.polygon$lwd, col = plot.polygon$col, varwidth = FALSE, ref = TRUE, bw = NULL, adjust = NULL, kernel = NULL, window = NULL, width = NULL, n = 50, from = NULL, to = NULL, cut = NULL, na.rm = TRUE, ...) { if (all(is.na(x) | is.na(y))) return() x <- as.numeric(x) y <- as.numeric(y) reference.line <- trellis.par.get("reference.line") plot.polygon <- trellis.par.get("plot.polygon") ## density doesn't handle unrecognized arguments (not even to ## ignore it). A tedious but effective way to handle that is to ## have all arguments to density be formal arguments to this panel ## function, as follows: darg <- list() darg$bw <- bw darg$adjust <- adjust darg$kernel <- kernel darg$window <- window darg$width <- width darg$n <- n darg$from <- from darg$to <- to darg$cut <- cut darg$na.rm <- na.rm my.density <- function(x) do.call("density", c(list(x = x), darg)) numeric.list <- if (horizontal) split(x, factor(y)) else split(y, factor(x)) levels.fos <- as.numeric(names(numeric.list)) d.list <- lapply(numeric.list, my.density) ## n.list <- sapply(numeric.list, length) UNNECESSARY dx.list <- lapply(d.list, "[[", "x") dy.list <- lapply(d.list, "[[", "y") max.d <- sapply(dy.list, max) if (varwidth) max.d[] <- max(max.d) ##str(max.d) xscale <- current.panel.limits()$xlim yscale <- current.panel.limits()$ylim height <- (1 + overlap) if (horizontal) { for (i in rev(seq_along(levels.fos))) { n <- length(dx.list[[i]]) panel.polygon(x = dx.list[[i]][c(1, 1:n, n)], y = levels.fos[i] - 0.5 + height * c(0, dy.list[[i]], 0) / max.d[i], col = col, border = border, lty = lty, lwd = lwd, alpha = alpha) if (ref) { panel.abline(h = levels.fos[i] - 0.5, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, alpha = reference.line$alpha) } } } else { for (i in rev(seq_along(levels.fos))) { n <- length(dx.list[[i]]) panel.polygon(x = levels.fos[i] - 0.5 + height * c(0, dy.list[[i]], 0) / max.d[i], y = dx.list[[i]][c(1, 1:n, n)], col = col, border = border, lty = lty, lwd = lwd, alpha = alpha) if (ref) { panel.abline(v = levels.fos[i] - 0.5, col = reference.line$col, lty = reference.line$lty, lwd = reference.line$lwd, alpha = reference.line$alpha) } } } invisible() } overlap <- 0.3 bwplot(voice.part ~ height, singer, panel = panel.stackedDens, overlap = overlap, lattice.options = list(axis.padding = list(factor = c(0.6, 1 + overlap)))) lattice/demo/lattice.R0000644000176200001440000001422113070415115014370 0ustar liggesusers require(grid) old.prompt <- devAskNewPage(TRUE) ## store current settings, to be restored later old.settings <- trellis.par.get() ## changing settings to new 'theme' trellis.par.set(theme = col.whitebg()) ## simulated example, histogram and kernel density estimate superposed x <- rnorm(500) densityplot(~x) histogram(x, type = "density", panel = function(x, ...) { panel.histogram(x, ...) panel.densityplot(x, col = "brown", plot.points = FALSE) }) ## Using a custom panel function to superpose a fitted normal density ## on a Kernel Density Estimate densityplot( ~ height | voice.part, data = singer, layout = c(2, 4), xlab = "Height (inches)", ylab = "Kernel Density\n with Normal Fit", main = list("Estimated Density", cex = 1.4, col = "DarkOliveGreen"), panel = function(x, ...) { panel.densityplot(x, ...) panel.mathdensity(dmath = dnorm, args = list(mean=mean(x),sd=sd(x))) } ) ## user defined panel functions and fonts states <- data.frame(state.x77, state.name = dimnames(state.x77)[[1]], state.region = factor(state.region)) xyplot(Murder ~ Population | state.region, data = states, groups = state.name, panel = function(x, y, subscripts, groups) ltext(x = x, y = y, labels = groups[subscripts], cex=.9, fontfamily = "HersheySans", fontface = "italic"), par.strip.text = list(cex = 1.3, font = 4, col = "brown"), xlab = list("Estimated Population, July 1, 1975", font = 2), ylab = list("Murder Rate (per 100,000 population), 1976", font = 2), main = list("Murder Rates in US states", col = "brown", font = 4)) ##graphical parameters for xlab etc can also be changed permanently trellis.par.set(list(par.xlab.text = list(font = 2), par.ylab.text = list(font = 2), par.main.text = list(font = 4, col = "brown"))) ## Same with some multiple line text levels(states$state.region) <- c("Northeast", "South", "North\n Central", "West") xyplot(Murder ~ Population | state.region, data = states, groups = as.character(state.name), panel = function(x, y, subscripts, groups) ltext(x = x, y = y, labels = groups[subscripts], srt = -50, col = "blue", cex=.9, fontfamily = "HersheySans"), par.strip.text = list(cex = 1.3, font = 4, col = "brown", lines = 2), xlab = "Estimated Population\nJuly 1, 1975", ylab = "Murder Rate \n(per 100,000 population)\n 1976", main = "Murder Rates in US states") ##setting these back to their defaults trellis.par.set(list(par.xlab.text = list(font = 1), par.ylab.text = list(font = 1), par.main.text = list(font = 2, col = "black"))) ##levelplot levelplot(volcano, colorkey = list(space = "top"), sub = "Maunga Whau volcano", aspect = "iso") ## wireframe wireframe(volcano, shade = TRUE, aspect = c(61/87, 0.4), screen = list(z = -120, x = -45), light.source = c(0,0,10), distance = .2, shade.colors.palette = function(irr, ref, height, w = .5) grey(w * irr + (1 - w) * (1 - (1-ref)^.4))) ## 3-D surface parametrized on a 2-D grid n <- 50 tx <- matrix(seq(-pi, pi, length.out = 2*n), 2*n, n) ty <- matrix(seq(-pi, pi, length.out = n) / 2, 2*n, n, byrow = T) xx <- cos(tx) * cos(ty) yy <- sin(tx) * cos(ty) zz <- sin(ty) zzz <- zz zzz[,1:12 * 4] <- NA wireframe(zzz ~ xx * yy, shade = TRUE, light.source = c(3,3,3)) ## Example with panel.superpose. xyplot(Petal.Length~Petal.Width, data = iris, groups=Species, panel = panel.superpose, type = c("p", "smooth"), span=.75, col.line = trellis.par.get("strip.background")$col, col.symbol = trellis.par.get("strip.shingle")$col, key = list(title = "Iris Data", x = .15, y=.85, corner = c(0,1), border = TRUE, points = list(col=trellis.par.get("strip.shingle")$col[1:3], pch = trellis.par.get("superpose.symbol")$pch[1:3], cex = trellis.par.get("superpose.symbol")$cex[1:3] ), text = list(levels(iris$Species)))) ## non-trivial strip function barchart(variety ~ yield | year * site, barley, origin = 0, layout = c(4, 3), between = list(x = c(0, 0.5, 0)), ## par.settings = list(clip = list(strip = "on")), strip = function(which.given, which.panel, factor.levels, bg = trellis.par.get("strip.background")$col[which.given], ...) { axis.line <- trellis.par.get("axis.line") pushViewport(viewport(clip = trellis.par.get("clip")$strip, name = trellis.vpname("strip"))) if (which.given == 1) { grid.rect(x = .26, just = "right", name = trellis.grobname("fill", type="strip"), gp = gpar(fill = bg, col = "transparent")) ltext(factor.levels[which.panel[which.given]], x = .24, y = .5, adj = 1, name.type = "strip") } if (which.given == 2) { grid.rect(x = .26, just = "left", name = trellis.grobname("fill", type="strip"), gp = gpar(fill = bg, col = "transparent")) ltext(factor.levels[which.panel[which.given]], x = .28, y = .5, adj = 0, name.type = "strip") } upViewport() grid.rect(name = trellis.grobname("border", type="strip"), gp = gpar(col = axis.line$col, lty = axis.line$lty, lwd = axis.line$lwd, alpha = axis.line$alpha, fill = "transparent")) }, par.strip.text = list(lines = 0.4)) trellis.par.set(theme = old.settings, strict = 2) devAskNewPage(old.prompt) lattice/vignettes/0000755000176200001440000000000014773141535013721 5ustar liggesuserslattice/vignettes/grid.Rnw0000644000176200001440000001026314145160206015325 0ustar liggesusers\documentclass[a4paper]{article} \usepackage{Rd} % \VignetteIndexEntry{Integation with grid} % \VignettePackage{lattice} % \VignetteDepends{grid} % Definitions \newcommand{\slan}{{\sffamily S}} \newcommand{\rlan}{{\sffamily R}} \newcommand{\grid}{\pkg{grid}} \newcommand{\lattice}{\CRANpkg{lattice}} \setlength{\parindent}{0in} \setlength{\parskip}{.1in} \setlength{\textwidth}{140mm} \setlength{\oddsidemargin}{10mm} \title{\lattice{} and \grid{}} \author{Paul Murrell} \begin{document} \maketitle The \lattice{} package is built on top of \grid{} and provides a quite sophisticated example of writing high-level plotting functions using \grid{}. Because \lattice{} consists of \grid{} calls, it is possible to both add \grid{} output to \lattice{} output, and \lattice{} output to \grid{} output. <<>>= library(grid) @ \subsection*{Adding \grid{} to \lattice{}} Panel functions in \lattice{} can include \grid{} calls. The following example adds a horizontal line at 0 to a standard \code{xyplot} (see Figure \ref{figure:trellispanel}): <>= library(lattice) <>= x <- rnorm(100) y <- rnorm(100) g <- sample(1:8, 100, replace = TRUE) @ % This is the code the reader sees % This WILL get run by checking code, but by then lattice will be % installed so it will be ok <>= xyplot(y ~ x | g, panel = function(x, y) { panel.xyplot(x, y); grid.lines(unit(c(0, 1), "npc"), unit(0, "native"), gp = gpar(col = "grey")) }) @ % This generates the actual plot <>= <> <> @ \begin{figure}[p] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellispanel} } \end{center} \caption{\label{figure:trellispanel} A \lattice{} panel function using \grid{}.} \end{figure} @ The following example writes a left-justified label in each strip (see Figure \ref{figure:trellisstrip}): <>= xyplot(y ~ x | g, strip = function(which.given, which.panel, ...) { grid.rect() grid.text(paste("Variable ", which.given, ": Level ", which.panel[which.given], sep = ""), unit(1, "mm"), .5, just = "left") }) <>= <> <> @ \begin{figure}[p] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellisstrip} } \end{center} \caption{\label{figure:trellisstrip} A \lattice{} strip function using \grid{}.} \end{figure} \subsection*{Adding \lattice{} to \grid{}} It is also possible to use a \lattice{} plot as an element of a \grid{} image. The following example splits up the page so that there is an \code{xyplot} beside a panel of text (see Figure \ref{figure:trellisgrid}). First of all, the lattice plot is created, but not drawn. \grid{} is used to create some regions and the lattice plot is drawn into one of those regions. <>= someText <- paste("A panel of text", "produced using", "raw grid code", "that could be used", "to describe", "the plot", "to the right.", sep = "\n") latticePlot <- xyplot(y ~ x | g, layout = c(2, 4)) grid.rect(gp = gpar(lty = "dashed")) pushViewport(viewport(layout = grid.layout(1, 2, widths = unit.c(unit(1, "strwidth", someText) + unit(2, "cm"), unit(1, "null"))))) pushViewport(viewport(layout.pos.col = 1)) grid.rect(gp = gpar(fill = "light grey")) grid.text(someText, x = unit(1, "cm"), y = unit(1, "npc") - unit(1, "inches"), just = c("left", "top")) popViewport() pushViewport(viewport(layout.pos.col = 2)) print(latticePlot, newpage = FALSE) popViewport(2) <>= <> <> @ \begin{figure}[tbp] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellisgrid} } \end{center} \caption{\label{figure:trellisgrid} A \lattice{} plot used as a component of a larger \grid{} image.} \end{figure} \end{document} lattice/GPL-20000644000176200001440000004313313070415115012404 0ustar liggesusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. lattice/data/0000755000176200001440000000000014773141535012622 5ustar liggesuserslattice/data/barley.rda0000644000176200001440000000232514773141535014572 0ustar liggesusers_h[UǓ4mjVP{1K{Ӧ=i&cFnEݦ4&&mVTPÞQT= 싢 Ee_ }n~{ι;C#JP($17˨CPܿǦ.B[]q6qBro^~l5~5q/c/i o5?%YɉwowWٗ:Y>/eKo,}WV^t4>;qgjb+~?|%_78?yc-vw o(_wcOclϓL;}qa.r2&xuIҾ#cb =y/T3uمBc]^n, ;޼Ty^Yx\SwKέWu]QࢢqVPM6D/'?I&q8ue!ĉ BhB6e;,t&! (JR4(ʀ2,(00000000000T0T0PV$     |$        |%    m 0 0 0 0 0 0 0L0L0L0L0L0D2000#"'R H=F @Z hr@&49Mhr@v8 gpk;lattice/data/USMortality.rda0000644000176200001440000000123613070415115015533 0ustar liggesusers͕MOAwmUh֋D_X*Áv.ɳWL|x#A񍛉o&0o<3R޲tM𰭴=X^d<mZsC>3$ڎd=ν5)ŒyZ, LcNkOVg(ǡ``|t(B6 fc`\WA?@k|_W/w9_cKlolattice/data/USRegionalMortality.rda0000644000176200001440000000562013070415115017215 0ustar liggesuserskpg$ mm+kKiFHe !JRI66tRZVVqV^*ZZEQq(EV}Ls&;Io{99}w75&H$JeK%ƣ}Mzs7壞L~w"Q:Cc^o??}0%RGcccxG1b| zILKϏދ[[ãrΪ:sPCun!:++\c:{>;P3ߛo-yb[lm-#lNӉ)gM.ꑱ6eR}h]v=3ilKz{ԓU2={RQ3ue*KwzwF}=Q+ӗҚ}As&HZzˣlWl{o6 |Xry-ҹ\oG&ቷoHؒ3;?әkl>͟^y&?A#x&?N[V? }ky"Iܼ?KN m}a^׾nk 󳏆Q㫂uoXwm~G\G\Carǃa]thgB5m;a}o>?r*۲;FuEם ^'X-3s㻛u;8>?=A?36YN1su8TΆyQ=㣭>u0ֳHӴ761nfܛxYxoj;$E3M22̷n(mdKٶE+U1zQC5ZG[VI hue.~8.-> 9^GJuSe|Cǹ@*1._Oc<~ կP}T.~)ޟg_Ӹ;}N8yilUl vm!\^~i)+_Wиk\ɿ}|ʣP :|_ӮS.z w G zq?o>? +azV{SVw~d˿_/tz߭wصG|_G˟W|~~ףwO W??q_?>_︋녏G~y,43ܸ?_'?>S+T?>>BS>(S7k;mO[coY(߯˔oT?𗝲5Q^/qی}_ߴ7/y{% 2kIr0\wST<{}x!x(;]U% d0\ wLrێ?ɍ?_%IONğ/ , nj&2 փ  6 zp8N v;+U`x x-xx=x  oo< G''CS3s`"x| |__oG7c;.1 )8 ~~~ ~~ ~߂߁#8 N'Ip g@_g)hz0,M` z0 z0 z0@=`ЃA=`ЃA=`ЃP z$ z0 z0 z0 z0V z0 z0 z0l@]z0 z0 z0 z0 z0 z0 z0 z0 o=`ЃAnp?xx/ z0 z0 z0 z0 z0 z0 z0 z0 z0;~ z0 z0 z0 z0 z0 z0 z0 z0,9tvא9/Gxo֐ləuo֬fls{sMy3GG%oƛkvYk ϛ~t:@9Gf/!߁wog23;hj΋|!ˈ{}u51CW#w-ϝ<~`o_1w^yk'n8w]6~ fW9 |<}5'?eWedo|!nݷ>Ig?Y5mc}z!bǛ{~'8hopK /]1x:.xGX޾̽wnjmncCnᯁu1;.ٳWn]o_)MSǺC#?`wgJ~k**gy珼z]e?Z~jt^FgU_?r*oz/ٿj}gf?r]5>S5w?>|WM_N/UƻWWʅ3HYV&:&[yn rApm_;j$L[Y-Vr"V!m32]YDg7l\^- 0*LYVAE`JTi(icUȫ_z qu֩ZTrUu_7Hd,< Y#uNȉaL`3 AyLǃNT$0$ӼRr97 s{EqzM%|huyKpbEV/7N~8m<Լ\BmxZTJ+~GC^lAu 1@GA6xR>5} >grQ)wԥo-ƛ<`}/s;uw<; C=غmݲxc]}a#OZԽgpC3tбC 7t֡Sry-Y9C'N :1tbЉC'N 1 b0a A 1Lb0a$I &1Lbİa"E 1,bXİa&M 61lbİa&M 1b8p!C 1\bp%K .1\? lattice/src/0000755000176200001440000000000014773141535012500 5ustar liggesuserslattice/src/threeDplot.h0000644000176200001440000000047613070415115014755 0ustar liggesusers#ifndef LATTICE_THREED_H #define LATTICE_THREED_H #include #include SEXP wireframePanelCalculations(SEXP xArg, SEXP yArg, SEXP zArg, SEXP rotArg, SEXP distanceArg, SEXP nxArg, SEXP nyArg, SEXP ngArg, SEXP lsArg, SEXP env, SEXP shadeArg, SEXP isParSurfArg); #endif lattice/src/init.c0000644000176200001440000000056613070415115013601 0ustar liggesusers #include #include #include #include "threeDplot.h" static R_CallMethodDef CallEntries[] = { {"wireframePanelCalculations", (DL_FUNC) &wireframePanelCalculations, 12}, {NULL, NULL, 0} }; void R_init_lattice(DllInfo *dll) { R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); R_useDynamicSymbols(dll, FALSE); } lattice/src/threeDplot.c0000644000176200001440000003674713070415115014762 0ustar liggesusers#include "threeDplot.h" static void calculate_angles(double *x, double *y, double *z, double *ls, double *misc, double distance) { double x1, x2, y1, y2, z1, z2, len; double xl, yl, zl, xe, ye, ze; /* light source and eye */ double xn, yn, zn, xr, yr, zr; /* normal and reflected ray */ /* We have: * three points defining the plane (x, y, z) * a light source * an implicit viewing point (0, 0, 1/distance) * We want (to be put into misc): * (1) angle between incident light and normal (measure of foreshortening). We will return the cosine of this angle, which will be 1 at its brightest and 0 when 90 degree, which is perfect as an irradiance measure * (2) angle between reflected light and direction of viewing. Again, we will calculate the cosine of this angle, which will be 1 for full reflectance and 0 at minimum. * To start with, we will arbitrarily choose the first point as * the origin and shift everything by that amount. */ x1 = x[1] - x[0]; y1 = y[1] - y[0]; z1 = z[1] - z[0]; x2 = x[2] - x[0]; y2 = y[2] - y[0]; z2 = z[2] - z[0]; xl = ls[0] - x[0]; yl = ls[1] - y[0]; zl = ls[2] - z[0]; xe = -x[0]; ye = -y[0]; if (distance == 0) ze = 10000 - z[0]; else ze = 1/distance - z[0]; /* We now want the normal to the plane defined by the 3 points, i.e., by (0,0,0), (x1, y1, z1) and (x2, y2, z2). This is in the direction of a = (y1 z2 - y2 z1, z1 x2 - z2 x1, x1 y2 - x2 y1) -- to see this, just note that a'x = 0 for these two points and solve for a. any valid a lies along the normal. */ xn = y1 * z2 - y2 * z1; yn = z1 * x2 - z2 * x1; zn = x1 * y2 - x2 * y1; /* There's no question of any lighting if the light source any eye are not on the same side of the surface. This happens when a'x has the same sign for x = xe and x = xl (and a = xn) */ if ((xe * xn + ye * yn + ze * zn) * (xl * xn + yl * yn + zl * zn) < 0) { /* light source and eye on opposite sides */ misc[0] = 0; misc[1] = 0; return; } /* We also need to make sure that the normal vector we use is also in the same side as everything else */ if (xl * xn + yl * yn + zl * zn < 0) { /* xe would also have worked */ xn *= (-1); yn *= (-1); zn *= (-1); } /* the cosine of the angle between incident light and normal is now trivial -- it's simply the normalized inner product */ misc[0] = xl * xn + yl * yn + zl * zn; if (misc[0] != 0) misc[0] /= sqrt((xl * xl + yl * yl + zl * zl) * (xn * xn + yn * yn + zn * zn)); /* for the cosine of the angle between the reflected light and the eye, we first need a point along the reflected ray. For this, we are going to calculate the reflection of the light source on the normal. For this, we first need the projection of the light source along the normal, which is given by len . x_n (x_n being the normal) where len is a scalar given by / ||x_n||^2. */ len = (xl * xn + yl * yn + zl * zn); if (len != 0) len /= (xn * xn + yn * yn + zn * zn); /* x_r, The reflection of x_l, is then x_r = x_l + 2 . (len . x_n - x_l) = 2 . len . x_n - x_l */ xr = 2 * len * xn - xl; yr = 2 * len * yn - yl; zr = 2 * len * zn - zl; /* And so, we can now calculate the cosine of the angle between the reflected light and the eye. */ misc[1] = xr * xe + yr * ye + zr * ze; if (misc[1] != 0) misc[1] /= sqrt((xr * xr + yr * yr + zr * zr) * (xe * xe + ye * ye + ze * ze)); /* But that angle can range from 0 to 180, and we really want the result to be 1 at 0, going down to 0 at 180. So, let's calculate cosine of half this angle, and take cos again */ misc[1] = cos(acos(misc[1]) / 2); if (misc[0] < 0 || misc[1] < 0) error("bug in wireframe calculations: cosines supposed to be non-negative but not"); return; } SEXP wireframePanelCalculations(SEXP xArg, SEXP yArg, SEXP zArg, SEXP rotArg, SEXP distanceArg, SEXP nxArg, SEXP nyArg, SEXP ngArg, SEXP lsArg, SEXP env, SEXP shadeArg, SEXP isParSurfArg) { /* Arguments supplied */ double *x; /* increasing vector of unique x values */ double *y; /* increasing vector of unique y values */ double *z; /* long vector of z values, length = nx * ny * ng */ double *rot; /* rotation matrix 4x4 (homogeneous coordinates, as vector) */ double distance; /* for perspective calculations */ int nx, ny, ng; /* length of x, y and number of groups (conceptually ncol(z))*/ double *ls; /* light source coordinates (norm 1) */ int shade; /* whether shading is being done (1 : yes, 0 : no */ int isparsurf; /* whether we are drawing a parametrized surface, in which case x y z are all matrices parametrized on a regular (unknown) 2-D grid */ /* Other variables */ SEXP call, sHeights, sxx, syy, szz, smisc; double *heights, *pxx, *pyy, *pzz, *misc; int *horder; int nh, i, k; double xx[4], yy[4], zz[4]; double uxx[4], uyy[4], uzz[4]; /* without perspective */ x = REAL(xArg); y = REAL(yArg); z = REAL(zArg); rot = REAL(rotArg); distance = asReal(distanceArg); ls = REAL(lsArg); nx = asInteger(nxArg); ny = asInteger(nyArg); ng = asInteger(ngArg); shade = asInteger(shadeArg); isparsurf = asInteger(isParSurfArg); /* depths (called height here) correspond to all the rectangles * in the grid. The indexing is conceptually according to the * lower left corner of the rectangle. Thus, the length of * heights is (nx-1)*(ny-1)*ng. Given i, would later need to * figure out which rectangle this corresponds to */ nh = (nx-1) * (ny-1) * ng; /* number of quadrilaterals */ sHeights = PROTECT(allocVector(REALSXP, nh)); heights = REAL(sHeights); /* printf("\nStarting depth calculation..."); */ /* Depth Calculation: we need to determine the order in which the * quadrilaterals are to be drawn. However, It is not clear what * would be a good criteria to do this. */ /* Depth of nearest and farthest corners both have problems. Changing to average depth. This still has problems, but less frequently */ for (i = 0; i < nh; i++) { double tx, ty, tz, th; int tgi, ti; int txi00, tyi00, tzi00; int txi01, tyi01, tzi01; int txi11, tyi11, tzi11; int txi10, tyi10, tzi10; tgi = i / ((nx-1)*(ny-1)); /* group index */ ti = i % ((nx-1)*(ny-1)); /* height index w/in group */ tyi00 = ti % (ny-1); /* y index - (0,0) corner */ txi00 = ti / (ny-1); /* x index - (0,0) corner */ tyi10 = tyi00; /* y index - (1,0) corner */ txi10 = txi00 + 1; /* x index - (1,0) corner */ tyi11 = tyi00 + 1; /* y index - (1,1) corner */ txi11 = txi00 + 1; /* x index - (1,1) corner */ tyi01 = tyi00 + 1; /* y index - (0,1) corner */ txi01 = txi00; /* x index - (0,1) corner */ tzi00 = tgi * nx * ny + txi00 * ny + tyi00; /* z index */ tzi10 = tgi * nx * ny + txi10 * ny + tyi10; /* z index */ tzi11 = tgi * nx * ny + txi11 * ny + tyi11; /* z index */ tzi01 = tgi * nx * ny + txi01 * ny + tyi01; /* z index */ if (isparsurf) { /* x,y indices same as z */ tyi00 = tzi00; txi00 = tzi00; tyi10 = tzi10; txi10 = tzi10; tyi11 = tzi11; txi11 = tzi11; tyi01 = tzi01; txi01 = tzi01; } /* (0,0) corner */ tx = x[txi00]; ty = y[tyi00]; tz = z[tzi00]; heights[i] = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); /* (1,0) corner */ tx = x[txi10]; ty = y[tyi10]; tz = z[tzi10]; th = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); /*WAS: if (th > heights[i]) heights[i] = th; similar below*/ /* Why change? causes problems with 3D histogram type plots. changing back. Revisit later (FIXME) */ /* if (th > heights[i]) heights[i] = th; */ /* Still problems, so changing to average depth */ heights[i] += th; /* (1,1) corner */ tx = x[txi11]; ty = y[tyi11]; tz = z[tzi11]; th = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); /* if (th > heights[i]) heights[i] = th; */ heights[i] += th; /* (0,1) corner */ tx = x[txi01]; ty = y[tyi01]; tz = z[tzi01]; th = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); /* if (th > heights[i]) heights[i] = th; */ heights[i] += th; heights[i] /= 4.0; } /* Rprintf("\nFinished depth calculation, ordering...\n"); */ call = PROTECT(lang2(install("order"), sHeights)); sHeights = eval(call, R_GlobalEnv); UNPROTECT(2); horder = INTEGER(PROTECT(sHeights)); /* printf("\nFinished ordering, proceeding..."); */ if (shade == 1) { sxx = PROTECT(allocVector(REALSXP, 3)); syy = PROTECT(allocVector(REALSXP, 3)); szz = PROTECT(allocVector(REALSXP, 3)); } else { sxx = PROTECT(allocVector(REALSXP, 4)); syy = PROTECT(allocVector(REALSXP, 4)); szz = PROTECT(allocVector(REALSXP, 4)); } smisc = PROTECT(allocVector(REALSXP, 4)); pxx = REAL(sxx); pyy = REAL(syy); pzz = REAL(szz); misc = REAL(smisc); /* misc: 0: cos angle between normal and incident light 1: cos angle between reflected light and eye 2: original z-height averaged 3: group indicator */ call = PROTECT(lang4(install("wirePolygon"), sxx, syy, smisc)); /* Rprintf("\nShade = %d, isparsurf = %d...\n", shade, isparsurf); Rprintf("\n nx = %d, ny = %d, nh = %d\n", nx, ny, nh); */ for (i = 0; i < nh; i++) { double tx, ty, tz, txx, tyy, tzz, tmp; int tgi, ti, anyNaOrNan; int txi00, tyi00, tzi00; int txi01, tyi01, tzi01; int txi11, tyi11, tzi11; int txi10, tyi10, tzi10; ti = horder[i] - 1; /* will draw ti-th facet now */ tgi = ti / ((nx-1)*(ny-1)); /* group index */ ti = ti % ((nx-1)*(ny-1)); /* height index w/in group */ tyi00 = ti % (ny-1); /* y index - (0,0) corner */ txi00 = ti / (ny-1); /* x index - (0,0) corner */ tyi10 = tyi00; /* y index - (1,0) corner */ txi10 = txi00 + 1; /* x index - (1,0) corner */ tyi11 = tyi00 + 1; /* y index - (1,1) corner */ txi11 = txi00 + 1; /* x index - (1,1) corner */ tyi01 = tyi00 + 1; /* y index - (0,1) corner */ txi01 = txi00; /* x index - (0,1) corner */ tzi00 = tgi * nx * ny + txi00 * ny + tyi00; /* z index */ tzi10 = tgi * nx * ny + txi10 * ny + tyi10; /* z index */ tzi11 = tgi * nx * ny + txi11 * ny + tyi11; /* z index */ tzi01 = tgi * nx * ny + txi01 * ny + tyi01; /* z index */ if (isparsurf) { /* x,y indices same as z */ tyi00 = tzi00; txi00 = tzi00; tyi10 = tzi10; txi10 = tzi10; tyi11 = tzi11; txi11 = tzi11; tyi01 = tzi01; txi01 = tzi01; } misc[3] = (double) tgi + 1; misc[2] = 0; /* (0,0) corner */ tx = x[txi00]; ty = y[tyi00]; tz = z[tzi00]; if (isparsurf) misc[2] += sqrt(tx * tx + ty * ty + tz * tz); else misc[2] += tz; tmp = (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); txx = (rot[0] * tx + rot[4] * ty + rot[8] * tz + rot[12]) / tmp; tyy = (rot[1] * tx + rot[5] * ty + rot[9] * tz + rot[13]) / tmp; tzz = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / tmp; uxx[0] = txx; uyy[0] = tyy; uzz[0] = tzz; if (distance != 0) { txx /= (1/distance - tzz); tyy /= (1/distance - tzz); } xx[0] = txx; yy[0] = tyy; zz[0] = tzz; /* (1,0) corner */ tx = x[txi10]; ty = y[tyi10]; tz = z[tzi10]; if (isparsurf) misc[2] += sqrt(tx * tx + ty * ty + tz * tz); else misc[2] += tz; tmp = (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); txx = (rot[0] * tx + rot[4] * ty + rot[8] * tz + rot[12]) / tmp; tyy = (rot[1] * tx + rot[5] * ty + rot[9] * tz + rot[13]) / tmp; tzz = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / tmp; uxx[1] = txx; uyy[1] = tyy; uzz[1] = tzz; if (distance != 0) { txx /= (1/distance - tzz); tyy /= (1/distance - tzz); } xx[1] = txx; yy[1] = tyy; zz[1] = tzz; /* (1,1) corner */ tx = x[txi11]; ty = y[tyi11]; tz = z[tzi11]; if (isparsurf) misc[2] += sqrt(tx * tx + ty * ty + tz * tz); else misc[2] += tz; tmp = (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); txx = (rot[0] * tx + rot[4] * ty + rot[8] * tz + rot[12]) / tmp; tyy = (rot[1] * tx + rot[5] * ty + rot[9] * tz + rot[13]) / tmp; tzz = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / tmp; uxx[2] = txx; uyy[2] = tyy; uzz[2] = tzz; if (distance != 0) { txx /= (1/distance - tzz); tyy /= (1/distance - tzz); } xx[2] = txx; yy[2] = tyy; zz[2] = tzz; /* (0,1) corner */ tx = x[txi01]; ty = y[tyi01]; tz = z[tzi01]; if (isparsurf) misc[2] += sqrt(tx * tx + ty * ty + tz * tz); else misc[2] += tz; tmp = (rot[3] * tx + rot[7] * ty + rot[11] * tz + rot[15]); txx = (rot[0] * tx + rot[4] * ty + rot[8] * tz + rot[12]) / tmp; tyy = (rot[1] * tx + rot[5] * ty + rot[9] * tz + rot[13]) / tmp; tzz = (rot[2] * tx + rot[6] * ty + rot[10] * tz + rot[14]) / tmp; uxx[3] = txx; uyy[3] = tyy; uzz[3] = tzz; if (distance != 0) { txx /= (1/distance - tzz); tyy /= (1/distance - tzz); } xx[3] = txx; yy[3] = tyy; zz[3] = tzz; /* Done with all four corners */ misc[2] /= 4; /* average height */ if (shade == 1) { /* two different triangles will be drawn, given by indices 0, 1, 2 and 2, 3, 0 */ /* first, 0,1,2 */ for (k = 0; k < 3; k++) { pxx[k] = uxx[k]; pyy[k] = uyy[k]; pzz[k] = uzz[k]; } calculate_angles(pxx, pyy, pzz, ls, misc, distance); anyNaOrNan = 0; for (k = 0; k < 3; k++) { pxx[k] = xx[k]; pyy[k] = yy[k]; pzz[k] = zz[k]; if (ISNAN(pxx[k]) || ISNAN(pyy[k]) || ISNAN(pzz[k])) anyNaOrNan = 1; } if (anyNaOrNan == 0) eval(call, env); /* same again, but replace 1 by 3 */ for (k = 0; k < 3; k++) { pxx[k] = uxx[k]; pyy[k] = uyy[k]; pzz[k] = uzz[k]; } pxx[1] = uxx[3]; pyy[1] = uyy[3]; pzz[1] = uzz[3]; calculate_angles(pxx, pyy, pzz, ls, misc, distance); anyNaOrNan = 0; for (k = 0; k < 3; k++) { pxx[k] = xx[k]; pyy[k] = yy[k]; pzz[k] = zz[k]; if (k!=1 && (ISNAN(pxx[k]) || ISNAN(pyy[k]) || ISNAN(pzz[k]))) anyNaOrNan = 1; } pxx[1] = xx[3]; pyy[1] = yy[3]; pzz[1] = zz[3]; if (ISNAN(pxx[1]) || ISNAN(pyy[1]) || ISNAN(pzz[1])) anyNaOrNan = 1; if (anyNaOrNan == 0) eval(call, env); } else { anyNaOrNan = 0; for (k = 0; k < 4; k++) { pxx[k] = xx[k]; pyy[k] = yy[k]; pzz[k] = zz[k]; if (ISNAN(pxx[k]) || ISNAN(pyy[k]) || ISNAN(pzz[k])) anyNaOrNan = 1; } if (anyNaOrNan == 0) eval(call, env); } } UNPROTECT(6); return R_NilValue; } lattice/ChangeLog0000644000176200001440000101731614772676012013476 0ustar liggesusers commit cbe2a8a3eb074314eb9f49985c501f852261c36f Author: Deepayan Sarkar Date: Mon Mar 31 17:42:35 2025 +0530 update as.data.frame.shingle method M DESCRIPTION M R/shingle.R commit 757d099b587878a507f3e493231bd519fbf70970 Merge: f216545 3e29698 Author: Deepayan Sarkar Date: Fri Apr 26 15:37:41 2024 +0530 Merge pull request #40 from MichaelChirico/partial-matching Fix partial matching issues in tests commit 3e29698999d3d8cee8dc9f90d1d0815c5803670c Author: Michael Chirico Date: Wed Apr 24 23:09:22 2024 -0700 second batch of fixes M tests/MASSch04.R M tests/dataframe-methods.R M tests/temp.R M tests/test.R commit e2dc8063d20ab8cbb928a9c9953f275b6ec098b3 Author: Michael Chirico Date: Wed Apr 24 22:51:59 2024 -0700 fix partial matching issues M tests/MASSch04.R M tests/call.R M tests/scales.R M tests/test.R commit f216545a541cc346ba429938afa9f5ae6cdf3bb4 Author: Deepayan Sarkar Date: Mon Oct 23 16:34:06 2023 -0400 reimplementation of data.frame methods M DESCRIPTION M R/bwplot.R M R/cloud.R A R/dataframe-methods.R M R/densityplot.R M R/histogram.R M R/levelplot.R M R/qq.R M R/qqmath.R M R/tmd.R M R/xyplot.R M tests/dataframe-methods.R M tests/levelplot.R commit a5a55214cc8c5847f8bfc0911250a8acfc0ae29a Author: Deepayan Sarkar Date: Sat Oct 21 23:54:52 2023 -0400 update changelog and translations M ChangeLog M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M po/R-de.po M po/R-fr.po M po/R-it.po M po/R-ko.po M po/R-lattice.pot M po/R-pl.po commit 422afecd82ba2f74c8a89bb2a5539ba5f9af7bc2 Author: Deepayan Sarkar Date: Sat Oct 21 23:49:27 2023 -0400 new data.frame methods for high-level functions; make parallel() defunct M DESCRIPTION M NAMESPACE M NEWS.md M R/bwplot.R M R/cloud.R M R/densityplot.R M R/histogram.R M R/levelplot.R M R/parallel.R M R/qq.R M R/qqmath.R M R/tmd.R M R/xyplot.R M man/cloud.Rd M man/histogram.Rd M man/levelplot.Rd M man/qq.Rd M man/qqmath.Rd M man/tmd.Rd M man/xyplot.Rd A tests/dataframe-methods.R M tests/levelplot.R commit e724f26aa43f9c015317450ad0327288e4696f61 Author: Deepayan Sarkar Date: Sun Oct 15 10:32:04 2023 -0400 add zoo to Enhances to skip check warning about external help refs M DESCRIPTION commit 7c9d9f3bab06eb4336df6c7d154d116af836ca8b Author: Deepayan Sarkar Date: Sat Oct 14 23:08:49 2023 -0400 updated examples M man/llines.Rd commit f26abbfee1650e60f2c71b8f452e4b50b4abf315 Author: Deepayan Sarkar Date: Sat Oct 14 22:55:49 2023 -0400 add new primitive lpolypath() etc as interface to grid.path() M NAMESPACE M R/miscellaneous.R M man/llines.Rd commit 2e269fd727e072d548c20c54c67b10c5e4eaa5c7 Author: Deepayan Sarkar Date: Sat Oct 14 22:54:59 2023 -0400 clarify how to revert to old theme (#35) M NEWS.md M man/standard.theme.Rd commit 4dda4d184732c4e11fb8b7481a78c1df84e2abad Author: Deepayan Sarkar Date: Tue Oct 10 17:07:42 2023 -0400 support for holes via grid.path() in lpolygon.default M DESCRIPTION M NEWS.md M R/miscellaneous.R M man/llines.Rd commit 2cb437dab814d93e8fce03427f1c9a939a05a346 Merge: 148fb35 33c34f3 Author: Deepayan Sarkar Date: Mon Oct 2 11:27:29 2023 -0400 Merge pull request #30 from courtiol/misc_generics Add generics for larrows, lpolygon, lrect and lsegments (fixes #29) commit c3ccbc72793cd490696a281f6fb994fdafe24d42 Author: Deepayan Sarkar Date: Sat Sep 30 18:28:34 2023 -0400 update changelog M ChangeLog M DESCRIPTION M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M po/R-lattice.pot commit e2f44f54c40204737e6e7689904801fbea5df67d Author: Deepayan Sarkar Date: Thu May 18 18:07:18 2023 +0530 update version M DESCRIPTION commit d3dc7116a6d9e9457e5a2b0e1c5c8c11d70cd60a Author: Deepayan Sarkar Date: Thu May 4 13:47:06 2023 +0530 fix instances of partially matched argument names M R/panel.smoothscatter.R M R/xyplot.ts.R M man/trellis.par.get.Rd commit b5026367e98e25be50a398d76edf3c9e05034e46 Author: Deepayan Sarkar Date: Wed Apr 5 21:45:30 2023 +0530 more specific className to avoid conflicts M DESCRIPTION M NAMESPACE M R/legend.R commit e89a8293a479531fe1f4ab355243387bc45ca2df Author: Deepayan Sarkar Date: Tue Apr 4 19:41:29 2023 +0530 wireframe examples + misc cleanup M DESCRIPTION M NAMESPACE M NEWS.md M R/settings.R M man/panel.cloud.Rd M tests/MASSch04.R M tests/auto-key.R M tests/barchart-width.R M tests/fontsize.R M tests/levelplot.R M tests/shade-wireframe.R M tests/wireframe.R commit 7150755c4e0f433acd366edcc70fb1be01bbbfbb Author: Deepayan Sarkar Date: Tue Apr 4 17:20:37 2023 +0530 specify namespace M R/bwplot.R commit 653b3c9598aa07308d1f089e4ef48b4a4c18b041 Author: Deepayan Sarkar Date: Tue Apr 4 17:06:15 2023 +0530 translation message updates M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M po/R-de.po M po/R-fr.po M po/R-it.po M po/R-ko.po M po/R-lattice.pot M po/R-pl.po commit 130b7cdab1e2facfd5e1cbb93b76ef6b605af3f1 Author: Deepayan Sarkar Date: Tue Apr 4 17:05:14 2023 +0530 better handling of degenerate data in panel.violin (https://github.com/deepayan/lattice/issues/27) M R/bwplot.R commit b9c47693d11d9f93529d1d23cf5da74e8de480f9 Author: Deepayan Sarkar Date: Tue Apr 4 16:30:08 2023 +0530 allow defaults of 'auto.key' and 'grid' to be set using lattice.options() M R/bwplot.R M R/cloud.R M R/densityplot.R M R/histogram.R M R/panel.superpose.R M R/parallel.R M R/qqmath.R M R/splom.R M R/xyplot.R M man/USMortality.Rd M man/cloud.Rd M man/ethanol.Rd M man/histogram.Rd M man/lattice.options.Rd M man/panel.densityplot.Rd M man/panel.dotplot.Rd M man/panel.functions.Rd M man/panel.stripplot.Rd M man/panel.superpose.Rd M man/panel.xyplot.Rd M man/qqmath.Rd M man/singer.Rd M man/splom.Rd M man/xyplot.Rd commit e687211913d4b49c018bcc9294d93b8f81a600a6 Author: Deepayan Sarkar Date: Tue Apr 4 16:28:52 2023 +0530 bugfix: properly replace legend components in update.trellis() instead of trying to combine M R/update.trellis.R commit 0fe353f4560582c91efe5a4e1216febebf4289b2 Author: Deepayan Sarkar Date: Tue Apr 4 16:27:03 2023 +0530 hard-code fill for default theme to bypass colorspace (breaks tests for a couple of revdeps) M R/settings.R commit fb2a990b22a41301754b8e484da95a14c3e09f8d Author: Deepayan Sarkar Date: Tue Apr 4 11:33:53 2023 +0530 include title when calculating key width in draw.key M NAMESPACE M R/legend.R commit 5cd2d22369d4ec96f13a27794eff0ebdd2217d60 Author: Deepayan Sarkar Date: Sat Apr 1 16:58:14 2023 +0530 use region colors from settings in panel.smoothScatter M R/panel.smoothscatter.R M man/panel.smoothScatter.Rd M tests/levelplot.R commit b403f3ef31b63bc4c93193b72a3ee7ea35859279 Author: Deepayan Sarkar Date: Sat Apr 1 16:22:29 2023 +0530 change default wireframe shade colors to depend on region colors M NAMESPACE M R/settings.R commit f59e060a25bc4ce0242ec97eb2914cc81b1b03b6 Author: Deepayan Sarkar Date: Sat Apr 1 13:08:31 2023 +0530 updated NEWS M NEWS.md commit 3cf19a8be2cbf063e7563e27859985d8f31bded0 Author: Deepayan Sarkar Date: Sat Apr 1 13:08:17 2023 +0530 fix typo in docs M man/levelplot.Rd commit dcb5dc835607d0188bccb7fbb7ac49ce314addf6 Author: Deepayan Sarkar Date: Sat Apr 1 11:53:29 2023 +0530 finish doc updates for settings changes M R/settings.R M man/standard.theme.Rd M man/trellis.par.get.Rd commit 5e91497ee4c1fdac79f60d53d56e11282a984948 Author: Deepayan Sarkar Date: Fri Mar 31 16:27:05 2023 +0530 doc updates (incomplete) for new theme settings M R/settings.R A man/standard.theme.Rd M man/trellis.device.Rd commit 111a69b7e5bebddd1f8e1ba5abbcdd2763677e27 Author: Deepayan Sarkar Date: Fri Mar 31 13:08:09 2023 +0530 levelplot(region.type='contour') refinements M DESCRIPTION M R/levelplot.R M man/panel.levelplot.Rd M tests/levelplot.R commit 11a93a6de80a3e2a646bd34e66051284e1e7b9bb Author: Deepayan Sarkar Date: Fri Mar 31 12:32:52 2023 +0530 remove unneeded file D inst/COPYRIGHTS commit 1cd2faf3c9fcf88b740550f2b84fc46c97f57bf7 Merge: 5f98e3c 7287855 Author: Deepayan Sarkar Date: Fri Mar 31 12:31:42 2023 +0530 Merge branch 'jolars-filled-contour' commit 72878555527e870438b3d79a0d7233b25d94ff2a Merge: 5f98e3c f60d57c Author: Deepayan Sarkar Date: Fri Mar 31 12:30:34 2023 +0530 merge jolars:filled-contour (https://github.com/deepayan/lattice/pull/14) with some reformatting commit 5f98e3c6da2277ed946163626f0da9b8860c55b7 Merge: 65527f4 c368aca Author: Deepayan Sarkar Date: Fri Mar 31 12:06:14 2023 +0530 Merge pull request #31 from zeileis/hcl-theme New color defaults commit c368acacb242e1916df7d3637fbc6b7bd067e30a Merge: 3229981 65527f4 Author: Deepayan Sarkar Date: Fri Mar 31 12:05:48 2023 +0530 Merge branch 'master' into hcl-theme commit 32299819c9ed4fae64a996e5babe38fa39d73659 Author: Achim Zeileis Date: Fri Mar 31 08:21:53 2023 +0200 14 instead of 12 YlGnBu colors for region M R/settings.R commit 65527f4b6d7f63da36d1fe2dd579e43a1c7206e2 Author: Deepayan Sarkar Date: Fri Mar 31 11:50:06 2023 +0530 barchart width bugfix M R/bwplot.R commit 0220063112f978b9426ac5501812c339715b719e Author: Achim Zeileis Date: Fri Mar 31 02:57:21 2023 +0200 replace gray hex codes more intelligible named gray colors: #e8e8e8 -> gray90 / #f2f2f2 -> gray95 / #b2b2b2 -> gray70 M R/settings.R commit e2dfba164fbd6d9dc4772458920cf8013fb131ac Author: Achim Zeileis Date: Fri Mar 31 02:08:57 2023 +0200 use named 'gray90' for reference instead of less accessible '#e8e8e8' M R/settings.R commit 998171614c4a1aff858ac774dc7077f09108cb59 Author: Achim Zeileis Date: Fri Mar 31 02:05:45 2023 +0200 Symbol colors are still Okabe-Ito ordered slightly differently, less exact match to old palette but hopefully somewhat more contrast within palette. Fill colors are set to NULL which defaults to using symbol colors lightened with factor 0.4 (in HCL space). M R/settings.R commit 7f3e0566222870e60f06e48f1e4f907edf810d5d Author: Achim Zeileis Date: Fri Mar 31 01:05:18 2023 +0200 Import required functionality from grDevices (e.g., palette.colors) from grDevices and hence make sure that at least R 4.0.0 is used. Extend internal lower.saturation() function by space = "RGB" vs. "HCL" argument. For HCL ideally colorspace::lighten() is used in case colorspace is available (hence now in DESCRIPTION/Suggests). In case colorspace is not available, for space = "HCL" an approximation is used via grDevices::convertColor(..., to = "Luv") which only lowers the "L" (luminance) coordinate but does not make sure that "C" (chroma) is reduced to the maximum possible. M DESCRIPTION M NAMESPACE M R/settings.R commit f934cfe6e3d5ffb32a3d6a3624224816ebee1b17 Author: Deepayan Sarkar Date: Thu Mar 30 16:26:28 2023 +0530 smarter auto.key in update.trellis M R/bwplot.R M R/update.trellis.R M tests/auto-key.R commit 169c8fd516b5fce910157dec557fc8ac56eb58e1 Author: Deepayan Sarkar Date: Thu Mar 30 14:48:19 2023 +0530 auto.key and wireframe shade=TRUE tests A tests/auto-key.R A tests/shade-wireframe.R M tests/wireframe.R commit 2088637fc9fce5455bc626b4edbc75812b6feba5 Author: Achim Zeileis Date: Wed Mar 29 13:05:28 2023 +0200 use hcl.colors - defaulting to viridis - instead of old-style RGB topo.colors/terrain.colors/rainbow M man/level.colors.Rd M man/levelplot.Rd M man/panel.levelplot.Rd M man/panel.pairs.Rd commit efce0dec9e022485347fabb6b8181e5bc0c19d1d Author: Achim Zeileis Date: Wed Mar 29 13:04:14 2023 +0200 use palette.colors() rather than hcl.colors() for qualitative palette; avoid deutan() emulation in region colors M R/settings.R commit e57b70b07869a6bd7b97bc978b621074e2427e88 Author: Deepayan Sarkar Date: Wed Mar 29 13:23:06 2023 +0530 refactor auto.key handling, smarter defaults for splom(), better default placement M R/bwplot.R M R/cloud.R M R/densityplot.R M R/histogram.R M R/legend.R M R/parallel.R M R/qqmath.R M R/settings.R M R/splom.R M R/update.trellis.R M R/xyplot.R commit 85c2e409fc447d251180d8399fdf6dc0049b9d72 Author: Deepayan Sarkar Date: Wed Mar 29 10:47:24 2023 +0530 updated default theme with hcl-based palette M NAMESPACE M NEWS.md M R/settings.R commit 9ea4be13e392552f174849f32f29dfc42225d754 Author: Deepayan Sarkar Date: Tue Mar 28 21:34:59 2023 +0530 translation file updates M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M po/R-de.po M po/R-fr.po M po/R-it.po M po/R-ko.po M po/R-lattice.pot M po/R-pl.po commit 26893d5da7ac9c1969fac720ad4a61df87122bae Author: Deepayan Sarkar Date: Tue Mar 28 21:02:37 2023 +0530 Explicit markdown formatting for NEWS M NEWS.md commit 38ac50fa8e851b290e8c2e13cfa5ccb51673e306 Author: Deepayan Sarkar Date: Tue Mar 28 20:52:35 2023 +0530 Improve NEWS entry language M NEWS.md commit d8d9d23d6f231ca7523515a83d536e50919c1f13 Merge: 9dd2a5c 1de2bb1 Author: Deepayan Sarkar Date: Tue Mar 28 20:44:07 2023 +0530 Merge branch 'master' of github.com:deepayan/lattice commit 9dd2a5c2c2f5087b92e509af8831fdc020892fa7 Author: Deepayan Sarkar Date: Tue Mar 28 20:43:00 2023 +0530 added new 'smooth' argument in panel.xyplot() as a preferred alternative to using 'type' M R/xyplot.R M man/panel.xyplot.Rd commit 1de2bb1537a9303c826df691504aacfe46aa34e9 Author: Deepayan Sarkar Date: Tue Mar 28 18:08:27 2023 +0530 better auto.key behaviour for xyplot, change default placement M DESCRIPTION M R/bwplot.R M R/cloud.R M R/densityplot.R M R/histogram.R M R/parallel.R M R/qqmath.R M R/splom.R M R/update.trellis.R M R/xyplot.R commit 28e1b2a2aedbc9ad85d2831b1eea6927ab1b9b3f Merge: 4e77c57 81081e7 Author: Deepayan Sarkar Date: Tue Mar 28 16:51:12 2023 +0530 Merge branch 'master' of github.com:deepayan/lattice commit 4e77c57d4a2ae91930312c9e907c459f0488bd7b Author: Deepayan Sarkar Date: Tue Mar 28 16:50:52 2023 +0530 update NEWS and CITATION R099 NEWS NEWS.md M inst/CITATION commit 59fe587cf2d5d2439d5c7942f640f9b7ad1455f3 Author: Deepayan Sarkar Date: Tue Mar 28 16:07:16 2023 +0530 update version and date M DESCRIPTION M NEWS commit e84f0e0b993a9d93f94d8c539f5ff587c5467df8 Author: Deepayan Sarkar Date: Tue Mar 28 15:46:07 2023 +0530 rename private functions that looked like methods M R/bwplot.R M R/histogram.R M R/interaction.R M R/miscellaneous.R M R/qq.R M R/qqmath.R M R/splom.R M R/xyplot.R M man/panel.pairs.Rd commit f2555c4a6b813e2b6556a142af3b240d10a0871f Author: Deepayan Sarkar Date: Tue Mar 28 14:25:57 2023 +0530 (very) slightly better custom barchart widths M R/bwplot.R A tests/barchart-width.R commit 81081e73ec3f5a5b8f0bf423ea1623c42964b732 Merge: 880dfb0 047b3bb Author: Deepayan Sarkar Date: Fri Feb 17 11:28:00 2023 +0530 Merge pull request #28 from stefaneng/stefaneng-vector-args-violinplot. Add vector argument support to panel.violinplot commit 047b3bb7873069e73c821178d89e4e0b69492b12 Author: Stefan Eng Date: Thu Feb 16 09:47:44 2023 -0800 Better error handling M R/bwplot.R commit d73258e5cb2fccdd48c60845c96c2749bbaf53f3 Author: Stefan Eng Date: Thu Feb 16 09:21:07 2023 -0800 Allow vector arguments for each group in violinplot M R/bwplot.R commit 880dfb08b145ef193318eda06deb19397d2497f6 Author: Deepayan Sarkar Date: Tue Oct 12 20:50:41 2021 +0530 make grid unit optimization optional (through lattice.options()) M DESCRIPTION M R/layout.R M R/settings.R M man/lattice.options.Rd commit 7a50e25c6276af10875ffe1aa742070222e7f798 Author: Deepayan Sarkar Date: Tue Oct 12 20:15:01 2021 +0530 added regression test for levelplot colorkey M tests/levelplot.R commit d495acd3b5436af699b64f0252fa306e35324f2a Merge: d30c3d6 cef06b5 Author: Deepayan Sarkar Date: Tue Oct 12 18:57:19 2021 +0530 Merge pull request #22 from bastistician/fix_colorkey_labels. Ensure that colorkey labels are in sync with 'labels$at' commit cef06b50aa1c5e4111e91f10ffa398c201c29f21 Author: Sebastian Meyer Date: Mon Oct 11 18:11:12 2021 +0200 ensure that colorkey labels are in sync with 'labels$at' M R/legend.R M tests/levelplot.R commit d30c3d692ffe92b4115f946e8eb0e883da2eb9a1 Author: Deepayan Sarkar Date: Fri Oct 8 21:47:59 2021 +0530 improve speed of multipage plots with relation != 'same' M DESCRIPTION M R/layout.R commit aa265adae89e9abf5cbd4ea5c9f160afa6a7c0ba Author: Deepayan Sarkar Date: Sat Sep 18 15:04:01 2021 +0530 fix item formatting errors in Rd M DESCRIPTION M man/axis.default.Rd M man/make.groups.Rd M man/oneway.Rd M man/trellis.par.get.Rd commit 1920eb4700c5590ba2b94796e55d16aed11d05b1 Author: Paul Murrell Date: Mon May 17 11:02:23 2021 +1200 added "grid" vignette containing examples of using raw grid with lattice A vignettes/grid.Rnw commit 7963aa428e8aa0941bc432e216ccc76cf270f394 Author: Deepayan Sarkar Date: Wed Apr 28 19:50:31 2021 +0530 bump version M DESCRIPTION commit 2ae6b17d0d405e812a05098e17c2644243a25f0e Author: Deepayan Sarkar Date: Wed Apr 28 19:35:51 2021 +0530 add fill argument to panel.3dscatter (https://github.com/deepayan/lattice/issues/20) M R/cloud.R M man/panel.cloud.Rd commit 9c44bc47637586391342c29b8352d72a4f29dd83 Author: Deepayan Sarkar Date: Sat Apr 24 22:29:23 2021 +0530 updated French translations (from Philippe Grosjean) M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M inst/po/fr/LC_MESSAGES/R-lattice.mo M po/R-de.po M po/R-fr.po M po/R-it.po M po/R-ko.po M po/R-lattice.pot M po/R-pl.po commit 21894257e9bdcc94370de328307503b557eed71e Author: Deepayan Sarkar Date: Wed Mar 17 12:52:07 2021 +0530 clarify behaviour of panel.axis() when 'labels' specified without 'at', and issue a warning (see https://stat.ethz.ch/pipermail/r-help/2021-March/470528.html) M R/axis.R M man/panel.axis.Rd commit f62ea761b03e89ac0d2d5b98ff9efd9392d88f51 Author: Deepayan Sarkar Date: Tue Mar 16 11:02:29 2021 +0530 updated French translations (from Philippe Grosjean) M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M inst/po/fr/LC_MESSAGES/R-lattice.mo M po/R-fr.po M po/R-lattice.pot commit d425f4c9f141298dfb521ccb86907a4c3538158b Author: Deepayan Sarkar Date: Thu May 14 17:40:17 2020 +0530 remove debugging code M R/bwplot.R commit 1288848770d9ea27ca7616696fa28925c2a4f503 Author: Deepayan Sarkar Date: Thu May 14 17:34:52 2020 +0530 bugfix: fix prepanel calculations for stacked barchart with missing values M R/bwplot.R commit bb2202cd370b1c7e8c66dbd901a8de390644acf6 Author: Deepayan Sarkar Date: Thu May 14 12:45:53 2020 +0530 added support for title in colorkey M DESCRIPTION M R/legend.R M R/print.trellis.R M R/settings.R M man/draw.colorkey.Rd M man/levelplot.Rd A tests/colorkey-title.R commit 78a868a5d1ee540176fc63a1089fb67836dec1c0 Author: Deepayan Sarkar Date: Mon May 11 18:54:02 2020 +0530 bugfix: make 'open' triangular ends in colorkey work for all values of 'space', not only 'right' M R/legend.R commit f4f809f2c1fec845f99b72f7c7c970099869b422 Author: Deepayan Sarkar Date: Fri May 1 12:22:38 2020 +0530 added Italian translation M inst/po/en@quot/LC_MESSAGES/R-lattice.mo A inst/po/it/LC_MESSAGES/R-lattice.mo A po/R-it.po M po/R-lattice.pot commit cda4f8b48e55442eeec1a658e16b7b2cd7e4de81 Author: Deepayan Sarkar Date: Wed Apr 22 14:45:52 2020 +0530 improved call component of trellis objects M R/bwplot.R M R/cloud.R M R/densityplot.R M R/histogram.R M R/levelplot.R M R/parallel.R M R/qq.R M R/qqmath.R M R/rfs.R M R/shingle.R M R/splom.R M R/tmd.R M R/xyplot.R M R/xyplot.ts.R A tests/call.R commit d3d4ca2832cd253dac0168cd8d28bce4ec8e226d Author: Deepayan Sarkar Date: Tue Apr 14 17:48:32 2020 +0530 updated minor version, fixed behaviour of abline argument in panel.xyplot() (in a backwards-incompatible way) M DESCRIPTION M R/xyplot.R M man/panel.xyplot.Rd commit f4af1fccf2e4114257a12db521fac6038c36758a Author: Deepayan Sarkar Date: Thu Apr 2 16:25:15 2020 +0530 revert abline change as it might break current usage; leave for major update M .Rbuildignore M R/xyplot.R commit fdeeb4f0f9c3480525ec440e5a41e388040a1a18 Author: Deepayan Sarkar Date: Thu Apr 2 16:05:59 2020 +0530 delete SvnLog D SvnLog commit 3f47ebf2f2c98ac38476f4c46b54fa459c5f8889 Author: Deepayan Sarkar Date: Thu Apr 2 16:05:36 2020 +0530 merge SvnLog into ChangeLog M .Rbuildignore M ChangeLog M DESCRIPTION M SvnLog commit 3228d8a861c75d2b3375ef708511d0a7ce4f65f4 Author: Deepayan Sarkar Date: Thu Apr 2 15:51:24 2020 +0530 cleanup translation generation and update translations M inst/po/de/LC_MESSAGES/R-lattice.mo M inst/po/en@quot/LC_MESSAGES/R-lattice.mo M inst/po/fr/LC_MESSAGES/R-lattice.mo M inst/po/ko/LC_MESSAGES/R-lattice.mo M inst/po/pl/LC_MESSAGES/R-lattice.mo D po/R-en@quot.po M po/R-lattice.pot M update.sh commit 2654be1ad4e68583615b6066573fdede8568a3ce Author: Deepayan Sarkar Date: Thu Apr 2 15:50:58 2020 +0530 added test file A tests/summary.R commit 2d852c7b94cd61fce8a4d38d7658f71a5097a02a Author: Deepayan Sarkar Date: Thu Apr 2 15:49:25 2020 +0530 bugfix - named vector now works for panel.xyplot(abline = ) M R/xyplot.R commit 938b5dbfca1f669c239f3cc12cc15b1f54a1e428 Author: Deepayan Sarkar Date: Thu Apr 2 15:30:38 2020 +0530 update translations M po/R-de.po M po/R-en@quot.po M po/R-fr.po M po/R-ko.po M po/R-lattice.pot M po/R-pl.po commit 649bec5d74a576a94d35b8a003de427d43392e53 Author: Deepayan Sarkar Date: Thu Apr 2 15:11:37 2020 +0530 document triangular ends in colorkey, other improvements M man/draw.colorkey.Rd M man/levelplot.Rd commit 96accbfe80285124e46ab6276f36daef58bd8999 Author: Deepayan Sarkar Date: Thu Apr 2 15:09:37 2020 +0530 moved to using Authors@R M DESCRIPTION commit 57757a0d68b3bc7a0034d2d09c3c26cf93e245fa Author: Deepayan Sarkar Date: Sun Feb 16 12:37:18 2020 +0530 update broken trellis project URL to wayback machine archive M man/Lattice.Rd commit 73a7c8c2fb1adb68dc4b7b5b77b4e18e57b28ae0 Author: Deepayan Sarkar Date: Sun Feb 16 12:18:09 2020 +0530 minor bugfix related to vector pch in panel.bwplot M R/bwplot.R commit bfb29ec9411edb14c76459c65bc940e6c7885064 Author: Deepayan Sarkar Date: Mon Nov 5 15:08:12 2018 +0530 preliminary support for open-ended triangular extensions in colorkey (no docs yet) M DESCRIPTION M R/legend.R commit 4d715be5a82934bb09291b9f1bc6701f08c0072f Author: Deepayan Sarkar Date: Thu Nov 1 14:19:16 2018 +0530 fix length-1 condition bug, and prepare for release M DESCRIPTION M R/miscellaneous.R M R/print.trellis.R M R/xyplot.R commit bb21fea78cf0a42b7fa0d810cc54e1d518934f02 Author: Deepayan Sarkar Date: Thu Nov 1 12:46:53 2018 +0530 deleted no-longer-necessary fast replacement for quantile M R/qqmath.R commit c988bbaf89d08fa6b605d28d451eeba5063bc034 Author: Deepayan Sarkar Date: Mon Jul 9 17:03:14 2018 +0530 bugfix in panel.abline for #8 M DESCRIPTION M R/panels.R commit 1b9c6481fd1df33362d49e101c7bcb8b3429c55d Author: Deepayan Sarkar Date: Thu Mar 23 20:27:24 2017 +0530 increased default 'n' in densityplot() to 512 M R/densityplot.R M man/histogram.Rd commit f43160cacf03e8b99813260ce8f5f279ab2b7fec Author: Deepayan Sarkar Date: Thu Feb 16 14:50:40 2017 +0530 Added URL and examples M man/USMortality.Rd commit 2a83edec80bc2b6089aa44f724f7e5c95a0afdb1 Author: Deepayan Sarkar Date: Wed Feb 15 19:48:08 2017 +0530 bugfix: catch font parameters in larrows() M R/miscellaneous.R commit 7a96ded29e454b1c581f70cc20d15647675d57f5 Author: Deepayan Sarkar Date: Wed Feb 15 19:45:56 2017 +0530 new dataset M DESCRIPTION A data/USMortality.rda A data/USRegionalMortality.rda A man/USMortality.Rd ------------------------------------------------------------------------ SVN -> GIT (https://github.com/deepayan/lattice) ------------------------------------------------------------------------ r776 | deepayan | 2016-11-17 16:30:41 +0530 (Thu, 17 Nov 2016) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/miscellaneous.R Support quote()-d labels in more places (see exchange with Martin Maechler ~Nov 17). Not sure about possible side-effects. ------------------------------------------------------------------------ r775 | deepayan | 2016-09-06 17:44:25 +0530 (Tue, 06 Sep 2016) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/bwplot.R M /pkg/man/Lattice.Rd M /pkg/po/R-lattice.pot minor fixes ------------------------------------------------------------------------ r774 | deepayan | 2016-09-06 16:44:14 +0530 (Tue, 06 Sep 2016) | 1 line Changed paths: M /pkg/R/miscellaneous.R misc fixes ------------------------------------------------------------------------ r773 | deepayan | 2016-09-06 16:39:39 +0530 (Tue, 06 Sep 2016) | 1 line Changed paths: M /pkg/man/panel.pairs.Rd allow diag.panel to be NULL (doc) ------------------------------------------------------------------------ r772 | deepayan | 2016-09-06 16:35:43 +0530 (Tue, 06 Sep 2016) | 1 line Changed paths: M /pkg/R/splom.R allow diag.panel to be NULL (actually any non-function) to suppress it ------------------------------------------------------------------------ r771 | deepayan | 2016-09-06 16:30:18 +0530 (Tue, 06 Sep 2016) | 1 line Changed paths: M /pkg/DESCRIPTION updated description ------------------------------------------------------------------------ r770 | deepayan | 2015-07-07 18:52:53 +0530 (Tue, 07 Jul 2015) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/man/Lattice.Rd Fixes to make CMD check happier ------------------------------------------------------------------------ r769 | deepayan | 2015-06-01 10:59:09 +0530 (Mon, 01 Jun 2015) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/Lattice.Rd updated CRAN URL ------------------------------------------------------------------------ r768 | deepayan | 2015-03-30 12:39:09 +0530 (Mon, 30 Mar 2015) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-lattice.pot updated german translation ------------------------------------------------------------------------ r767 | deepayan | 2015-02-20 19:23:14 +0530 (Fri, 20 Feb 2015) | 1 line Changed paths: M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/ko/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/pl/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-ko.po M /pkg/po/R-lattice.pot M /pkg/po/R-pl.po Korean translation update ------------------------------------------------------------------------ r766 | deepayan | 2015-02-17 01:20:30 +0530 (Tue, 17 Feb 2015) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/interaction.R M /pkg/R/layout.R M /pkg/R/legend.R M /pkg/R/miscellaneous.R M /pkg/R/panels.R M /pkg/R/print.trellis.R M /pkg/R/scales.R M /pkg/R/settings.R clean up CMD check notes with suppressLocalUnused=FALSE ------------------------------------------------------------------------ r765 | deepayan | 2014-12-31 10:09:55 +0530 (Wed, 31 Dec 2014) | 1 line Changed paths: M /pkg/man/xyplot.Rd mention simpleTheme() in documentation for 'auto.key' ------------------------------------------------------------------------ r764 | deepayan | 2014-12-31 10:09:27 +0530 (Wed, 31 Dec 2014) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/legend.R M /pkg/R/levelplot.R M /pkg/R/miscellaneous.R M /pkg/R/parallel.R M /pkg/R/print.trellis.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/splom.R M /pkg/R/xyplot.R some support for call and symbol objects for plotmath ------------------------------------------------------------------------ r763 | deepayan | 2014-04-08 21:35:52 +0530 (Tue, 08 Apr 2014) | 1 line Changed paths: M /pkg/R/panels.R improved translatability of warning ------------------------------------------------------------------------ r762 | deepayan | 2014-04-02 17:50:47 +0530 (Wed, 02 Apr 2014) | 1 line Changed paths: A /pkg/inst/po/pl A /pkg/inst/po/pl/LC_MESSAGES A /pkg/inst/po/pl/LC_MESSAGES/R-lattice.mo D /pkg/inst/po/pl_PL M /pkg/po/R-lattice.pot M /pkg/update.sh Renamed processed translations as well ------------------------------------------------------------------------ r761 | deepayan | 2014-04-02 17:47:03 +0530 (Wed, 02 Apr 2014) | 1 line Changed paths: A /pkg/po/R-pl.po (from /pkg/po/R-pl_PL.po:760) D /pkg/po/R-pl_PL.po Renaming Polish translation file ------------------------------------------------------------------------ r760 | deepayan | 2014-04-02 00:41:30 +0530 (Wed, 02 Apr 2014) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/inst/po/pl_PL/LC_MESSAGES/R-lattice.mo M /pkg/po/R-lattice.pot M /pkg/po/R-pl_PL.po updated Polish translations ------------------------------------------------------------------------ r759 | deepayan | 2014-03-21 15:53:12 +0530 (Fri, 21 Mar 2014) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/ko/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/pl_PL/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-ko.po M /pkg/po/R-lattice.pot M /pkg/po/R-pl_PL.po Updated French translations ------------------------------------------------------------------------ r758 | deepayan | 2014-02-27 11:42:24 +0530 (Thu, 27 Feb 2014) | 1 line Changed paths: M /pkg/DESCRIPTION update version ------------------------------------------------------------------------ r757 | deepayan | 2014-02-27 11:42:00 +0530 (Thu, 27 Feb 2014) | 1 line Changed paths: M /pkg/man/panel.number.Rd doc clarification ------------------------------------------------------------------------ r756 | deepayan | 2014-02-26 12:49:51 +0530 (Wed, 26 Feb 2014) | 1 line Changed paths: M /pkg/NAMESPACE export xyplot.ts for use by zoo ------------------------------------------------------------------------ r755 | deepayan | 2014-02-03 17:23:55 +0530 (Mon, 03 Feb 2014) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/axis.R quietly handle ticks outside range in panel.axis, instead of giving errors ------------------------------------------------------------------------ r754 | deepayan | 2013-10-22 14:21:41 +0530 (Tue, 22 Oct 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/cloud.R fixed bug with axis.line|lty in cloud bounding box axes ------------------------------------------------------------------------ r753 | deepayan | 2013-10-11 16:52:13 +0530 (Fri, 11 Oct 2013) | 1 line Changed paths: M /pkg/man/barley.Rd add Wright (2013) as barley reference ------------------------------------------------------------------------ r752 | deepayan | 2013-10-11 16:34:12 +0530 (Fri, 11 Oct 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/histogram.R M /pkg/man/histogram.Rd not warn about density!=type in histogram() just because 'breaks' is a function ------------------------------------------------------------------------ r751 | deepayan | 2013-08-21 17:09:51 +0530 (Wed, 21 Aug 2013) | 1 line Changed paths: M /pkg/.Rbuildignore M /pkg/DESCRIPTION A /pkg/inst/po/ko A /pkg/inst/po/ko/LC_MESSAGES A /pkg/inst/po/ko/LC_MESSAGES/R-lattice.mo A /pkg/inst/po/pl_PL A /pkg/inst/po/pl_PL/LC_MESSAGES A /pkg/inst/po/pl_PL/LC_MESSAGES/R-lattice.mo A /pkg/po/R-ko.po M /pkg/po/R-lattice.pot M /pkg/po/R-pl_PL.po M /pkg/update.sh added korean translation, updated translation processing ------------------------------------------------------------------------ r750 | deepayan | 2013-08-19 14:26:29 +0530 (Mon, 19 Aug 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/settings.R M /pkg/po/R-lattice.pot reverted default fontsize to be 12 ------------------------------------------------------------------------ r749 | deepayan | 2013-08-13 15:54:15 +0530 (Tue, 13 Aug 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/histogram.R histogram: fixed spurious warnings when breaks was a single integer ------------------------------------------------------------------------ r748 | deepayan | 2013-08-07 14:43:40 +0530 (Wed, 07 Aug 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/histogram.R M /pkg/R/settings.R M /pkg/man/histogram.Rd Added a new option 'histogram.breaks' for setting default breaks rule ------------------------------------------------------------------------ r746 | deepayan | 2013-07-19 13:29:08 +0530 (Fri, 19 Jul 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/miscellaneous.R M /pkg/R/update.trellis.R M /pkg/man/panel.cloud.Rd update.trellis fix to allow multiple 'inside' legends ------------------------------------------------------------------------ r745 | deepayan | 2013-07-16 09:52:28 +0530 (Tue, 16 Jul 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/update.trellis.R Fix some more invalid uses of rep(NULL) ------------------------------------------------------------------------ r744 | deepayan | 2013-06-05 19:35:09 +0530 (Wed, 05 Jun 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/print.trellis.R M /pkg/R/settings.R A /pkg/tests/fontsize.R Modify default text fontsize (see https://stat.ethz.ch/pipermail/r-help/2013-May/354139.html) ------------------------------------------------------------------------ r743 | paul | 2013-05-23 08:20:04 +0530 (Thu, 23 May 2013) | 1 line Changed paths: M /pkg/SvnLog updated SvnLog ------------------------------------------------------------------------ r742 | paul | 2013-05-23 08:19:05 +0530 (Thu, 23 May 2013) | 1 line Changed paths: M /pkg/R/bwplot.R improved naming of rect grobs in barchart when there is grouping ------------------------------------------------------------------------ r740 | deepayan | 2013-03-24 19:33:09 +0530 (Sun, 24 Mar 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/legend.R bugfix to allow 'fill' in legend symbols ------------------------------------------------------------------------ r739 | deepayan | 2013-03-16 02:09:41 +0530 (Sat, 16 Mar 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/cloud.Rd fixed doc typo ------------------------------------------------------------------------ r738 | deepayan | 2013-03-11 17:10:08 +0530 (Mon, 11 Mar 2013) | 1 line Changed paths: D /pkg/LICENSE A /pkg/LICENSE.note (from /pkg/LICENSE:737) Renamed LICENSE (because it isn't really the license, and check complains) ------------------------------------------------------------------------ r737 | deepayan | 2013-01-09 00:48:37 +0530 (Wed, 09 Jan 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/R/bwplot.R M /pkg/R/levelplot.R M /pkg/R/miscellaneous.R M /pkg/R/panels.R M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-lattice.pot remove use of methods::hasArg() by replicating functionality in hasGroupNumber() ------------------------------------------------------------------------ r736 | deepayan | 2013-01-08 23:15:46 +0530 (Tue, 08 Jan 2013) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/tests/test.R add test for histogram(type='density') ------------------------------------------------------------------------ r735 | deepayan | 2013-01-08 00:06:39 +0530 (Tue, 08 Jan 2013) | 1 line Changed paths: M /pkg/R/histogram.R remove use of deprecated hist() ------------------------------------------------------------------------ r734 | deepayan | 2013-01-08 00:02:33 +0530 (Tue, 08 Jan 2013) | 1 line Changed paths: M /pkg/update.sh update ------------------------------------------------------------------------ r733 | deepayan | 2012-09-13 15:16:23 +0530 (Thu, 13 Sep 2012) | 1 line Changed paths: M /pkg/R/levelplot.R M /pkg/man/levelplot.Rd panel.levelplot bugfix for length-1 at ------------------------------------------------------------------------ r732 | deepayan | 2012-09-13 14:41:30 +0530 (Thu, 13 Sep 2012) | 1 line Changed paths: M /pkg/po/R-de.po German translation update ------------------------------------------------------------------------ r731 | deepayan | 2012-09-03 15:46:59 +0530 (Mon, 03 Sep 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot A /pkg/po/R-pl_PL.po translation updates ------------------------------------------------------------------------ r730 | deepayan | 2012-08-27 12:51:12 +0530 (Mon, 27 Aug 2012) | 1 line Changed paths: M /pkg/R/legend.R bugfix: more instances of rep(NULL) ------------------------------------------------------------------------ r729 | paul | 2012-07-26 04:21:37 +0530 (Thu, 26 Jul 2012) | 1 line Changed paths: M /pkg/R/levelplot.R fix to make contour line and label grob names unique ------------------------------------------------------------------------ r728 | deepayan | 2012-07-22 00:54:53 +0530 (Sun, 22 Jul 2012) | 1 line Changed paths: M /pkg/R/panel.superpose.R M /pkg/man/print.trellis.Rd fixed incorrect rep(NULL) usage ------------------------------------------------------------------------ r727 | deepayan | 2012-07-13 22:54:50 +0530 (Fri, 13 Jul 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/legend.R M /pkg/man/levelplot.Rd M /pkg/po/R-lattice.pot Added support for 'tck' in levelplot colorkeys ------------------------------------------------------------------------ r726 | deepayan | 2012-06-23 12:57:04 +0530 (Sat, 23 Jun 2012) | 1 line Changed paths: M /pkg/R/legend.R improved name matching for colorley 'labels' ------------------------------------------------------------------------ r725 | deepayan | 2012-06-22 17:54:40 +0530 (Fri, 22 Jun 2012) | 1 line Changed paths: M /pkg/man/lattice.options.Rd M /pkg/man/xyplot.Rd doc updates ------------------------------------------------------------------------ r724 | deepayan | 2012-06-09 02:22:26 +0530 (Sat, 09 Jun 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/trellis.device.Rd doc update ------------------------------------------------------------------------ r723 | deepayan | 2012-06-08 09:29:42 +0530 (Fri, 08 Jun 2012) | 1 line Changed paths: M /pkg/R/print.trellis.R M /pkg/R/settings.R M /pkg/R/zzz.R Clean up lattice.status list whenever new page starts. This should fix lattice bug #1629 ------------------------------------------------------------------------ r722 | deepayan | 2012-05-05 15:10:19 +0530 (Sat, 05 May 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/layout.R Made user-specified options for layout.widths|heights for labels and keys more robust, by refusing to replace by plot-determined values unless units match. This allows specification of absolute unit values for labels and legends. ------------------------------------------------------------------------ r721 | deepayan | 2012-04-23 16:47:05 +0530 (Mon, 23 Apr 2012) | 1 line Changed paths: M /pkg/man/trellis.par.get.Rd Additional documentation for trellis.par.get (partially done) ------------------------------------------------------------------------ r720 | deepayan | 2012-03-10 14:43:53 +0530 (Sat, 10 Mar 2012) | 1 line Changed paths: M /pkg/NEWS M /pkg/SvnLog M /pkg/po/R-lattice.pot log/news updates ------------------------------------------------------------------------ r719 | deepayan | 2012-03-10 14:39:50 +0530 (Sat, 10 Mar 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/axis.R M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-lattice.pot German translation updates ------------------------------------------------------------------------ r718 | deepayan | 2012-03-10 13:38:01 +0530 (Sat, 10 Mar 2012) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/R/parallel.R fixed improper deprecation of parallel ------------------------------------------------------------------------ r717 | deepayan | 2012-03-06 21:27:44 +0530 (Tue, 06 Mar 2012) | 1 line Changed paths: M /pkg/po/R-de.po updated German translations ------------------------------------------------------------------------ r716 | deepayan | 2012-03-05 21:18:07 +0530 (Mon, 05 Mar 2012) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/common.R M /pkg/R/settings.R M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot new show.settings() ------------------------------------------------------------------------ r715 | deepayan | 2011-11-19 13:33:52 +0530 (Sat, 19 Nov 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NEWS M /pkg/R/axis.R M /pkg/R/print.trellis.R M /pkg/R/scales.R M /pkg/man/splom.Rd M /pkg/man/xyplot.Rd finished support for traditional graphics-like log-scale annotation ------------------------------------------------------------------------ r714 | deepayan | 2011-11-18 10:43:51 +0530 (Fri, 18 Nov 2011) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/print.trellis.R M /pkg/man/lset.Rd incomplete attempt to implement nice log ticks as in traditional graphics ------------------------------------------------------------------------ r713 | deepayan | 2011-11-18 01:11:06 +0530 (Fri, 18 Nov 2011) | 1 line Changed paths: M /pkg/NAMESPACE M /pkg/R/layout.R fixed NAMESPACE to reflect parallel rename ------------------------------------------------------------------------ r712 | deepayan | 2011-11-15 18:12:42 +0530 (Tue, 15 Nov 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/R/parallel.R M /pkg/man/splom.Rd initial steps for deprecating parallel() in favour of parallelplot() ------------------------------------------------------------------------ r711 | deepayan | 2011-10-21 22:28:53 +0530 (Fri, 21 Oct 2011) | 1 line Changed paths: M /pkg/DESCRIPTION version update ------------------------------------------------------------------------ r710 | deepayan | 2011-10-21 22:28:31 +0530 (Fri, 21 Oct 2011) | 1 line Changed paths: M /pkg/R/levelplot.R M /pkg/man/panel.levelplot.Rd better control over levelplot rectangle borders ------------------------------------------------------------------------ r706 | deepayan | 2011-10-18 23:48:18 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/R/xyplot.R M /pkg/man/panel.xyplot.Rd 'spline' is a new possible 'type' in panel.xyplot ------------------------------------------------------------------------ r705 | deepayan | 2011-10-18 23:42:38 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/R/legend.R M /pkg/man/levelplot.Rd new components in colorkey to specify parameters of colorkey border, ticks, and labels ------------------------------------------------------------------------ r704 | deepayan | 2011-10-18 23:20:15 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/R/miscellaneous.R 'pos' can now be a vector in ltext() ------------------------------------------------------------------------ r703 | deepayan | 2011-10-18 18:16:51 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/man/interaction.Rd M /pkg/man/panel.superpose.Rd formatting and clarifications ------------------------------------------------------------------------ r702 | deepayan | 2011-10-18 18:15:03 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/R/levelplot.R M /pkg/R/settings.R M /pkg/man/levelplot.Rd made it easier to use raster images in levelplot ------------------------------------------------------------------------ r701 | deepayan | 2011-10-18 18:12:16 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/R/bwplot.R removed old version of panel.bwplot ------------------------------------------------------------------------ r700 | deepayan | 2011-10-18 01:12:47 +0530 (Tue, 18 Oct 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/R/axis.R M /pkg/R/print.trellis.R depend on R 2.14 for dev.hold/flush. ------------------------------------------------------------------------ r699 | paul | 2011-10-03 05:19:37 +0530 (Mon, 03 Oct 2011) | 1 line Changed paths: M /pkg/R/strip.R fix to naming of strip.default viewports (were missing plot prefix) ------------------------------------------------------------------------ r694 | deepayan | 2011-08-19 20:25:34 +0530 (Fri, 19 Aug 2011) | 1 line Changed paths: M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/man/histogram.Rd M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot M /pkg/update.sh formatting, translations ------------------------------------------------------------------------ r693 | deepayan | 2011-08-19 20:24:50 +0530 (Fri, 19 Aug 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/print.trellis.R use dev.hold/dev.flush for smoother transitions ------------------------------------------------------------------------ r692 | deepayan | 2011-08-19 20:23:19 +0530 (Fri, 19 Aug 2011) | 1 line Changed paths: M /pkg/R/histogram.R fixed incorrect check for equal bins ------------------------------------------------------------------------ r691 | deepayan | 2011-08-10 20:20:00 +0530 (Wed, 10 Aug 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/zzz.R Removed redundant .First.lib ------------------------------------------------------------------------ r679 | deepayan | 2011-06-26 15:27:13 +0530 (Sun, 26 Jun 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE M /pkg/R/miscellaneous.R M /pkg/R/panel.smooth.R M /pkg/man/panel.functions.Rd A /pkg/man/panel.loess.Rd A /pkg/man/panel.spline.Rd M /pkg/man/prepanel.functions.Rd Cleaned up (pre)panel.spline and related documentation ------------------------------------------------------------------------ r678 | deepayan | 2011-06-24 18:38:55 +0530 (Fri, 24 Jun 2011) | 1 line Changed paths: M /pkg/NAMESPACE M /pkg/R/panel.smooth.R M /pkg/R/settings.R new panel.spline() function ------------------------------------------------------------------------ r677 | deepayan | 2011-06-03 15:16:34 +0530 (Fri, 03 Jun 2011) | 1 line Changed paths: A /pkg/R/panel.smooth.R A /pkg/R/panel.superpose.R M /pkg/R/panels.R split off new files from panels.R ------------------------------------------------------------------------ r676 | paul | 2011-05-24 09:05:29 +0530 (Tue, 24 May 2011) | 1 line Changed paths: M /pkg/R/strip.R fixes to naming of strip viewports and grobs when strip.left=TRUE ------------------------------------------------------------------------ r675 | paul | 2011-05-13 03:11:04 +0530 (Fri, 13 May 2011) | 1 line Changed paths: M /pkg/R/interaction.R M /pkg/R/print.trellis.R M /pkg/man/interaction.Rd small modification to names of viewports when legend is located "inside" the plot ------------------------------------------------------------------------ r674 | deepayan | 2011-05-11 17:35:32 +0530 (Wed, 11 May 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NAMESPACE Explicitly indicated import of methods::hasArg() ------------------------------------------------------------------------ r671 | paul | 2011-05-06 08:32:50 +0530 (Fri, 06 May 2011) | 1 line Changed paths: M /pkg/R/interaction.R M /pkg/R/legend.R M /pkg/man/interaction.Rd improved naming scheme for grobs: naming added for draw.key() and draw.colorkey() ------------------------------------------------------------------------ r670 | paul | 2011-05-06 02:25:28 +0530 (Fri, 06 May 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/cloud.R M /pkg/R/interaction.R M /pkg/R/miscellaneous.R M /pkg/R/print.trellis.R M /pkg/demo/lattice.R M /pkg/man/interaction.Rd M /pkg/man/llines.Rd improvements to grob naming scheme: can now cope with multiple conditioning variables (hence multiple strips per panel); better naming of multiple polygon grobs produced by panel.3dwire; better naming of grobs in custom strip example in demo(lattice) #10 ------------------------------------------------------------------------ r669 | deepayan | 2011-04-19 10:19:11 +0530 (Tue, 19 Apr 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/panels.R fix bug in recent panel.abline() bugfix ------------------------------------------------------------------------ r668 | paul | 2011-04-14 04:43:43 +0530 (Thu, 14 Apr 2011) | 1 line Changed paths: M /pkg/NEWS forgot mention of bug fix in last commit ------------------------------------------------------------------------ r667 | paul | 2011-04-14 04:41:00 +0530 (Thu, 14 Apr 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NEWS M /pkg/R/axis.R M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/interaction.R M /pkg/R/levelplot.R M /pkg/R/miscellaneous.R M /pkg/R/panel.smoothscatter.R M /pkg/R/panels.R M /pkg/R/parallel.R M /pkg/R/print.trellis.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/splom.R M /pkg/R/strip.R M /pkg/R/tmd.R M /pkg/R/xyplot.R M /pkg/man/interaction.Rd M /pkg/man/llines.Rd M /pkg/man/panel.barchart.Rd M /pkg/man/panel.bwplot.Rd M /pkg/man/panel.cloud.Rd M /pkg/man/panel.densityplot.Rd M /pkg/man/panel.dotplot.Rd M /pkg/man/panel.functions.Rd M /pkg/man/panel.histogram.Rd M /pkg/man/panel.levelplot.Rd M /pkg/man/panel.parallel.Rd M /pkg/man/panel.qqmath.Rd M /pkg/man/panel.qqmathline.Rd M /pkg/man/panel.smoothScatter.Rd M /pkg/man/panel.stripplot.Rd M /pkg/man/panel.violin.Rd M /pkg/man/panel.xyplot.Rd M /pkg/man/tmd.Rd naming scheme for grobs (first hack) ------------------------------------------------------------------------ r665 | deepayan | 2011-04-09 14:29:13 +0530 (Sat, 09 Apr 2011) | 1 line Changed paths: M /pkg/man/simpleTheme.Rd fixed doc typo ------------------------------------------------------------------------ r664 | deepayan | 2011-04-05 18:47:24 +0530 (Tue, 05 Apr 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/axis.R Added support for different ticks and labels in return value of scale.components() ------------------------------------------------------------------------ r663 | deepayan | 2011-04-03 17:27:22 +0530 (Sun, 03 Apr 2011) | 1 line Changed paths: M /pkg/R/miscellaneous.R removed (uncommented) FIXME ------------------------------------------------------------------------ r662 | deepayan | 2011-04-02 11:50:26 +0530 (Sat, 02 Apr 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/miscellaneous.R M /pkg/man/llines.Rd captured font arguments in lsegments (was causing errors) ------------------------------------------------------------------------ r661 | deepayan | 2011-04-01 20:44:33 +0530 (Fri, 01 Apr 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NEWS M /pkg/R/cloud.R M /pkg/SvnLog M /pkg/po/R-lattice.pot final touches before release ------------------------------------------------------------------------ r660 | felix | 2011-03-29 17:34:24 +0530 (Tue, 29 Mar 2011) | 1 line Changed paths: M /pkg/R/xyplot.ts.R remainder of previous commmit (i need to sleep more) ------------------------------------------------------------------------ r659 | felix | 2011-03-29 17:28:25 +0530 (Tue, 29 Mar 2011) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/xyplot.ts.R make xyplot.ts pass lists to panel.superpose ------------------------------------------------------------------------ r658 | deepayan | 2011-03-25 12:56:23 +0530 (Fri, 25 Mar 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-lattice.pot updated German translation ------------------------------------------------------------------------ r657 | deepayan | 2011-03-17 18:59:32 +0530 (Thu, 17 Mar 2011) | 1 line Changed paths: M /pkg/DESCRIPTION updated version ------------------------------------------------------------------------ r656 | deepayan | 2011-03-17 18:56:10 +0530 (Thu, 17 Mar 2011) | 1 line Changed paths: M /pkg/R/cloud.R M /pkg/man/panel.cloud.Rd pass more parameters in cloud() panel functions ------------------------------------------------------------------------ r655 | felix | 2011-03-14 17:12:06 +0530 (Mon, 14 Mar 2011) | 1 line Changed paths: M /pkg/R/scales.R Fix bug in computing styles for key ------------------------------------------------------------------------ r654 | deepayan | 2011-03-10 17:55:53 +0530 (Thu, 10 Mar 2011) | 1 line Changed paths: M /pkg/R/panels.R panel.abline bugfix (reported by David Carslaw) ------------------------------------------------------------------------ r653 | deepayan | 2011-01-11 14:04:49 +0530 (Tue, 11 Jan 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/legend.R bugfix: gracefully handle 0-length tick mark locations in draw.colorkey() ------------------------------------------------------------------------ r652 | deepayan | 2011-01-06 16:48:34 +0530 (Thu, 06 Jan 2011) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/panels.R M /pkg/man/panel.functions.Rd make panel.rugs honor col.line ------------------------------------------------------------------------ r651 | deepayan | 2011-01-04 17:19:31 +0530 (Tue, 04 Jan 2011) | 1 line Changed paths: M /pkg/DESCRIPTION updated version ------------------------------------------------------------------------ r650 | deepayan | 2011-01-04 12:40:34 +0530 (Tue, 04 Jan 2011) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot improved vectorization in panel.bwplot ------------------------------------------------------------------------ r649 | deepayan | 2010-11-13 21:42:00 +0530 (Sat, 13 Nov 2010) | 1 line Changed paths: M /pkg/R/scales.R changed from error to warning when there are unrecognized names in complete_names() ------------------------------------------------------------------------ r648 | deepayan | 2010-11-12 12:49:35 +0530 (Fri, 12 Nov 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/legend.R draw.key partial match bug fix ------------------------------------------------------------------------ r647 | deepayan | 2010-10-28 22:55:58 +0530 (Thu, 28 Oct 2010) | 1 line Changed paths: M /pkg/DESCRIPTION updates ------------------------------------------------------------------------ r646 | deepayan | 2010-10-28 17:26:15 +0530 (Thu, 28 Oct 2010) | 1 line Changed paths: M /pkg/R/legend.R M /pkg/R/panels.R M /pkg/R/scales.R M /pkg/man/xyplot.Rd new 'height' component for key, and better partial matching support for components of 'key' ------------------------------------------------------------------------ r645 | deepayan | 2010-10-28 10:43:01 +0530 (Thu, 28 Oct 2010) | 1 line Changed paths: M /pkg/R/scales.R M /pkg/R/zzz.R bugfix: partial matching in scales was not working ------------------------------------------------------------------------ r644 | deepayan | 2010-10-12 16:53:37 +0530 (Tue, 12 Oct 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/legend.R M /pkg/demo/lattice.R M /pkg/man/levelplot.Rd M /pkg/man/panel.levelplot.Rd M /pkg/man/strip.default.Rd added support for raster colorkeys ------------------------------------------------------------------------ r643 | deepayan | 2010-09-26 19:04:30 +0530 (Sun, 26 Sep 2010) | 1 line Changed paths: M /pkg/man/axis.default.Rd fixed typo ------------------------------------------------------------------------ r642 | deepayan | 2010-09-26 12:03:46 +0530 (Sun, 26 Sep 2010) | 1 line Changed paths: M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot german translation updated (contributed by Detlef Steuer) ------------------------------------------------------------------------ r641 | deepayan | 2010-09-09 12:08:35 +0530 (Thu, 09 Sep 2010) | 1 line Changed paths: M /pkg/R/common.R M /pkg/R/print.trellis.R M /pkg/man/xyplot.Rd fixes in layout handling and documentation ------------------------------------------------------------------------ r640 | deepayan | 2010-09-09 01:27:55 +0530 (Thu, 09 Sep 2010) | 1 line Changed paths: M /pkg/R/update.trellis.R M /pkg/man/update.trellis.Rd update.trellis() now handles xlab.top, ylab.right, axis, ans [xy]scale.components ------------------------------------------------------------------------ r639 | deepayan | 2010-09-09 00:57:04 +0530 (Thu, 09 Sep 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/levelplot.Rd M /pkg/man/trellis.device.Rd doc updates ------------------------------------------------------------------------ r638 | deepayan | 2010-09-09 00:56:37 +0530 (Thu, 09 Sep 2010) | 1 line Changed paths: M /pkg/R/axis.R scales = list(at=NULL) handled more gracefully with log scales ------------------------------------------------------------------------ r637 | deepayan | 2010-09-08 18:51:06 +0530 (Wed, 08 Sep 2010) | 1 line Changed paths: M /pkg/R/axis.R bugfix in 'at' handling in formattedTicksAndLabels.[character|expression] ------------------------------------------------------------------------ r636 | deepayan | 2010-09-08 18:50:23 +0530 (Wed, 08 Sep 2010) | 1 line Changed paths: M /pkg/R/cloud.R bugfix in graphical argument handling ------------------------------------------------------------------------ r635 | deepayan | 2010-09-03 21:20:10 +0530 (Fri, 03 Sep 2010) | 1 line Changed paths: M /pkg/man/histogram.Rd M /pkg/man/levelplot.Rd M /pkg/man/panel.superpose.Rd M /pkg/man/simpleTheme.Rd M /pkg/man/trellis.device.Rd M /pkg/man/xyplot.Rd documentation update ------------------------------------------------------------------------ r634 | deepayan | 2010-09-03 21:19:53 +0530 (Fri, 03 Sep 2010) | 1 line Changed paths: M /pkg/R/panels.R graphical arguments in panel.superpose can now be lists ------------------------------------------------------------------------ r633 | deepayan | 2010-09-03 19:56:23 +0530 (Fri, 03 Sep 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/histogram.Rd M /pkg/man/qq.Rd M /pkg/man/qqmath.Rd documentation updates, added MASS to Suggests ------------------------------------------------------------------------ r630 | deepayan | 2010-08-24 01:14:42 -0700 (Tue, 24 Aug 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/print.trellis.R fixed default labels for horizontal=FALSE in bwplot() etc ------------------------------------------------------------------------ r629 | deepayan | 2010-08-18 03:36:32 -0700 (Wed, 18 Aug 2010) | 1 line Changed paths: M /pkg/R/update.trellis.R slightly better test for detecting splom() output in update.trellis ------------------------------------------------------------------------ r628 | deepayan | 2010-08-18 02:08:45 -0700 (Wed, 18 Aug 2010) | 1 line Changed paths: M /pkg/R/legend.R M /pkg/man/xyplot.Rd add support for 'just' component in draw.key() to allow justification of legend placement ------------------------------------------------------------------------ r627 | deepayan | 2010-07-25 10:16:14 -0700 (Sun, 25 Jul 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/cloud.R M /pkg/R/print.trellis.R M /pkg/man/panel.qqmath.Rd misc fixes, including making par.[main|sub|*lab].text parameter more powerful. ------------------------------------------------------------------------ r626 | deepayan | 2010-07-17 09:18:14 -0700 (Sat, 17 Jul 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/axis.R M /pkg/R/legend.R M /pkg/R/miscellaneous.R M /pkg/R/print.trellis.R M /pkg/R/splom.R refactoring some function calls using new checkArgsAndCall() function; should fix call to pretty() from formattedTicksAndLabels.default() ------------------------------------------------------------------------ r625 | deepayan | 2010-07-07 09:52:33 -0700 (Wed, 07 Jul 2010) | 1 line Changed paths: M /pkg/R/splom.R pass i and j to diag.panel ------------------------------------------------------------------------ r624 | deepayan | 2010-06-15 05:38:12 -0700 (Tue, 15 Jun 2010) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/levelplot.R M /pkg/R/parallel.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/settings.R M /pkg/R/splom.R M /pkg/R/xyplot.R M /pkg/man/cloud.Rd M /pkg/man/histogram.Rd M /pkg/man/levelplot.Rd M /pkg/man/qq.Rd M /pkg/man/qqmath.Rd M /pkg/man/splom.Rd M /pkg/man/xyplot.Rd made default prepanel functions user-settable through lattice.options() ------------------------------------------------------------------------ r623 | deepayan | 2010-06-15 04:35:25 -0700 (Tue, 15 Jun 2010) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/levelplot.R M /pkg/R/parallel.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/rfs.R M /pkg/R/scales.R M /pkg/R/splom.R M /pkg/R/update.trellis.R M /pkg/R/xyplot.R evaluation of prepanel moved to common helper function limits.and.aspect instead of top-level functions ------------------------------------------------------------------------ r622 | deepayan | 2010-06-15 04:00:58 -0700 (Tue, 15 Jun 2010) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/interaction.R M /pkg/R/levelplot.R M /pkg/R/miscellaneous.R M /pkg/R/panels.R M /pkg/R/parallel.R M /pkg/R/print.trellis.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/rfs.R M /pkg/R/splom.R M /pkg/R/tmd.R M /pkg/R/update.trellis.R M /pkg/R/xyplot.R new utility function getFunctionOrName() for cases where an argument may be a quoted function name (mostly panel and prepanel) ------------------------------------------------------------------------ r621 | deepayan | 2010-06-14 07:20:29 -0700 (Mon, 14 Jun 2010) | 1 line Changed paths: M /pkg/man/panel.pairs.Rd panel.pairs doc update ------------------------------------------------------------------------ r620 | deepayan | 2010-06-14 07:10:35 -0700 (Mon, 14 Jun 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/splom.R panel.pairs now passes arguments i and j to (sub)panel function. ------------------------------------------------------------------------ r619 | deepayan | 2010-06-14 04:34:37 -0700 (Mon, 14 Jun 2010) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/splom.R M /pkg/man/panel.pairs.Rd M /pkg/man/splom.Rd improved axis labelling in splom(), including support for date-time data ------------------------------------------------------------------------ r618 | deepayan | 2010-06-11 03:36:39 -0700 (Fri, 11 Jun 2010) | 1 line Changed paths: M /pkg/R/common.R M /pkg/R/interaction.R M /pkg/R/layout.R M /pkg/R/print.trellis.R M /pkg/R/settings.R M /pkg/man/interaction.Rd M /pkg/man/lattice.options.Rd M /pkg/man/xyplot.Rd added support for xlab.top and ylab.right argments ------------------------------------------------------------------------ r617 | deepayan | 2010-06-10 02:26:34 -0700 (Thu, 10 Jun 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/parallel.R M /pkg/R/splom.R M /pkg/man/panel.pairs.Rd M /pkg/man/splom.Rd M /pkg/man/xyplot.Rd allowed varnames to be expressions in splom/parallel (and disabled undocumented nonstandard evaluation for them). ------------------------------------------------------------------------ r616 | deepayan | 2010-06-09 11:41:25 -0700 (Wed, 09 Jun 2010) | 1 line Changed paths: M /pkg/.Rbuildignore M /pkg/DESCRIPTION M /pkg/R/cloud.R M /pkg/man/panel.cloud.Rd Added the option to scale data in panel.3dscatter() and panel.3dwire() rather than assuming ther are already scaled. This may be helpful for use in user-written panel functions, with data specified in the original scale. ------------------------------------------------------------------------ r615 | deepayan | 2010-06-09 03:28:34 -0700 (Wed, 09 Jun 2010) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/scales.R fix related to axis.text ------------------------------------------------------------------------ r614 | deepayan | 2010-06-09 03:15:27 -0700 (Wed, 09 Jun 2010) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/cloud.R M /pkg/R/layout.R M /pkg/R/legend.R M /pkg/R/print.trellis.R M /pkg/R/settings.R M /pkg/R/splom.R M /pkg/man/panel.axis.Rd M /pkg/man/panel.pairs.Rd M /pkg/man/xyplot.Rd added new setting: axis.text, and associated changes ------------------------------------------------------------------------ r613 | deepayan | 2010-06-08 11:31:49 -0700 (Tue, 08 Jun 2010) | 1 line Changed paths: M /pkg/man/xyplot.Rd remove blank lines with unintended formatting effects ------------------------------------------------------------------------ r612 | deepayan | 2010-06-08 04:19:07 -0700 (Tue, 08 Jun 2010) | 1 line Changed paths: M /pkg/R/miscellaneous.R Allows code=0 [and anything else] without complaining in larrows(), because code=0 works in arrows(), although not documented. Other values give errors in arrows(), but we will be more forgiving. ------------------------------------------------------------------------ r611 | deepayan | 2010-06-08 01:09:50 -0700 (Tue, 08 Jun 2010) | 1 line Changed paths: M /pkg/R/xyplot.R M /pkg/man/panel.xyplot.Rd made 'grid' argument in panel.xyplot() more flexible ------------------------------------------------------------------------ r610 | deepayan | 2010-06-07 23:56:58 -0700 (Mon, 07 Jun 2010) | 1 line Changed paths: M /pkg/R/print.trellis.R M /pkg/R/shingle.R M /pkg/demo/lattice.R simplified demo code, intial attempt at as.factor.shingle ------------------------------------------------------------------------ r609 | deepayan | 2010-06-07 22:18:08 -0700 (Mon, 07 Jun 2010) | 1 line Changed paths: D /pkg/INDEX removed INDEX file (not used any more?) ------------------------------------------------------------------------ r608 | deepayan | 2010-06-04 06:46:47 -0700 (Fri, 04 Jun 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/INDEX M /pkg/R/splom.R A /pkg/inst/CITATION added a CITATION file ------------------------------------------------------------------------ r607 | deepayan | 2010-06-04 05:00:38 -0700 (Fri, 04 Jun 2010) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/common.R M /pkg/R/interaction.R M /pkg/R/print.trellis.R M /pkg/R/settings.R M /pkg/R/update.trellis.R M /pkg/man/axis.default.Rd M /pkg/man/interaction.Rd M /pkg/man/panel.number.Rd M /pkg/man/print.trellis.Rd M /pkg/man/trellis.par.get.Rd M /pkg/man/update.trellis.Rd M /pkg/tests/test.R Restructured storage of plot-specific information (fixes bug reported in https://stat.ethz.ch/pipermail/r-help/2007-October/143567.html); also implements a stricter reversion of parameter settings when 'par.settings' contains parameters not present in the active theme. ------------------------------------------------------------------------ r606 | deepayan | 2010-06-04 04:54:51 -0700 (Fri, 04 Jun 2010) | 1 line Changed paths: M /pkg/R/bwplot.R improved 'call' components for table methods ------------------------------------------------------------------------ r604 | deepayan | 2010-06-03 04:51:03 -0700 (Thu, 03 Jun 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/print.trellis.R M /pkg/R/settings.R added a panel.background setting ------------------------------------------------------------------------ r603 | deepayan | 2010-06-02 04:28:51 -0700 (Wed, 02 Jun 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/INDEX M /pkg/R/panels.R M /pkg/R/xyplot.R M /pkg/man/panel.qqmath.Rd M /pkg/man/panel.superpose.Rd M /pkg/man/panel.xyplot.Rd new arguments grid and abline in panel.xyplot() ------------------------------------------------------------------------ r602 | felix | 2010-05-30 07:10:26 -0700 (Sun, 30 May 2010) | 1 line Changed paths: M /pkg/R/panels.R M /pkg/R/xyplot.R M /pkg/man/panel.functions.Rd use pretty() method in panel.grid based on data classes (arguments x,y). ------------------------------------------------------------------------ r600 | deepayan | 2010-05-29 00:57:37 -0700 (Sat, 29 May 2010) | 1 line Changed paths: M /pkg/man/xyplot.Rd xyplot doc update ------------------------------------------------------------------------ r596 | deepayan | 2010-05-27 22:59:20 -0700 (Thu, 27 May 2010) | 1 line Changed paths: M /pkg/man/Lattice.Rd M /pkg/man/banking.Rd M /pkg/man/barley.Rd M /pkg/man/cloud.Rd M /pkg/man/environmental.Rd M /pkg/man/ethanol.Rd M /pkg/man/histogram.Rd M /pkg/man/levelplot.Rd M /pkg/man/melanoma.Rd M /pkg/man/panel.parallel.Rd M /pkg/man/singer.Rd M /pkg/man/trellis.device.Rd M /pkg/man/xyplot.Rd M /pkg/man/xyplot.ts.Rd misc updates ------------------------------------------------------------------------ r595 | deepayan | 2010-05-27 20:57:32 -0700 (Thu, 27 May 2010) | 1 line Changed paths: M /pkg/man/Lattice.Rd M /pkg/man/banking.Rd M /pkg/man/cloud.Rd M /pkg/man/histogram.Rd M /pkg/man/levelplot.Rd M /pkg/man/trellis.device.Rd M /pkg/man/xyplot.Rd M /pkg/man/xyplot.ts.Rd improved references ------------------------------------------------------------------------ r593 | deepayan | 2010-05-27 11:41:51 -0700 (Thu, 27 May 2010) | 1 line Changed paths: M /pkg/NAMESPACE M /pkg/R/bwplot.R M /pkg/R/layout.R M /pkg/R/legend.R M /pkg/R/print.trellis.R M /pkg/R/qqmath.R more import and partial matching fixes ------------------------------------------------------------------------ r592 | deepayan | 2010-05-27 10:51:38 -0700 (Thu, 27 May 2010) | 1 line Changed paths: M /pkg/NAMESPACE M /pkg/R/axis.R M /pkg/R/bwplot.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/levelplot.R M /pkg/R/parallel.R M /pkg/R/qq.R M /pkg/R/qqmath.R M /pkg/R/scales.R M /pkg/R/settings.R M /pkg/R/splom.R M /pkg/R/xyplot.R import and partial matching fixes ------------------------------------------------------------------------ r591 | deepayan | 2010-05-27 05:40:00 -0700 (Thu, 27 May 2010) | 1 line Changed paths: M /pkg/inst/po/de/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /pkg/inst/po/fr/LC_MESSAGES/R-lattice.mo M /pkg/man/Lattice.Rd M /pkg/man/xyplot.Rd M /pkg/po/R-de.po M /pkg/po/R-en@quot.po M /pkg/po/R-fr.po M /pkg/po/R-lattice.pot more doc updates, plus updated translation ------------------------------------------------------------------------ r589 | deepayan | 2010-05-25 23:18:38 -0700 (Tue, 25 May 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/man/Lattice.Rd start revision of docs ------------------------------------------------------------------------ r588 | deepayan | 2010-05-19 06:01:16 -0700 (Wed, 19 May 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/levelplot.R more realistic check for equispaced grid in panel.levelplot.raster ------------------------------------------------------------------------ r586 | felix | 2010-05-12 21:00:17 +1000 (Wed, 12 May 2010) | 1 line Changed paths: M /pkg/R/axis.R chron axis methods; new "halfmonth" time step ------------------------------------------------------------------------ r585 | deepayan | 2010-05-07 15:23:54 +1000 (Fri, 07 May 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/xyplot.R improved prepanel for xyplot() ------------------------------------------------------------------------ r584 | felix | 2010-05-04 23:13:48 +1000 (Tue, 04 May 2010) | 1 line Changed paths: M /pkg/R/axis.R fix Date axis problem (need "GMT" timezone); sync prettyDate with R-devel ------------------------------------------------------------------------ r583 | felix | 2010-04-25 20:48:59 +1000 (Sun, 25 Apr 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/scales.R fix for when numeric limit specified with default character scales ------------------------------------------------------------------------ r582 | felix | 2010-04-23 12:10:04 +1000 (Fri, 23 Apr 2010) | 1 line Changed paths: M /pkg/R/axis.R fix timestep ------------------------------------------------------------------------ r581 | felix | 2010-04-23 12:09:30 +1000 (Fri, 23 Apr 2010) | 1 line Changed paths: M /pkg/NAMESPACE M /pkg/R/xyplot.ts.R M /pkg/man/panel.superpose.Rd M /pkg/man/xyplot.ts.Rd improve internals of xyplot.ts (don't clobber styles unless necessary; don't define groups unless relevant) so it works better with layer() etc. New function panel.superpose.plain(). ------------------------------------------------------------------------ r580 | felix | 2010-04-15 16:02:51 +1000 (Thu, 15 Apr 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/R/axis.R M /pkg/SvnLog another problem with Date axis (conversion from POSIXct); final for R 2.11.0 ------------------------------------------------------------------------ r579 | deepayan | 2010-04-15 15:36:06 +1000 (Thu, 15 Apr 2010) | 1 line Changed paths: M /pkg/man/xyplot.Rd further minor doc updates ------------------------------------------------------------------------ r578 | felix | 2010-04-15 15:14:18 +1000 (Thu, 15 Apr 2010) | 1 line Changed paths: M /pkg/R/axis.R M /pkg/R/xyplot.ts.R fix monthly time steps in prettyDate! ------------------------------------------------------------------------ r577 | deepayan | 2010-04-13 20:50:18 +1000 (Tue, 13 Apr 2010) | 1 line Changed paths: M /pkg/man/simpleKey.Rd M /pkg/man/xyplot.Rd doc improvements ------------------------------------------------------------------------ r576 | felix | 2010-04-07 16:58:14 +1000 (Wed, 07 Apr 2010) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/axis.R M /pkg/man/panel.qqmath.Rd local copy of prettyDate; tweak qqmath example ------------------------------------------------------------------------ r575 | felix | 2010-04-06 14:08:45 +1000 (Tue, 06 Apr 2010) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/qqmath.R M /pkg/man/panel.qqmath.Rd M /pkg/man/prepanel.default.Rd add argument 'tails.n' to panel.qqmath ------------------------------------------------------------------------ r574 | felix | 2010-03-29 17:14:17 +1100 (Mon, 29 Mar 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/NEWS M /pkg/R/axis.R M /pkg/man/xyplot.ts.Rd new date/time axes using pretty() ------------------------------------------------------------------------ r573 | deepayan | 2010-03-26 22:56:37 +1100 (Fri, 26 Mar 2010) | 1 line Changed paths: M /pkg/DESCRIPTION M /pkg/INDEX M /pkg/NAMESPACE M /pkg/R/legend.R M /pkg/R/levelplot.R M /pkg/R/miscellaneous.R M /pkg/R/panel.smoothscatter.R M /pkg/man/llines.Rd M /pkg/man/panel.levelplot.Rd M /pkg/man/panel.smoothScatter.Rd miscellaneous updates, including use of grid.raster, and depending on R 2.11 ------------------------------------------------------------------------ r572 | deepayan | 2010-02-28 19:33:42 +1100 (Sun, 28 Feb 2010) | 1 line Changed paths: M /www/Vignettes/src/lattice-intro/Makefile M /www/Vignettes/src/lattice-tricks/Makefile A /www/Vignettes/src/lattice-tricks/SweaveBeamer.sty updates ------------------------------------------------------------------------ r571 | deepayan | 2010-02-28 19:25:15 +1100 (Sun, 28 Feb 2010) | 1 line Changed paths: M /www/Vignettes/src/lattice-intro/Makefile D /www/Vignettes/src/lattice-intro/Sweave.sty M /www/Vignettes/src/lattice-intro/lattice-intro-slides.Rnw updates ------------------------------------------------------------------------ r570 | deepayan | 2010-02-28 19:11:27 +1100 (Sun, 28 Feb 2010) | 1 line Changed paths: A /www/Vignettes A /www/Vignettes/TODO A /www/Vignettes/index.html A /www/Vignettes/src A /www/Vignettes/src/lattice-intro A /www/Vignettes/src/lattice-intro/Makefile A /www/Vignettes/src/lattice-intro/Sweave.sty A /www/Vignettes/src/lattice-intro/SweaveBeamer.sty A /www/Vignettes/src/lattice-intro/figs A /www/Vignettes/src/lattice-intro/lattice-intro-slides.Rnw A /www/Vignettes/src/lattice-intro/lattice-intro.Rnw A /www/Vignettes/src/lattice-intro/references.bib A /www/Vignettes/src/lattice-tricks A /www/Vignettes/src/lattice-tricks/Makefile A /www/Vignettes/src/lattice-tricks/figs A /www/Vignettes/src/lattice-tricks/lattice-tricks-slides.Rnw A /www/Vignettes/src/lattice-tricks/lattice-tricks.Rnw A /www/Vignettes/src/lattice-tricks/panelFunctions.Rnw A /www/Vignettes/src/lattice-tricks/references.bib A /www/Vignettes/src/lattice-tricks/regGcsemv.Rnw A /www/Vignettes/src/lattice-tricks/regOxboys.Rnw A /www/Vignettes/src/lattice-tricks/reorder.Rnw M /www/index.php initial checkin of tutorials section (in progress) ------------------------------------------------------------------------ r569 | felix | 2010-01-28 15:37:36 +1100 (Thu, 28 Jan 2010) | 1 line Changed paths: M /pkg/R/scales.R M /pkg/R/xyplot.ts.R M /pkg/man/xyplot.ts.Rd warnings... ------------------------------------------------------------------------ r568 | felix | 2010-01-25 11:27:57 +1100 (Mon, 25 Jan 2010) | 1 line Changed paths: M /pkg/R/scales.R fix for character limits ------------------------------------------------------------------------ r567 | felix | 2010-01-21 00:09:31 +1100 (Thu, 21 Jan 2010) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/scales.R allow NAs in xlim, ylim etc - e.g. ylim = c(0, NA) ------------------------------------------------------------------------ r566 | felix | 2010-01-21 00:08:15 +1100 (Thu, 21 Jan 2010) | 1 line Changed paths: M /pkg/R/update.trellis.R allow updating scales$axs in update.trellis ------------------------------------------------------------------------ r565 | felix | 2010-01-21 00:05:33 +1100 (Thu, 21 Jan 2010) | 1 line Changed paths: M /pkg/R/common.R fix for NAs in 'layout' ------------------------------------------------------------------------ r564 | felix | 2010-01-20 21:10:35 +1100 (Wed, 20 Jan 2010) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/common.R M /pkg/man/xyplot.Rd allow NA (not Inf) in 'layout' argument. ------------------------------------------------------------------------ r563 | felix | 2010-01-20 12:32:48 +1100 (Wed, 20 Jan 2010) | 1 line Changed paths: M /pkg/NEWS M /pkg/R/common.R M /pkg/man/xyplot.Rd allow Inf in layout argument ------------------------------------------------------------------------ r562 | deepayan | 2010-01-18 05:25:49 +1100 (Mon, 18 Jan 2010) | 1 line Changed paths: M /pkg/R/levelplot.R an experimental panel.levelplot.raster based on grid.raster (for R >= 2.11.0) ------------------------------------------------------------------------ r561 | deepayan | 2010-01-17 22:25:21 +1100 (Sun, 17 Jan 2010) | 1 line Changed paths: M /pkg/ChangeLog M /pkg/DESCRIPTION M /pkg/NEWS M /pkg/SvnLog M /pkg/po/R-lattice.pot updates for release (including version bump to 0.18) ------------------------------------------------------------------------ r560 | felix | 2010-01-11 18:48:42 -0800 (Mon, 11 Jan 2010) | 1 line Changed paths: M /pkg/R/bwplot.R M /pkg/R/cloud.R M /pkg/R/densityplot.R M /pkg/R/histogram.R M /pkg/R/parallel.R M /pkg/R/qqmath.R M /pkg/R/splom.R M /pkg/R/update.trellis.R M /pkg/R/xyplot.R M /pkg/man/xyplot.Rd allow 'text' argument to force auto.key ------------------------------------------------------------------------ r559 | deepayan | 2010-01-11 06:06:53 -0800 (Mon, 11 Jan 2010) | 1 line Changed paths: M /pkg/R/legend.R M /pkg/R/miscellaneous.R A /www/index.php new internal function, plus a placeholder webpage ------------------------------------------------------------------------ r558 | deepayan | 2010-01-10 13:43:10 -0800 (Sun, 10 Jan 2010) | 1 line Changed paths: M /pkg/man/xyplot.Rd fixed typo ------------------------------------------------------------------------ r557 | felix | 2009-12-26 21:57:22 -0800 (Sat, 26 Dec 2009) | 1 line Changed paths: M /pkg/R/panels.R M /pkg/man/panel.superpose.Rd 'group.value' passed by panel.superpose ------------------------------------------------------------------------ r556 | felix | 2009-12-26 21:27:28 -0800 (Sat, 26 Dec 2009) | 1 line Changed paths: M /pkg/INDEX M /pkg/NAMESPACE M /pkg/R/xyplot.ts.R A /pkg/man/xyplot.ts.Rd xyplot.ts: cleanup, add doc ------------------------------------------------------------------------ r555 | deepayan | 2009-12-18 05:27:48 -0800 (Fri, 18 Dec 2009) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R M /trunk/lattice/man/panel.levelplot.Rd panel.levelplot bugfix, and add option for borders NOTE: THIS IS THE SAME ENTRY AS THE NEXT ONE, AND REPRESENTS THE RELOCATION OF THE SUBVERSION TREE FROM https://svn.r-project.org/R-packages/ TO R-FORGE. THIS LEADS TO A REMAPPING OF THE REVISION NUMBERS. ------------------------------------------------------------------------ Change SVN location (to https://lattice.r-forge.r-project.org) ------------------------------------------------------------------------ r5540 | deepayan | 2009-12-18 05:27:48 -0800 (Fri, 18 Dec 2009) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R M /trunk/lattice/man/panel.levelplot.Rd panel.levelplot bugfix, and add option for borders ------------------------------------------------------------------------ r5534 | deepayan | 2009-12-08 23:21:20 -0800 (Tue, 08 Dec 2009) | 1 line Changed paths: M /trunk/lattice/man/xyplot.Rd doc clarification ------------------------------------------------------------------------ r5533 | deepayan | 2009-12-08 22:43:46 -0800 (Tue, 08 Dec 2009) | 1 line Changed paths: M /trunk/lattice/NAMESPACE A /trunk/lattice/R/xyplot.ts.R add xyplot.ts method, merging versions in latticeExtra and zoo (courtesy of Felix Andrews) ------------------------------------------------------------------------ r5531 | deepayan | 2009-12-08 22:40:26 -0800 (Tue, 08 Dec 2009) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/panels.R panel.average fix + minor formatting ------------------------------------------------------------------------ r5490 | deepayan | 2009-10-04 13:06:23 -0700 (Sun, 04 Oct 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NEWS M /trunk/lattice/SvnLog M /trunk/lattice/po/R-lattice.pot updated version, news ------------------------------------------------------------------------ r5489 | deepayan | 2009-10-04 12:59:18 -0700 (Sun, 04 Oct 2009) | 1 line Changed paths: M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/Rows.Rd M /trunk/lattice/man/axis.default.Rd M /trunk/lattice/man/banking.Rd M /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/barley.Rd M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/draw.colorkey.Rd M /trunk/lattice/man/draw.key.Rd M /trunk/lattice/man/environmental.Rd M /trunk/lattice/man/ethanol.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/lattice.options.Rd M /trunk/lattice/man/latticeParseFormula.Rd M /trunk/lattice/man/level.colors.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/lset.Rd M /trunk/lattice/man/make.groups.Rd M /trunk/lattice/man/melanoma.Rd M /trunk/lattice/man/oneway.Rd M /trunk/lattice/man/packet.panel.default.Rd M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.dotplot.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/panel.histogram.Rd M /trunk/lattice/man/panel.levelplot.Rd M /trunk/lattice/man/panel.number.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/panel.parallel.Rd M /trunk/lattice/man/panel.qqmath.Rd M /trunk/lattice/man/panel.qqmathline.Rd M /trunk/lattice/man/panel.smoothScatter.Rd M /trunk/lattice/man/panel.stripplot.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/prepanel.default.Rd M /trunk/lattice/man/prepanel.functions.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/rfs.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/simpleKey.Rd M /trunk/lattice/man/simpleTheme.Rd M /trunk/lattice/man/singer.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/strip.default.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/trellis.object.Rd M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/utilities.3d.Rd M /trunk/lattice/man/xyplot.Rd reordered man pages, plus misc fixes for R 2.10 ------------------------------------------------------------------------ r5488 | deepayan | 2009-09-30 04:52:44 -0700 (Wed, 30 Sep 2009) | 1 line Changed paths: M /trunk/lattice/inst/po/de/LC_MESSAGES/R-lattice.mo M /trunk/lattice/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /trunk/lattice/po/R-de.po M /trunk/lattice/po/R-en@quot.po M /trunk/lattice/po/R-lattice.pot German translation update ------------------------------------------------------------------------ r5484 | deepayan | 2009-09-22 05:23:35 -0700 (Tue, 22 Sep 2009) | 1 line Changed paths: M /trunk/lattice/R/rfs.R rfs default grid change ------------------------------------------------------------------------ r5455 | deepayan | 2009-08-04 17:01:59 -0700 (Tue, 04 Aug 2009) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R revert labels behaviour ------------------------------------------------------------------------ r5454 | deepayan | 2009-08-04 17:01:29 -0700 (Tue, 04 Aug 2009) | 1 line Changed paths: M /trunk/lattice/R/panel.smoothscatter.R guard against failure with a single data point ------------------------------------------------------------------------ r5452 | deepayan | 2009-08-03 10:20:09 -0700 (Mon, 03 Aug 2009) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd added link to panel.interaction.cloud ------------------------------------------------------------------------ r5419 | deepayan | 2009-05-14 16:15:13 -0700 (Thu, 14 May 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/inst/po/de/LC_MESSAGES/R-lattice.mo A /trunk/lattice/inst/po/en@quot A /trunk/lattice/inst/po/en@quot/LC_MESSAGES A /trunk/lattice/inst/po/en@quot/LC_MESSAGES/R-lattice.mo M /trunk/lattice/po/R-de.po M /trunk/lattice/po/R-lattice.pot M /trunk/lattice/update.sh translation updates ------------------------------------------------------------------------ r5418 | deepayan | 2009-05-13 15:38:21 -0700 (Wed, 13 May 2009) | 1 line Changed paths: A /trunk/lattice/po/R-en@quot.po en@quot translations ------------------------------------------------------------------------ r5417 | deepayan | 2009-05-13 14:53:11 -0700 (Wed, 13 May 2009) | 1 line Changed paths: M /trunk/lattice/po/R-lattice.pot M /trunk/lattice/update.sh fix .mo file names ------------------------------------------------------------------------ r5416 | deepayan | 2009-05-13 14:52:41 -0700 (Wed, 13 May 2009) | 1 line Changed paths: D /trunk/lattice/inst/po/de/LC_MESSAGES/R-de.mo A /trunk/lattice/inst/po/de/LC_MESSAGES/R-lattice.mo (from /trunk/lattice/inst/po/de/LC_MESSAGES/R-de.mo:5415) D /trunk/lattice/inst/po/fr/LC_MESSAGES/R-fr.mo A /trunk/lattice/inst/po/fr/LC_MESSAGES/R-lattice.mo (from /trunk/lattice/inst/po/fr/LC_MESSAGES/R-fr.mo:5415) fix .mo file names ------------------------------------------------------------------------ r5415 | deepayan | 2009-05-13 14:47:19 -0700 (Wed, 13 May 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NEWS A /trunk/lattice/inst A /trunk/lattice/inst/po A /trunk/lattice/inst/po/de A /trunk/lattice/inst/po/de/LC_MESSAGES A /trunk/lattice/inst/po/de/LC_MESSAGES/R-de.mo A /trunk/lattice/inst/po/fr A /trunk/lattice/inst/po/fr/LC_MESSAGES A /trunk/lattice/inst/po/fr/LC_MESSAGES/R-fr.mo M /trunk/lattice/man/level.colors.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.levelplot.Rd M /trunk/lattice/po/R-lattice.pot M /trunk/lattice/update.sh doc fixes, and translation-related updates ------------------------------------------------------------------------ r5401 | deepayan | 2009-04-28 15:26:35 -0700 (Tue, 28 Apr 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION A /trunk/lattice/po/R-de.po M /trunk/lattice/po/R-fr.po M /trunk/lattice/po/R-lattice.pot added German translations ------------------------------------------------------------------------ r5400 | deepayan | 2009-04-28 15:26:11 -0700 (Tue, 28 Apr 2009) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R M /trunk/lattice/man/panel.levelplot.Rd levelplot labeling fix ------------------------------------------------------------------------ r5385 | deepayan | 2009-04-03 17:53:54 -0700 (Fri, 03 Apr 2009) | 1 line Changed paths: M /trunk/lattice/man/panel.smoothScatter.Rd removed another link ------------------------------------------------------------------------ r5384 | deepayan | 2009-04-03 17:43:07 -0700 (Fri, 03 Apr 2009) | 1 line Changed paths: M /trunk/lattice/man/panel.smoothScatter.Rd removed doc link that would be absent in R < 2.9.0 ------------------------------------------------------------------------ r5383 | deepayan | 2009-04-03 17:37:31 -0700 (Fri, 03 Apr 2009) | 1 line Changed paths: M /trunk/lattice/man/panel.smoothScatter.Rd fixed doc mismatch ------------------------------------------------------------------------ r5382 | deepayan | 2009-04-03 17:36:45 -0700 (Fri, 03 Apr 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/NEWS A /trunk/lattice/R/panel.smoothscatter.R A /trunk/lattice/man/panel.smoothScatter.Rd added panel.smoothScatter ------------------------------------------------------------------------ r5379 | deepayan | 2009-03-26 14:09:05 -0700 (Thu, 26 Mar 2009) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/xyplot.Rd update to panel.violin fix ------------------------------------------------------------------------ r5378 | deepayan | 2009-03-26 11:27:09 -0700 (Thu, 26 Mar 2009) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R fixed panel.violin to handle length-1 samples ------------------------------------------------------------------------ r5339 | deepayan | 2009-02-03 13:11:58 -0800 (Tue, 03 Feb 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/common.R M /trunk/lattice/R/scales.R fixed aspect='iso' behaviour in levelplot with factor x and y ------------------------------------------------------------------------ r5316 | deepayan | 2009-01-05 17:59:58 -0800 (Mon, 05 Jan 2009) | 1 line Changed paths: M /trunk/lattice/SvnLog M /trunk/lattice/po/R-lattice.pot updated log ------------------------------------------------------------------------ r5315 | deepayan | 2009-01-05 16:57:02 -0800 (Mon, 05 Jan 2009) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/strip.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/zzz.R M /trunk/lattice/man/ethanol.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.qqmathline.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/prepanel.functions.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/xyplot.Rd fixed many partial argument matches ------------------------------------------------------------------------ r5310 | deepayan | 2008-12-28 19:37:12 -0800 (Sun, 28 Dec 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/legend.R M /trunk/lattice/R/settings.R M /trunk/lattice/man/xyplot.Rd support custom rectangle border colors in draw.key, fixed doc error ------------------------------------------------------------------------ r5305 | deepayan | 2008-12-23 16:44:17 -0800 (Tue, 23 Dec 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/levelplot.R M /trunk/lattice/SvnLog M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/tmd.Rd fixed doc typo, reverted to old axis behaviour for levelplot.matrix etc. ------------------------------------------------------------------------ r5270 | deepayan | 2008-11-20 23:37:39 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/common.R make extend.limits handle NAs ------------------------------------------------------------------------ r5269 | deepayan | 2008-11-20 21:39:30 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/xyplot.R fixed densityplot prepanel bug for empty packets; also cleaned up NA usage ------------------------------------------------------------------------ r5268 | deepayan | 2008-11-20 21:08:29 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/man/barchart.table.Rd fixed spelling mistake ------------------------------------------------------------------------ r5267 | deepayan | 2008-11-20 20:58:03 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/splom.R M /trunk/lattice/man/levelplot.Rd added a table method for levelplot; better memory management for splom and parallel methods ------------------------------------------------------------------------ r5266 | deepayan | 2008-11-20 16:09:55 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/update.trellis.R cleaned up remaining bugs ------------------------------------------------------------------------ r5265 | deepayan | 2008-11-20 01:31:14 -0800 (Thu, 20 Nov 2008) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/panel.bwplot.Rd Added support for notches in panel.bwplot (thanks to patch from Mike Kay) ------------------------------------------------------------------------ r5264 | deepayan | 2008-11-19 17:18:45 -0800 (Wed, 19 Nov 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/interaction.Rd fixed trellis.focus() bug by adding a dummy viewport ------------------------------------------------------------------------ r5263 | deepayan | 2008-11-17 17:32:25 -0800 (Mon, 17 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/update.trellis.R bugfix for [.trellis ------------------------------------------------------------------------ r5262 | deepayan | 2008-11-12 22:24:45 -0800 (Wed, 12 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/update.trellis.R update.trellis bugfixes ------------------------------------------------------------------------ r5261 | deepayan | 2008-11-10 23:33:18 -0800 (Mon, 10 Nov 2008) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/histogram.R bug-fixes related to factor handling ------------------------------------------------------------------------ r5241 | deepayan | 2008-10-08 13:58:14 -0700 (Wed, 08 Oct 2008) | 1 line Changed paths: M /trunk/lattice/man/simpleTheme.Rd M /trunk/lattice/man/splom.Rd doc clarifications ------------------------------------------------------------------------ r5240 | deepayan | 2008-10-02 19:22:15 -0700 (Thu, 02 Oct 2008) | 1 line Changed paths: M /trunk/lattice/man/print.trellis.Rd fixed typo ------------------------------------------------------------------------ r5230 | deepayan | 2008-09-17 12:27:32 -0700 (Wed, 17 Sep 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION updated version ------------------------------------------------------------------------ r5229 | deepayan | 2008-09-11 23:29:55 -0700 (Thu, 11 Sep 2008) | 1 line Changed paths: M /trunk/lattice/R/axis.R update of previous bugfix ------------------------------------------------------------------------ r5228 | deepayan | 2008-09-11 22:11:08 -0700 (Thu, 11 Sep 2008) | 1 line Changed paths: M /trunk/lattice/R/axis.R bugfix: was using wrong argument name ------------------------------------------------------------------------ r5227 | deepayan | 2008-09-11 22:10:33 -0700 (Thu, 11 Sep 2008) | 1 line Changed paths: M /trunk/lattice/R/interaction.R skip points outside bounding box (not drawn) when identifying ------------------------------------------------------------------------ r5222 | deepayan | 2008-09-03 18:02:18 -0700 (Wed, 03 Sep 2008) | 1 line Changed paths: M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/update.trellis.Rd updated update.trellis() to recognise 'plot.args' and 'lattice.options' ------------------------------------------------------------------------ r5221 | deepayan | 2008-08-29 16:59:53 -0700 (Fri, 29 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/draw.key.Rd M /trunk/lattice/po/R-lattice.pot better handling of legends in update.trellis ------------------------------------------------------------------------ r5220 | deepayan | 2008-08-28 13:04:07 -0700 (Thu, 28 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd made interactive part customizable in panel.identify.cloud ------------------------------------------------------------------------ r5219 | deepayan | 2008-08-27 16:32:49 -0700 (Wed, 27 Aug 2008) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/cloud.R M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd added a panel.identify.cloud ------------------------------------------------------------------------ r5218 | deepayan | 2008-08-27 15:01:32 -0700 (Wed, 27 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/panels.R [pre]panel.lmline now checks for at least 2 observations ------------------------------------------------------------------------ r5216 | deepayan | 2008-08-25 16:59:04 -0700 (Mon, 25 Aug 2008) | 1 line Changed paths: M /trunk/lattice/man/llines.Rd doc update ------------------------------------------------------------------------ r5215 | deepayan | 2008-08-25 16:58:41 -0700 (Mon, 25 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/barchart.table.Rd added a 'horizontal' argument for dotplot.table ------------------------------------------------------------------------ r5214 | deepayan | 2008-08-25 16:44:04 -0700 (Mon, 25 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/densityplot.R M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/prepanel.default.Rd added a 'weights' argument to densityplot ------------------------------------------------------------------------ r5210 | deepayan | 2008-08-20 17:04:22 -0700 (Wed, 20 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/densityplot.R draw density last, to allow grids etc. ------------------------------------------------------------------------ r5209 | deepayan | 2008-08-20 16:41:34 -0700 (Wed, 20 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/axis.R date-time fix ported from R ------------------------------------------------------------------------ r5208 | deepayan | 2008-08-20 16:40:39 -0700 (Wed, 20 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/llines.Rd added 'col.symbol' convenience in lplot.xy ------------------------------------------------------------------------ r5207 | deepayan | 2008-08-20 16:39:15 -0700 (Wed, 20 Aug 2008) | 1 line Changed paths: M /trunk/lattice/demo/lattice.R use devAskNewPage instead of grid.prompt if available ------------------------------------------------------------------------ r5203 | deepayan | 2008-08-11 18:18:33 -0700 (Mon, 11 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/layout.R M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/panel.parallel.Rd M /trunk/lattice/man/splom.Rd bugfix and doc updates ------------------------------------------------------------------------ r5202 | deepayan | 2008-08-10 00:24:42 -0700 (Sun, 10 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/layout.R bugfix: layout calculations now use scale.components ------------------------------------------------------------------------ r5200 | deepayan | 2008-08-08 16:25:01 -0700 (Fri, 08 Aug 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NEWS M /trunk/lattice/R/parallel.R M /trunk/lattice/man/panel.parallel.Rd M /trunk/lattice/man/prepanel.default.Rd M /trunk/lattice/man/splom.Rd changed horizontal to horizontal.axis in parallel ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5194 | deepayan | 2008-08-05 15:41:08 -0700 (Tue, 05 Aug 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/man/prepanel.default.Rd improved memory usage for non-formula methods; make one less copy ------------------------------------------------------------------------ r5183 | deepayan | 2008-08-01 17:16:14 -0700 (Fri, 01 Aug 2008) | 1 line Changed paths: M /trunk/lattice/R/parallel.R M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.parallel.Rd M /trunk/lattice/man/prepanel.default.Rd M /trunk/lattice/man/splom.Rd added the possibility of parallel coordinate plots stacked side by side through a 'horizontal' argument. ------------------------------------------------------------------------ r5182 | deepayan | 2008-08-01 12:56:04 -0700 (Fri, 01 Aug 2008) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.functions.Rd added a panel.refline() function ------------------------------------------------------------------------ r5179 | deepayan | 2008-07-24 17:37:03 -0700 (Thu, 24 Jul 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/histogram.Rd slightly reworked prepanel functions to get better date support ------------------------------------------------------------------------ r5175 | deepayan | 2008-07-11 17:28:33 -0700 (Fri, 11 Jul 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/panel.bwplot.Rd fix use of alpha in panel.bwplot ------------------------------------------------------------------------ r5167 | deepayan | 2008-06-23 15:52:14 -0700 (Mon, 23 Jun 2008) | 1 line Changed paths: M /trunk/lattice/R/layout.R bugfix: strip heights in layout.widths settings were being used twice ------------------------------------------------------------------------ r5162 | deepayan | 2008-06-19 12:17:33 -0700 (Thu, 19 Jun 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/xyplot.R bugfix: [xy]lim=list() didn't work with scales=TRUE (reported by Richard Cotton) ------------------------------------------------------------------------ r5161 | deepayan | 2008-06-19 11:58:08 -0700 (Thu, 19 Jun 2008) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R bugfix: prepanel.default.levelplot was not handling Date-Time variables correctly ------------------------------------------------------------------------ r5141 | deepayan | 2008-05-29 19:46:51 -0700 (Thu, 29 May 2008) | 1 line Changed paths: M /trunk/lattice/R/common.R M /trunk/lattice/R/scales.R a more sophisticated (but unexported) version of banking ------------------------------------------------------------------------ r5138 | deepayan | 2008-05-27 13:59:48 -0700 (Tue, 27 May 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/cloud.R bugfix in cloud(..., groups=, col=) with repeated colors ------------------------------------------------------------------------ r5134 | deepayan | 2008-05-16 17:17:28 -0700 (Fri, 16 May 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/man/xyplot.Rd clarified interpretation of subscripts, updated DESCRIPTION ------------------------------------------------------------------------ r5133 | deepayan | 2008-05-16 17:16:11 -0700 (Fri, 16 May 2008) | 1 line Changed paths: M /trunk/lattice/R/histogram.R bugfix for non-numeric (e.g. Date) 'breaks' in histogram ------------------------------------------------------------------------ r5125 | deepayan | 2008-05-02 15:51:47 -0700 (Fri, 02 May 2008) | 1 line Changed paths: M /trunk/lattice/SvnLog M /trunk/lattice/po/R-lattice.pot updated logs ------------------------------------------------------------------------ r5124 | deepayan | 2008-05-02 15:49:51 -0700 (Fri, 02 May 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/panels.R D /trunk/lattice/inst M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/panel.functions.Rd added support for 'type' in panel.average, plus misc bookkeeping ------------------------------------------------------------------------ r5123 | deepayan | 2008-05-02 15:41:17 -0700 (Fri, 02 May 2008) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R renamed panel.brush.splom to panel.link.splom (which is less of a misnomer) ------------------------------------------------------------------------ r5112 | deepayan | 2008-04-24 14:42:23 -0700 (Thu, 24 Apr 2008) | 1 line Changed paths: M /trunk/lattice/NEWS updated NEWS ------------------------------------------------------------------------ r5111 | deepayan | 2008-04-24 14:39:32 -0700 (Thu, 24 Apr 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/xyplot.Rd updated man pages to include Springer book reference ------------------------------------------------------------------------ r5086 | deepayan | 2008-04-22 09:22:34 -0700 (Tue, 22 Apr 2008) | 1 line Changed paths: A /trunk/lattice/NEWS (from /trunk/lattice/inst/Changes:5085) D /trunk/lattice/inst/Changes renamed inst/Changes to NEWS, which is more standard ------------------------------------------------------------------------ r4966 | deepayan | 2008-02-28 08:31:34 -0800 (Thu, 28 Feb 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/man/make.groups.Rd fixed typo ------------------------------------------------------------------------ r4948 | deepayan | 2008-02-15 19:03:09 -0800 (Fri, 15 Feb 2008) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/SvnLog M /trunk/lattice/inst/Changes M /trunk/lattice/man/cloud.Rd M /trunk/lattice/po/R-lattice.pot xlim/ylim updates in cloud() too; updated logs ------------------------------------------------------------------------ r4947 | deepayan | 2008-02-14 23:05:22 -0800 (Thu, 14 Feb 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/man/levelplot.Rd documented new arguments, bumped version ------------------------------------------------------------------------ r4946 | deepayan | 2008-02-14 18:30:10 -0800 (Thu, 14 Feb 2008) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/levelplot.R better axis labeling for matrix input ------------------------------------------------------------------------ r4945 | deepayan | 2008-02-14 16:50:26 -0800 (Thu, 14 Feb 2008) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/print.trellis.Rd added support for 'panel.error=NULL' in print.trellis(), to bypass tryCatch when calling panel functions. This allows the use of normal debgging tools such as traceback() and recover() ------------------------------------------------------------------------ r4920 | deepayan | 2008-02-05 13:02:00 -0800 (Tue, 05 Feb 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/axis.R bugfix in formattedTicksAndLabels.POSIXct; labels are now subsetted in accordance with at ------------------------------------------------------------------------ r4898 | deepayan | 2008-01-11 14:12:50 -0800 (Fri, 11 Jan 2008) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/parallel.R M /trunk/lattice/R/splom.R M /trunk/lattice/man/splom.Rd fixed scoping behaviour for some non-formula methods ------------------------------------------------------------------------ r4896 | deepayan | 2008-01-03 10:13:56 -0800 (Thu, 03 Jan 2008) | 1 line Changed paths: M /trunk/lattice/R/parallel.R M /trunk/lattice/R/splom.R better scoping behaviour ------------------------------------------------------------------------ r4892 | deepayan | 2007-12-31 15:40:44 -0800 (Mon, 31 Dec 2007) | 1 line Changed paths: M /trunk/lattice/demo/00Index M /trunk/lattice/man/Lattice.Rd better behaved link to ?interaction ------------------------------------------------------------------------ r4881 | deepayan | 2007-12-25 22:42:30 -0800 (Tue, 25 Dec 2007) | 1 line Changed paths: M /trunk/lattice/man/interaction.Rd clarification of 'name' argument ------------------------------------------------------------------------ r4877 | deepayan | 2007-12-17 14:59:58 -0800 (Mon, 17 Dec 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R replaced wrong use of by() by tapply() (no longer works in r-devel) ------------------------------------------------------------------------ r4876 | deepayan | 2007-12-16 13:48:07 -0800 (Sun, 16 Dec 2007) | 1 line Changed paths: A /trunk/lattice/demo/labels.R M /trunk/lattice/demo/lattice.R added a 'labels' demo as promised in the book ------------------------------------------------------------------------ r4875 | deepayan | 2007-12-16 13:47:23 -0800 (Sun, 16 Dec 2007) | 1 line Changed paths: M /trunk/lattice/R/settings.R modified (desaturated) superpose.polygon colors ------------------------------------------------------------------------ r4872 | deepayan | 2007-12-10 13:04:57 -0800 (Mon, 10 Dec 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.stripplot.Rd clarification ------------------------------------------------------------------------ r4869 | deepayan | 2007-12-07 22:34:35 -0800 (Fri, 07 Dec 2007) | 1 line Changed paths: M /trunk/lattice/man/axis.default.Rd added details of return value ------------------------------------------------------------------------ r4866 | deepayan | 2007-12-06 09:21:18 -0800 (Thu, 06 Dec 2007) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/panel.xyplot.Rd type='s' now works as plot in panel.points etc (but not in panel.xyplot) ------------------------------------------------------------------------ r4865 | deepayan | 2007-12-06 09:20:45 -0800 (Thu, 06 Dec 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.barchart.Rd doc fix (had spaces between braces) ------------------------------------------------------------------------ r4864 | deepayan | 2007-12-06 09:19:08 -0800 (Thu, 06 Dec 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/parallel.R M /trunk/lattice/man/splom.Rd added auto.key support to parallel ------------------------------------------------------------------------ r4841 | deepayan | 2007-10-31 18:37:39 -0700 (Wed, 31 Oct 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/print.trellis.R honor alpha specification for xlab, ylab, main, sub ------------------------------------------------------------------------ r4839 | deepayan | 2007-10-26 01:42:10 -0700 (Fri, 26 Oct 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/legend.R M /trunk/lattice/R/splom.R fixed a couple of wrong uses of any() ------------------------------------------------------------------------ r4833 | deepayan | 2007-10-15 18:12:38 -0700 (Mon, 15 Oct 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/print.trellis.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/print.trellis.Rd A /trunk/lattice/man/simpleTheme.Rd M /trunk/lattice/man/trellis.device.Rd simpleTheme() documented, print.trellis now uses lattice.getOption('print.function') to do the actual printing, plus misc updates ------------------------------------------------------------------------ r4811 | deepayan | 2007-10-04 15:33:17 -0700 (Thu, 04 Oct 2007) | 1 line Changed paths: M /trunk/lattice/R/histogram.R include 'right' parameter in hist() call ------------------------------------------------------------------------ r4797 | deepayan | 2007-09-28 18:21:58 -0700 (Fri, 28 Sep 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION made license standard ------------------------------------------------------------------------ r4796 | deepayan | 2007-09-28 18:21:12 -0700 (Fri, 28 Sep 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.device.Rd exported simpleTheme (not yet documented) ------------------------------------------------------------------------ r4792 | deepayan | 2007-09-27 18:09:39 -0700 (Thu, 27 Sep 2007) | 1 line Changed paths: M /trunk/lattice/R/settings.R new function simpleTheme (as yet unexported) to create a theme just from graphical parameters, to be used to produce temporary themes on the fly ------------------------------------------------------------------------ r4777 | deepayan | 2007-09-20 15:57:32 -0700 (Thu, 20 Sep 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R changed use of prefix in print.trellis so that printing another trellis object while one is being printed doesn't mess things up ------------------------------------------------------------------------ r4770 | deepayan | 2007-09-13 15:36:54 -0700 (Thu, 13 Sep 2007) | 1 line Changed paths: M /trunk/lattice/man/strip.default.Rd fixed typo ------------------------------------------------------------------------ r4764 | deepayan | 2007-09-07 17:28:36 -0700 (Fri, 07 Sep 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/common.R M /trunk/lattice/inst/Changes reverted recently introduced behaviour of setting names(x) <- rownames(data) for formulas of the form ~x, as this gives undesirable results for bwplot ------------------------------------------------------------------------ r4761 | deepayan | 2007-09-03 17:23:51 -0700 (Mon, 03 Sep 2007) | 1 line Changed paths: M /trunk/lattice/man/xyplot.Rd clarified role of scales ------------------------------------------------------------------------ r4757 | deepayan | 2007-08-31 16:05:30 -0700 (Fri, 31 Aug 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/po/R-lattice.pot escape % sign in man page ------------------------------------------------------------------------ r4755 | deepayan | 2007-08-31 14:31:14 -0700 (Fri, 31 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/man/levelplot.Rd support for label rotation in colorkey ------------------------------------------------------------------------ r4754 | deepayan | 2007-08-31 14:26:37 -0700 (Fri, 31 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.functions.Rd alpha parameter for panel.abline ------------------------------------------------------------------------ r4740 | deepayan | 2007-08-15 17:22:38 -0700 (Wed, 15 Aug 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/panel.xyplot.Rd misc fixes, and an example illustrating use of 'type' in panel.xyplot ------------------------------------------------------------------------ r4727 | deepayan | 2007-08-11 13:48:05 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/axis.R A /trunk/lattice/man/level.colors.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/tests/dates.R documentation for level.colors and some other minor stuff ------------------------------------------------------------------------ r4726 | deepayan | 2007-08-11 12:16:25 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R better matching of panel function arguments ------------------------------------------------------------------------ r4724 | deepayan | 2007-08-11 12:14:01 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R new function level.colors and applications ------------------------------------------------------------------------ r4723 | deepayan | 2007-08-11 12:09:04 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/man/xyplot.Rd fixed obsolete description of panel.number etc. ------------------------------------------------------------------------ r4722 | deepayan | 2007-08-11 11:05:48 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/src/threeDplot.c M /trunk/lattice/src/threeDplot.h fix for bad static declaration in header ------------------------------------------------------------------------ r4721 | deepayan | 2007-08-11 11:04:53 -0700 (Sat, 11 Aug 2007) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R supply lwd to grid.points ------------------------------------------------------------------------ r4683 | deepayan | 2007-07-30 18:23:00 -0700 (Mon, 30 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/parallel.R bugfix in grouping in parallel coordinate plots ------------------------------------------------------------------------ r4682 | deepayan | 2007-07-30 18:22:20 -0700 (Mon, 30 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/axis.R bugfix in axis labeling for 'Date' variables ------------------------------------------------------------------------ r4631 | deepayan | 2007-07-16 19:10:59 -0700 (Mon, 16 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R strip.left now gets called with horizontal=FALSE ------------------------------------------------------------------------ r4630 | deepayan | 2007-07-16 19:09:47 -0700 (Mon, 16 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R better $call in dotplot.numeric and barchart.numeric ------------------------------------------------------------------------ r4629 | deepayan | 2007-07-16 19:08:45 -0700 (Mon, 16 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/scales.R some fixes for date support (related to dates no longer being numeric) ------------------------------------------------------------------------ r4628 | deepayan | 2007-07-16 19:06:52 -0700 (Mon, 16 Jul 2007) | 1 line Changed paths: M /trunk/lattice/man/banking.Rd added the sunspot example to ?banking ------------------------------------------------------------------------ r4611 | deepayan | 2007-07-12 18:12:24 -0700 (Thu, 12 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R labels (xlab, main, etc) can now be vectors, and supports more parameters ------------------------------------------------------------------------ r4610 | deepayan | 2007-07-12 18:11:18 -0700 (Thu, 12 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/summary.trellis.R made dimnames settable, so that changing levels and names of conditioning variables is now possible ------------------------------------------------------------------------ r4609 | deepayan | 2007-07-12 14:39:47 -0700 (Thu, 12 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R changed width calculation for levelplots when x, y are factors ------------------------------------------------------------------------ r4594 | deepayan | 2007-07-10 11:58:42 -0700 (Tue, 10 Jul 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/cloud.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/levelplot.Rd added '(row|column).values' arguments in levelplot.matrix and cloud.matrix ------------------------------------------------------------------------ r4593 | deepayan | 2007-07-10 11:57:26 -0700 (Tue, 10 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/barchart.table.Rd added a 'horizontal' option in barchart.table ------------------------------------------------------------------------ r4554 | deepayan | 2007-07-05 11:42:20 -0700 (Thu, 05 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R a better value for the call slot of trellis objects; update.default now works ------------------------------------------------------------------------ r4553 | deepayan | 2007-07-05 11:40:34 -0700 (Thu, 05 Jul 2007) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd a cloud.table method ------------------------------------------------------------------------ r4552 | deepayan | 2007-07-05 11:39:49 -0700 (Thu, 05 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/common.R 'x' in dotplot(~x, data) etc now gets names(x) set to rownames(data) ------------------------------------------------------------------------ r4551 | deepayan | 2007-07-05 11:36:06 -0700 (Thu, 05 Jul 2007) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/interaction.Rd change in trellis.focus() return value, plus misc bugfixes ------------------------------------------------------------------------ r4526 | deepayan | 2007-06-29 19:20:29 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.pairs.Rd Added note that date-time variables are not properly supported by splom ------------------------------------------------------------------------ r4524 | deepayan | 2007-06-29 18:53:09 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd changed trellis.focus() behaviour when there is only one panel ------------------------------------------------------------------------ r4522 | deepayan | 2007-06-29 17:26:31 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.levelplot.Rd improvements and doc clarifications concerning the 'labels' argument of panel.levelplot ------------------------------------------------------------------------ r4521 | deepayan | 2007-06-29 16:24:15 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/R/settings.R M /trunk/lattice/man/interaction.Rd misc cleanup ------------------------------------------------------------------------ r4520 | deepayan | 2007-06-29 16:21:53 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/print.trellis.Rd added an error handling mechanism for panel functions ------------------------------------------------------------------------ r4519 | deepayan | 2007-06-29 16:19:52 -0700 (Fri, 29 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/zzz.R changing default paddings to be absolute ------------------------------------------------------------------------ r4512 | deepayan | 2007-06-27 11:43:18 -0700 (Wed, 27 Jun 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R an interactive ``brushing'' function for splom ------------------------------------------------------------------------ r4510 | deepayan | 2007-06-26 16:11:45 -0700 (Tue, 26 Jun 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd new function panel.identify.qqmath ------------------------------------------------------------------------ r4509 | deepayan | 2007-06-26 16:01:38 -0700 (Tue, 26 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/common.R capture 'subscripts' argument even for those functions that don't support it ------------------------------------------------------------------------ r4508 | deepayan | 2007-06-26 16:00:40 -0700 (Tue, 26 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R removed uses of fast.quantile, which is no longer necessary ------------------------------------------------------------------------ r4507 | deepayan | 2007-06-26 12:47:19 -0700 (Tue, 26 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/interaction.Rd new interaction feature: trellis.focus() without arguments allows choosing panel by clicking on it ------------------------------------------------------------------------ r4482 | deepayan | 2007-06-18 16:32:42 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/inst/Changes updated version and changelog ------------------------------------------------------------------------ r4481 | deepayan | 2007-06-18 16:30:18 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/xyplot.Rd better control over placement of key, including a new option ------------------------------------------------------------------------ r4480 | deepayan | 2007-06-18 16:22:21 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.device.Rd added 'standard.theme', an alias for 'canonical.theme' ------------------------------------------------------------------------ r4479 | deepayan | 2007-06-18 16:20:27 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.xyplot.Rd better support for jittering in panel.stripplot and panel.xyplot ------------------------------------------------------------------------ r4478 | deepayan | 2007-06-18 16:19:33 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/xyplot.R better support for jittering in panel.stripplot and panel.xyplot ------------------------------------------------------------------------ r4477 | deepayan | 2007-06-18 16:15:38 -0700 (Mon, 18 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/axis.R bugfix for chron dates ------------------------------------------------------------------------ r4437 | deepayan | 2007-06-05 17:51:22 -0700 (Tue, 05 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R fixed bugs introduced by recent changes ------------------------------------------------------------------------ r4435 | deepayan | 2007-06-05 12:57:38 -0700 (Tue, 05 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R slightly cleaner computation of color indices ------------------------------------------------------------------------ r4434 | deepayan | 2007-06-05 12:38:55 -0700 (Tue, 05 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R formatting change ------------------------------------------------------------------------ r4433 | deepayan | 2007-06-05 12:21:41 -0700 (Tue, 05 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R bugfix to make panel.levelplot work with one row or column ------------------------------------------------------------------------ r4408 | deepayan | 2007-06-01 17:46:09 -0700 (Fri, 01 Jun 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R changed all slots to sys.call(sys.parent()), which hopefully better approximates the original call ------------------------------------------------------------------------ r4401 | deepayan | 2007-05-29 12:38:14 -0700 (Tue, 29 May 2007) | 1 line Changed paths: M /trunk/lattice/SvnLog M /trunk/lattice/inst/Changes M /trunk/lattice/po/R-fr.po M /trunk/lattice/po/R-lattice.pot updated translations and change logs ------------------------------------------------------------------------ r4400 | deepayan | 2007-05-29 12:28:38 -0700 (Tue, 29 May 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/print.trellis.R M /trunk/lattice/demo/lattice.R bumped version, fixed strip clipping issue in demo ------------------------------------------------------------------------ r4399 | deepayan | 2007-05-29 11:41:53 -0700 (Tue, 29 May 2007) | 12 lines Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/strip.R M /trunk/lattice/man/cloud.Rd (hopefully) better handling of clipping for strips fixes for default tick/label computations (esp. in cloud etc) changed default aspect for cloud.matrix and wireframe.matrix fix for contour label alignment ------------------------------------------------------------------------ r4390 | deepayan | 2007-05-27 15:55:07 -0700 (Sun, 27 May 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION bumped version ------------------------------------------------------------------------ r4389 | deepayan | 2007-05-27 15:47:06 -0700 (Sun, 27 May 2007) | 1 line Changed paths: M /trunk/lattice/R/legend.R bugfix: 'fill' didn't work in legends ------------------------------------------------------------------------ r4379 | deepayan | 2007-05-22 11:33:54 -0700 (Tue, 22 May 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.cloud.Rd doc clarification ------------------------------------------------------------------------ r4376 | deepayan | 2007-05-21 19:13:04 -0700 (Mon, 21 May 2007) | 1 line Changed paths: M /trunk/lattice/R/common.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/xyplot.R changes related to dates being no longer numeric in R ------------------------------------------------------------------------ r4375 | deepayan | 2007-05-21 18:54:10 -0700 (Mon, 21 May 2007) | 1 line Changed paths: M /trunk/lattice/R/zzz.R unimportant fix in .First.lib (typically unused) ------------------------------------------------------------------------ r4374 | deepayan | 2007-05-21 18:53:31 -0700 (Mon, 21 May 2007) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R workaround in ltext.default to handle srt=NA by treating them as srt=0 ------------------------------------------------------------------------ r4373 | deepayan | 2007-05-21 18:52:00 -0700 (Mon, 21 May 2007) | 1 line Changed paths: M /trunk/lattice/tests/MASSch04.R M /trunk/lattice/tests/dates.R minor fixes in tests ------------------------------------------------------------------------ r4372 | deepayan | 2007-05-21 18:48:45 -0700 (Mon, 21 May 2007) | 1 line Changed paths: M /trunk/lattice/man/prepanel.default.Rd added panel.aspect in docs ------------------------------------------------------------------------ r4342 | deepayan | 2007-05-14 16:53:40 -0700 (Mon, 14 May 2007) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/man/cloud.Rd (1) added a new panel.aspect argument and (2) made default color white if background is transparent ------------------------------------------------------------------------ r4341 | deepayan | 2007-05-14 16:51:11 -0700 (Mon, 14 May 2007) | 1 line Changed paths: M /trunk/lattice/R/settings.R changed default clip to 'on' for strip (not sure why it wasn't) ------------------------------------------------------------------------ r4340 | deepayan | 2007-05-14 16:48:47 -0700 (Mon, 14 May 2007) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd slightly modified example ------------------------------------------------------------------------ r4319 | deepayan | 2007-04-30 15:01:12 -0700 (Mon, 30 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/panels.R M /trunk/lattice/R/qqmath.R changed prepanel.qqmath.default and panel.loess to be more tolerant of non-finite values ------------------------------------------------------------------------ r4318 | deepayan | 2007-04-30 14:37:09 -0700 (Mon, 30 Apr 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/man/llines.Rd changed as.name() to quote() in several places, and updated docs to reflect lpolygon fix that ignores font parameters ------------------------------------------------------------------------ r4315 | deepayan | 2007-04-26 19:18:44 -0700 (Thu, 26 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R version of lpolygon that honors color (but may be slow (it's a grid thing that Paul will fix)) ------------------------------------------------------------------------ r4314 | deepayan | 2007-04-26 19:13:09 -0700 (Thu, 26 Apr 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/man/panel.functions.Rd panel.average in NAMESPACE and docs ------------------------------------------------------------------------ r4313 | deepayan | 2007-04-26 19:11:44 -0700 (Thu, 26 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/panels.R added a hoizontal argument to panel.loess and made panel.average an alias of panel.linejoin ------------------------------------------------------------------------ r4295 | deepayan | 2007-04-24 14:21:13 -0700 (Tue, 24 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/parallel.R (1) made parallel(..., groups=) more efficient. (2) Tick labels default to row/colnames in cloud.matrix. ------------------------------------------------------------------------ r4294 | deepayan | 2007-04-23 20:52:43 -0700 (Mon, 23 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/parallel.R panel.parallel had calls like z[subscripts,i,] (not sure why) which is giving errors with matrices ------------------------------------------------------------------------ r4293 | deepayan | 2007-04-23 17:58:54 -0700 (Mon, 23 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R bug fix in lpolygon (border could only be black or transparent) ------------------------------------------------------------------------ r4292 | deepayan | 2007-04-19 15:05:39 -0700 (Thu, 19 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/histogram.R M /trunk/lattice/R/layout.R fixed spurious warning about between not being multiple of longer vector etc. ------------------------------------------------------------------------ r4291 | deepayan | 2007-04-17 16:08:10 -0700 (Tue, 17 Apr 2007) | 1 line Changed paths: M /trunk/lattice/R/shingle.R bug fix in print.shingle ------------------------------------------------------------------------ r4287 | deepayan | 2007-04-13 11:25:41 -0700 (Fri, 13 Apr 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/man/trellis.device.Rd clarified documentation ------------------------------------------------------------------------ r4233 | deepayan | 2007-04-01 17:09:07 -0700 (Sun, 01 Apr 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/prepanel.default.Rd M /trunk/lattice/po/R-fr.po M /trunk/lattice/po/R-lattice.pot changed default of b to 0 in panel.abline to minimize potential problems in other packages ------------------------------------------------------------------------ r4216 | deepayan | 2007-03-28 12:07:35 -0700 (Wed, 28 Mar 2007) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/splom.R M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/panel.pairs.Rd A /trunk/lattice/man/prepanel.default.Rd M /trunk/lattice/man/prepanel.functions.Rd exported default prepanel functions, plus other small fixes ------------------------------------------------------------------------ r4213 | deepayan | 2007-03-27 18:21:32 -0700 (Tue, 27 Mar 2007) | 1 line Changed paths: M /trunk/lattice/man/panel.functions.Rd changed panel.abline to be more like abline ------------------------------------------------------------------------ r4212 | deepayan | 2007-03-27 18:05:33 -0700 (Tue, 27 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/demo/lattice.R M /trunk/lattice/tests/test.R bugfixes ------------------------------------------------------------------------ r4211 | deepayan | 2007-03-27 14:53:13 -0700 (Tue, 27 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/xyplot.Rd made the 'lattice.options' argument work better, in the sense that it is used when trellis objects are created, not just when they are printed ------------------------------------------------------------------------ r4210 | deepayan | 2007-03-27 12:34:29 -0700 (Tue, 27 Mar 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/trellis.object.Rd M /trunk/lattice/man/xyplot.Rd some improvements in print.trellis, including making x.args work as documented ------------------------------------------------------------------------ r4194 | deepayan | 2007-03-22 08:47:15 -0700 (Thu, 22 Mar 2007) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/cloud.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/simpleKey.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/xyplot.Rd doc updates related to making default panel functions user-settable; should pass check now ------------------------------------------------------------------------ r4191 | deepayan | 2007-03-21 16:11:10 -0700 (Wed, 21 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/parallel.R M /trunk/lattice/man/panel.parallel.Rd added option to control limits of a parallel coordinates plot ------------------------------------------------------------------------ r4184 | deepayan | 2007-03-15 17:31:21 -0700 (Thu, 15 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/update.trellis.R improved warning messages (mostly put single quotes around object names) ------------------------------------------------------------------------ r4183 | deepayan | 2007-03-15 17:24:03 -0700 (Thu, 15 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R bugfix: was drawing rectangle outside panels while in wrong viewport ------------------------------------------------------------------------ r4182 | deepayan | 2007-03-15 16:10:09 -0700 (Thu, 15 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R removed warning for non-numeric data (as that might be perfectly acceptable in more general situations) ------------------------------------------------------------------------ r4181 | deepayan | 2007-03-14 10:17:11 -0700 (Wed, 14 Mar 2007) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R made panel function defaults settable options ------------------------------------------------------------------------ r4176 | deepayan | 2007-03-09 05:18:41 -0800 (Fri, 09 Mar 2007) | 1 line Changed paths: M /trunk/lattice/man/banking.Rd M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/xyplot.Rd minor documentation updates ------------------------------------------------------------------------ r4037 | deepayan | 2006-12-18 12:03:25 -0800 (Mon, 18 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/man/print.trellis.Rd clipping related changes: the box around panels is now drawn with clipping off, and clipping for strip is now off by default. Also completed an incomplete sentence in print.trellis.Rd ------------------------------------------------------------------------ r4036 | deepayan | 2006-12-18 11:20:23 -0800 (Mon, 18 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R panel.barchart bugfix with empty groups ------------------------------------------------------------------------ r4035 | deepayan | 2006-12-18 11:19:43 -0800 (Mon, 18 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.par.get.Rd added a strict mode to trellis.par.set (needed to fix a bug with 'par.settings') ------------------------------------------------------------------------ r4034 | deepayan | 2006-12-18 11:18:24 -0800 (Mon, 18 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/man/xyplot.Rd added more graphical arguments, improved docs ------------------------------------------------------------------------ r4033 | deepayan | 2006-12-18 11:14:51 -0800 (Mon, 18 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.functions.Rd extended panel.grid to allow 'n' in pretty to be specified as -ve 'h' and 'v' ------------------------------------------------------------------------ r3998 | deepayan | 2006-12-01 12:54:00 -0800 (Fri, 01 Dec 2006) | 1 line Changed paths: M /trunk/lattice/R/common.R M /trunk/lattice/R/settings.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/xyplot.Rd slightly changed how levels are ordered for formulae of the form y1 + y2 ~ x1 + x2 + x3 ------------------------------------------------------------------------ r3978 | deepayan | 2006-11-28 11:44:25 -0800 (Tue, 28 Nov 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/inst/Changes bumped version ------------------------------------------------------------------------ r3977 | deepayan | 2006-11-28 11:41:06 -0800 (Tue, 28 Nov 2006) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/parallel.R M /trunk/lattice/R/splom.R M /trunk/lattice/man/splom.Rd added splom.matrix and parallel.matrix methods (same as corresponding data.frame methods) ------------------------------------------------------------------------ r3972 | deepayan | 2006-11-19 18:18:20 -0800 (Sun, 19 Nov 2006) | 1 line Changed paths: M /trunk/lattice/R/histogram.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/demo/00Index M /trunk/lattice/inst/Changes M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/panel.histogram.Rd some changes to histogram, plus misc fixes ------------------------------------------------------------------------ r3965 | deepayan | 2006-11-09 16:26:30 -0800 (Thu, 09 Nov 2006) | 1 line Changed paths: A /trunk/lattice/demo/panel.R demo of custom panel functions, first version has stacked densityplots ------------------------------------------------------------------------ r3963 | deepayan | 2006-11-07 21:27:18 -0800 (Tue, 07 Nov 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/legend.R M /trunk/lattice/R/settings.R added checks for valid values of x, y, and corner in legends ------------------------------------------------------------------------ r3962 | deepayan | 2006-11-07 21:26:26 -0800 (Tue, 07 Nov 2006) | 1 line Changed paths: M /trunk/lattice/R/parallel.R M /trunk/lattice/man/panel.parallel.Rd fixed misleading behaviour of 'common.scale' argument in parallel ------------------------------------------------------------------------ r3947 | deepayan | 2006-11-02 21:23:40 -0800 (Thu, 02 Nov 2006) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/miscellaneous.R fixed bad bug, where lrect border was (almost) always black ------------------------------------------------------------------------ r3937 | deepayan | 2006-10-31 12:53:14 -0800 (Tue, 31 Oct 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/SvnLog M /trunk/lattice/inst/Changes M /trunk/lattice/po/R-fr.po M /trunk/lattice/po/R-lattice.pot final changes in preparation for new upload ------------------------------------------------------------------------ r3936 | deepayan | 2006-10-31 12:48:30 -0800 (Tue, 31 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R moved code for saving object up in print.trellis, so that trellis.panelArgs() works during printing (untested) ------------------------------------------------------------------------ r3935 | deepayan | 2006-10-31 12:47:23 -0800 (Tue, 31 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd changed panel.identify to return selected subscripts rather than indices within panel ------------------------------------------------------------------------ r3927 | deepayan | 2006-10-24 09:02:35 -0700 (Tue, 24 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R fixed tck vectorization bug in scales ------------------------------------------------------------------------ r3925 | deepayan | 2006-10-23 16:55:19 -0700 (Mon, 23 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/man/xyplot.Rd added a 'reverse.rows' option to keys ------------------------------------------------------------------------ r3918 | deepayan | 2006-10-22 16:36:39 -0700 (Sun, 22 Oct 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/histogram.R M /trunk/lattice/SvnLog M /trunk/lattice/inst/Changes M /trunk/lattice/update.sh had forgotten a plot=FALSE in panel.histogram ------------------------------------------------------------------------ r3917 | deepayan | 2006-10-22 15:47:06 -0700 (Sun, 22 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/utilities.3d.Rd changed instances of seq to seq_along and seq_length wherever appropriate ------------------------------------------------------------------------ r3909 | deepayan | 2006-10-19 17:12:14 -0700 (Thu, 19 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R allow border=NA in lrect and polygon (a la PR#9307) ------------------------------------------------------------------------ r3906 | deepayan | 2006-10-18 17:14:57 -0700 (Wed, 18 Oct 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/common.R another adjustment for reversed axes, plus updated version ------------------------------------------------------------------------ r3905 | deepayan | 2006-10-18 16:47:36 -0700 (Wed, 18 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R fixes to potential problems with reversed axes ------------------------------------------------------------------------ r3904 | deepayan | 2006-10-18 16:28:33 -0700 (Wed, 18 Oct 2006) | 1 line Changed paths: M /trunk/lattice/man/panel.histogram.Rd updated documentation ------------------------------------------------------------------------ r3903 | deepayan | 2006-10-18 16:24:49 -0700 (Wed, 18 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/legend.R interpretation of adj made more flexible, correct default pch for type='b' etc in lines ------------------------------------------------------------------------ r3902 | deepayan | 2006-10-18 16:22:34 -0700 (Wed, 18 Oct 2006) | 1 line Changed paths: M /trunk/lattice/R/histogram.R explicitly limiting to 'allowed' arguments when calling hist(), to prevent warnings ------------------------------------------------------------------------ r3848 | deepayan | 2006-09-30 20:31:51 -0700 (Sat, 30 Sep 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/print.trellis.R bug fix: had forgotten to reinitialize status variables for 2nd page onwards ------------------------------------------------------------------------ r3810 | deepayan | 2006-09-21 13:36:52 -0700 (Thu, 21 Sep 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R D /trunk/lattice/R/modifyList.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/levelplot.Rd D /trunk/lattice/man/modifyList.Rd M /trunk/lattice/man/panel.number.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/rfs.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/xyplot.Rd removed modifyList (added to utils), removed remaining synopses, added accessors for current row and column ------------------------------------------------------------------------ r3804 | deepayan | 2006-09-19 12:58:09 -0700 (Tue, 19 Sep 2006) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/common.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/xyplot.Rd some reorganization in trellis.skeleton, documented new arguments, made llines, lpoints and ltext generic ------------------------------------------------------------------------ r3800 | deepayan | 2006-09-18 15:59:18 -0700 (Mon, 18 Sep 2006) | 1 line Changed paths: M /trunk/lattice/man/modifyList.Rd added an example ------------------------------------------------------------------------ r3799 | deepayan | 2006-09-18 14:44:00 -0700 (Mon, 18 Sep 2006) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/miscellaneous.R A /trunk/lattice/R/modifyList.R A /trunk/lattice/man/modifyList.Rd an exported version of lattice:::updateList, name/location subject to change ------------------------------------------------------------------------ r3798 | deepayan | 2006-09-18 14:40:20 -0700 (Mon, 18 Sep 2006) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd M /trunk/lattice/tests/levelplot.R A /trunk/lattice/tests/wireframe.R reorganized and commented some troublesome wireframe tests, and added a note to the help page. ------------------------------------------------------------------------ r3783 | deepayan | 2006-09-15 15:56:34 -0700 (Fri, 15 Sep 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NAMESPACE M /trunk/lattice/R/axis.R M /trunk/lattice/man/axis.default.Rd fixes nasty bug with relation != 'same', plus misc changes ------------------------------------------------------------------------ r3738 | deepayan | 2006-09-08 17:27:50 -0700 (Fri, 08 Sep 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/common.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/strip.R renamed cond.levels() to which.packet(), stopped supplying panel.number and packet.number to panel and strip, and added support to specify lattice.options and arguments to print.trellis in the Trellis object itself. ------------------------------------------------------------------------ r3737 | deepayan | 2006-09-08 16:15:21 -0700 (Fri, 08 Sep 2006) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/axis.R M /trunk/lattice/R/common.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R new code changes related to custom labelling and axis drawing. Code seems to be stable now (still needs work on computing space in layout for axis annotation in the non default case) ------------------------------------------------------------------------ r3500 | deepayan | 2006-08-25 12:18:27 -0700 (Fri, 25 Aug 2006) | 1 line Changed paths: M /trunk/lattice/NAMESPACE added packet.panel.default to export list ------------------------------------------------------------------------ r3499 | deepayan | 2006-08-25 12:17:12 -0700 (Fri, 25 Aug 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/layout.R M /trunk/lattice/R/print.trellis.R patches to support customized choice of packet-panel correspondence. Not fully tested. Should NOT end up in the 0.13 series ------------------------------------------------------------------------ r3436 | deepayan | 2006-08-19 17:24:34 -0700 (Sat, 19 Aug 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R ... will now be passed to pretty() calls ------------------------------------------------------------------------ r3315 | deepayan | 2006-07-12 13:07:48 -0700 (Wed, 12 Jul 2006) | 1 line Changed paths: M /trunk/lattice/man/panel.superpose.Rd add note about 'group.number' in call to panel.groups ------------------------------------------------------------------------ r3313 | deepayan | 2006-07-12 13:00:11 -0700 (Wed, 12 Jul 2006) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/R/miscellaneous.R make ltext etc recycle arguments in xy.coords ------------------------------------------------------------------------ r3296 | deepayan | 2006-07-07 10:36:46 -0700 (Fri, 07 Jul 2006) | 1 line Changed paths: M /trunk/lattice/R/strip.R M /trunk/lattice/man/strip.default.Rd added support for abbreviating strip labels ------------------------------------------------------------------------ r3249 | deepayan | 2006-06-24 11:08:34 -0700 (Sat, 24 Jun 2006) | 1 line Changed paths: M /trunk/lattice/tests/scales.R fix to guard against non-coercion of character to factor in R >= 2.4.0 ------------------------------------------------------------------------ r3207 | deepayan | 2006-06-05 13:49:07 -0700 (Mon, 05 Jun 2006) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/make.groups.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/strip.R M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/R/zzz.R updated copyright notice ------------------------------------------------------------------------ r3204 | deepayan | 2006-06-05 13:45:13 -0700 (Mon, 05 Jun 2006) | 1 line Changed paths: M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.par.get.Rd allow 'theme' in trellis.par.set to be a function (possibly quoted) ------------------------------------------------------------------------ r3203 | deepayan | 2006-06-05 13:39:27 -0700 (Mon, 05 Jun 2006) | 1 line Changed paths: M /trunk/lattice/R/scales.R renamed variable 'nplots' to the more accurate 'npackets' ------------------------------------------------------------------------ r3201 | deepayan | 2006-06-02 11:22:44 -0700 (Fri, 02 Jun 2006) | 1 line Changed paths: A /trunk/lattice/COPYING added copy of GPL ------------------------------------------------------------------------ r3199 | deepayan | 2006-06-02 11:04:12 -0700 (Fri, 02 Jun 2006) | 1 line Changed paths: M /trunk/lattice/R/densityplot.R bugfix (NA-s in groups) for densityplot ------------------------------------------------------------------------ r3075 | deepayan | 2006-04-17 13:12:06 -0700 (Mon, 17 Apr 2006) | 1 line Changed paths: M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.xyplot.Rd updates to document 'fill' where necessary ------------------------------------------------------------------------ r3073 | deepayan | 2006-04-17 07:22:15 -0700 (Mon, 17 Apr 2006) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/xyplot.R bugfixes, (1) fill in lpoints and (2) print.shingle ------------------------------------------------------------------------ r3049 | deepayan | 2006-04-06 09:28:20 -0700 (Thu, 06 Apr 2006) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/man/xyplot.Rd added a 'padding.text' component to keys ------------------------------------------------------------------------ r3047 | deepayan | 2006-04-05 13:07:49 -0700 (Wed, 05 Apr 2006) | 1 line Changed paths: M /trunk/lattice/inst/Changes added entry about default theme change ------------------------------------------------------------------------ r3045 | deepayan | 2006-04-04 09:07:08 -0700 (Tue, 04 Apr 2006) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/inst/Changes default settings changed to white background, grid pars should be specifiable in panel functions ------------------------------------------------------------------------ r3037 | deepayan | 2006-03-31 00:59:42 -0800 (Fri, 31 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.device.Rd changed default settings for most devices to previous PDF defaults ------------------------------------------------------------------------ r3035 | deepayan | 2006-03-30 21:36:46 -0800 (Thu, 30 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.stripplot.Rd added 'amount' argument in panel.stripplot to control jitter; horizontal now defaults to TRUE if 'x' is character in 'bwplot' and friends; miscellaneous other fixes ------------------------------------------------------------------------ r2352 | deepayan | 2006-03-10 08:42:36 -0800 (Fri, 10 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/strip.R M /trunk/lattice/man/xyplot.Rd fixed strip bug, modified example ------------------------------------------------------------------------ ------------------------------------------------------------------------ r2343 | deepayan | 2006-03-05 03:09:03 -0600 (Sun, 05 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/strip.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/strip.default.Rd several changes in strip.default, including support for displaying shingle levels, and possible use of panel.number and packet.number in strip. Bugfix: scales now counts rows from top if as.table = TRUE ------------------------------------------------------------------------ r2335 | deepayan | 2006-03-02 00:12:18 -0600 (Thu, 02 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/latticeParseFormula.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/xyplot.Rd changed defaults of data=parent.frame() to data=NULL ------------------------------------------------------------------------ r2333 | deepayan | 2006-03-01 14:15:54 -0600 (Wed, 01 Mar 2006) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R D /trunk/lattice/R/plot.shingle.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/strip.R M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.histogram.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/update.sh improved some uses of grid.rect, changed [bar|superpose].fill settings to [plot.superpose].polygon ------------------------------------------------------------------------ r2330 | deepayan | 2006-02-28 21:47:19 -0600 (Tue, 28 Feb 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/layout.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/man/llines.Rd M /trunk/lattice/po/R-fr.po removed use of deprecated grid functions, French translations updated ------------------------------------------------------------------------ r2328 | deepayan | 2006-02-26 15:05:59 -0600 (Sun, 26 Feb 2006) | 1 line Changed paths: M /trunk/lattice/man/panel.bwplot.Rd clarification about unavailaibility of notches ------------------------------------------------------------------------ r2305 | deepayan | 2006-02-21 09:45:27 -0600 (Tue, 21 Feb 2006) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd updated docs to explain [xyz]lab and scales ------------------------------------------------------------------------ r2302 | deepayan | 2006-02-20 10:06:52 -0600 (Mon, 20 Feb 2006) | 1 line Changed paths: M /trunk/lattice/R/panels.R bug fix in panel.rug (failed with zero-length or NA vectors) ------------------------------------------------------------------------ r2244 | deepayan | 2006-01-22 01:45:40 -0600 (Sun, 22 Jan 2006) | 1 line Changed paths: M /trunk/lattice/R/*.R changed wrong use of 'library' to 'package' in license statement, updated copyright ------------------------------------------------------------------------ r2243 | deepayan | 2006-01-22 01:38:06 -0600 (Sun, 22 Jan 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NAMESPACE M /trunk/lattice/R/cloud.R M /trunk/lattice/R/zzz.R registration related changes suggested by Prof Ripley, makes lattice truly incompatible with R-2.2.x ------------------------------------------------------------------------ r2242 | deepayan | 2006-01-22 01:34:06 -0600 (Sun, 22 Jan 2006) | 1 line Changed paths: M /trunk/lattice/NAMESPACE reorganized ------------------------------------------------------------------------ r2241 | deepayan | 2006-01-22 00:18:45 -0600 (Sun, 22 Jan 2006) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/llines.Rd added lpolygon and panel.polygon (like graphics::polygon), added support for all values of 'adj' in ltext ------------------------------------------------------------------------ r2195 | deepayan | 2006-01-14 15:54:35 -0600 (Sat, 14 Jan 2006) | 1 line Changed paths: M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/xyplot.Rd added note about grid.prompt and the fact that calls of the form 'xyplot(formula=...)' no longer work ------------------------------------------------------------------------ r2138 | deepayan | 2006-01-05 15:38:03 -0600 (Thu, 05 Jan 2006) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/SvnLog M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/po/R-fr.po M /trunk/lattice/po/R-lattice.pot added a 'type' argument to some panel functions (to avoid multiple matching). Misc doc updates. ------------------------------------------------------------------------ r2125 | deepayan | 2006-01-03 16:21:32 -0600 (Tue, 03 Jan 2006) | 1 line Changed paths: A /trunk/lattice/src/init.c M /trunk/lattice/src/threeDplot.c A /trunk/lattice/src/threeDplot.h registration of C function ------------------------------------------------------------------------ r2124 | deepayan | 2006-01-03 15:28:21 -0600 (Tue, 03 Jan 2006) | 1 line Changed paths: M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.functions.Rd added 'border' argument for panel.fill ------------------------------------------------------------------------ r2107 | deepayan | 2005-12-31 12:43:02 -0600 (Sat, 31 Dec 2005) | 1 line Changed paths: M /trunk/lattice/R/strip.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/strip.default.Rd added support for strip.left in update.trellis, strip.default can now use factor.levels and shingle.intervals concurrently (which only makes sense with style=1) ------------------------------------------------------------------------ r2090 | deepayan | 2005-12-26 12:36:39 -0600 (Mon, 26 Dec 2005) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/llines.Rd added option to change origin with type='h' ------------------------------------------------------------------------ r2089 | deepayan | 2005-12-24 16:01:05 -0600 (Sat, 24 Dec 2005) | 1 line Changed paths: M /trunk/lattice/inst/Changes M /trunk/lattice/man/Lattice.Rd updated Changes file ------------------------------------------------------------------------ r2085 | deepayan | 2005-12-23 02:25:36 -0600 (Fri, 23 Dec 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/panels.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/xyplot.Rd M /trunk/lattice/po/R-lattice.pot fixed bug in panel.superpose when 'groups' contained NA's, rearranged things so that panel.superpose.2 is now a simple wrapper for panel.superpose (since they share most of the code) ------------------------------------------------------------------------ r2083 | deepayan | 2005-12-22 13:21:40 -0600 (Thu, 22 Dec 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/common.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/po/R-lattice.pot made some messages translation-friendly ------------------------------------------------------------------------ r2082 | deepayan | 2005-12-20 10:25:22 -0600 (Tue, 20 Dec 2005) | 1 line Changed paths: A /trunk/lattice/po/R-fr.po added french translations, thanks to Philippe Grosjean ------------------------------------------------------------------------ r2081 | deepayan | 2005-12-19 11:29:42 -0600 (Mon, 19 Dec 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R replaced eval() calls by eval.parent where appropriate ------------------------------------------------------------------------ r2070 | deepayan | 2005-12-12 11:40:47 -0600 (Mon, 12 Dec 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R removed some now unnecessary calls to panel.superpose ------------------------------------------------------------------------ r2067 | deepayan | 2005-12-11 21:02:35 -0600 (Sun, 11 Dec 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/xyplot.Rd panel.xyplot and panel.densityplot can now handle 'groups' themselves (by calling panel.superpose), which means that there's no need to change the default panel functions in the corresponding high level functions when 'groups' is non-null. This doesn't really do anything new, it just avoids a long explanation. Also improved summary.trellis. ------------------------------------------------------------------------ r2065 | deepayan | 2005-12-11 01:03:00 -0600 (Sun, 11 Dec 2005) | 1 line Changed paths: M /trunk/lattice/po/R-lattice.pot updated translations ------------------------------------------------------------------------ r2064 | deepayan | 2005-12-11 00:43:07 -0600 (Sun, 11 Dec 2005) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/make.groups.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/demo/00Index A /trunk/lattice/demo/intervals.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/make.groups.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/simpleKey.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/tests/temp.R extensive but mostly cosmetic changes and code cleanup, passes check ------------------------------------------------------------------------ r2062 | deepayan | 2005-12-09 23:21:55 -0600 (Fri, 09 Dec 2005) | 1 line Changed paths: A /trunk/lattice/.Rbuildignore M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/rfs.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/zzz.R A /trunk/lattice/po A /trunk/lattice/po/R-lattice.pot A /trunk/lattice/update.sh made messages translatable, updated version ------------------------------------------------------------------------ r2057 | deepayan | 2005-12-09 10:32:23 -0600 (Fri, 09 Dec 2005) | 1 line Changed paths: M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/trellis.object.Rd added a couple of components to trellis object, namely 'formula' and 'packet.sizes' ------------------------------------------------------------------------ r2015 | deepayan | 2005-11-16 12:40:35 -0600 (Wed, 16 Nov 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/xyplot.Rd added data as an argument to high level generics ------------------------------------------------------------------------ r2014 | deepayan | 2005-11-16 12:39:19 -0600 (Wed, 16 Nov 2005) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/strip.R Added lineheight parameter where appropriate. Added a 'global.gpar' setting for grid parameters to be set initially. Plus a bugfix for lplot.xy and formatting changes ------------------------------------------------------------------------ r1940 | hornik | 2005-10-27 04:59:39 -0500 (Thu, 27 Oct 2005) | 2 lines Changed paths: M /trunk/lattice/R/axis.R Ensure class "Date" after sorting. ------------------------------------------------------------------------ r1935 | deepayan | 2005-10-25 15:59:09 -0500 (Tue, 25 Oct 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/settings.R M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/panel.bwplot.Rd made boxplot.stats customizable in panel.bwplot, added settings for pch fill ------------------------------------------------------------------------ r1931 | deepayan | 2005-10-24 16:24:19 -0500 (Mon, 24 Oct 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/settings.R minor changes in setting, including reference line color ------------------------------------------------------------------------ r1919 | deepayan | 2005-10-10 16:42:53 -0500 (Mon, 10 Oct 2005) | 1 line Changed paths: M /trunk/lattice/tests/dates.R test code fix ------------------------------------------------------------------------ r1918 | deepayan | 2005-10-10 16:09:20 -0500 (Mon, 10 Oct 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/qq.R M /trunk/lattice/inst/Changes workaround for previously unanticipated behaviour of ppoints(1, a = 1) ------------------------------------------------------------------------ r1904 | deepayan | 2005-10-07 13:35:07 -0500 (Fri, 07 Oct 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/axis.R A /trunk/lattice/tests/dates.R M /trunk/lattice/tests/scales.R added axis labels method for Date objects ------------------------------------------------------------------------ r1881 | deepayan | 2005-10-04 14:59:47 -0500 (Tue, 04 Oct 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/zzz.R fixed wrong usage in .onLoad ------------------------------------------------------------------------ r1863 | deepayan | 2005-09-28 12:06:49 -0500 (Wed, 28 Sep 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/axis.R M /trunk/lattice/R/common.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/plot.shingle.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/shingle.R M /trunk/lattice/R/strip.R M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/strip.default.Rd M /trunk/lattice/man/xyplot.Rd added support for strips on the left, and made plot.shingle better ------------------------------------------------------------------------ r1813 | deepayan | 2005-09-09 15:16:32 -0500 (Fri, 09 Sep 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/inst/Changes bumped version, added note about change in panel/packet.counter/number ------------------------------------------------------------------------ r1812 | deepayan | 2005-09-09 13:56:53 -0500 (Fri, 09 Sep 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R had buggy detection of whether a 'formula' argument was specified ------------------------------------------------------------------------ r1805 | deepayan | 2005-09-08 11:06:47 -0500 (Thu, 08 Sep 2005) | 1 line Changed paths: M /trunk/lattice/R/axis.R using chron::chron instead of chron in 'times' method ------------------------------------------------------------------------ r1800 | deepayan | 2005-09-07 16:23:19 -0500 (Wed, 07 Sep 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R more rectangle fixes ------------------------------------------------------------------------ r1797 | deepayan | 2005-09-07 14:40:43 -0500 (Wed, 07 Sep 2005) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/demo/lattice.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/src/threeDplot.c added appropriate fill argument to grid.rect calls where missing ------------------------------------------------------------------------ r1794 | deepayan | 2005-09-06 10:23:40 -0500 (Tue, 06 Sep 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/demo/lattice.R M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/lattice-internal.Rd.foo M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/panel.histogram.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/prepanel.functions.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/rfs.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/xyplot.Rd changed name of first argument in high level functions from formula to x, did away with synopses as much as possible (xyplot, cloud and levelplot remaining) ------------------------------------------------------------------------ r1758 | deepayan | 2005-08-26 11:32:23 -0500 (Fri, 26 Aug 2005) | 1 line Changed paths: M /trunk/lattice/man/panel.xyplot.Rd added info on type='a' ------------------------------------------------------------------------ r1752 | deepayan | 2005-08-24 15:19:04 -0500 (Wed, 24 Aug 2005) | 1 line Changed paths: M /trunk/lattice/man/update.trellis.Rd added missing argument ------------------------------------------------------------------------ r1751 | deepayan | 2005-08-24 15:14:29 -0500 (Wed, 24 Aug 2005) | 1 line Changed paths: M /trunk/lattice/man/shingles.Rd fixed typo ------------------------------------------------------------------------ r1750 | deepayan | 2005-08-22 10:36:55 -0500 (Mon, 22 Aug 2005) | 1 line Changed paths: M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/update.trellis.Rd removed quotes from [ in Rd files ------------------------------------------------------------------------ r1749 | deepayan | 2005-08-19 13:59:46 -0500 (Fri, 19 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/panels.R M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/update.trellis.Rd minor rearrangements ------------------------------------------------------------------------ r1742 | deepayan | 2005-08-19 10:55:18 -0500 (Fri, 19 Aug 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R M /trunk/lattice/R/splom.R diag.panel.splom now gets data, also added trellis.currentLayout ------------------------------------------------------------------------ r1741 | deepayan | 2005-08-19 10:54:11 -0500 (Fri, 19 Aug 2005) | 1 line Changed paths: M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/Rows.Rd M /trunk/lattice/man/banking.Rd M /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/barley.Rd M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/draw.colorkey.Rd M /trunk/lattice/man/draw.key.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/latticeParseFormula.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/lset.Rd M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.densityplot.Rd M /trunk/lattice/man/panel.dotplot.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/panel.histogram.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/panel.stripplot.Rd M /trunk/lattice/man/panel.violin.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/rfs.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/trellis.object.Rd M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/utilities.3d.Rd M /trunk/lattice/man/xyplot.Rd doc updates, mainly to fix spurious uses of explicit quotes ------------------------------------------------------------------------ r1693 | deepayan | 2005-08-05 20:02:44 -0500 (Fri, 05 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/update.trellis.R added t, [, dim and dimnames methods for trellis objects (no docs yet) ------------------------------------------------------------------------ r1692 | deepayan | 2005-08-03 07:34:00 -0500 (Wed, 03 Aug 2005) | 1 line Changed paths: M /trunk/lattice/R/densityplot.R fixed bug in densityplot prepanel changes ------------------------------------------------------------------------ r1691 | deepayan | 2005-08-02 17:02:04 -0500 (Tue, 02 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/man/qqmath.Rd fixed qqmath.numeric bug, changed banking calculations in densityplot (using only middle 70% of data) ------------------------------------------------------------------------ r1690 | deepayan | 2005-08-02 12:25:02 -0500 (Tue, 02 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/xyplot.Rd doc updates finished, passes check ------------------------------------------------------------------------ r1689 | deepayan | 2005-08-01 16:28:13 -0500 (Mon, 01 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/summary.trellis.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/tests/levelplot.R more doc updates (almost done, but not quite) ------------------------------------------------------------------------ r1688 | deepayan | 2005-08-01 12:24:30 -0500 (Mon, 01 Aug 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/histogram.R A /trunk/lattice/man/barchart.table.Rd M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/xyplot.Rd doc updates (still incomplete) related to move to generic functions ------------------------------------------------------------------------ r1687 | deepayan | 2005-07-31 14:30:43 -0500 (Sun, 31 Jul 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/make.groups.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/tmd.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/inst/Changes M /trunk/lattice/tests/test.R finished code changes to make high level functions generic, documentation not updated yet ------------------------------------------------------------------------ r1684 | deepayan | 2005-07-29 19:52:57 -0500 (Fri, 29 Jul 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/tests/dotplotscoping.R made several high level functions generic, more to follow ------------------------------------------------------------------------ r1674 | deepayan | 2005-07-25 15:01:55 -0500 (Mon, 25 Jul 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/inst/Changes fix and minor behaviour change in draw.key. Fix for silly mistake in axis.R (POSIXct) pointed out by Dirk. Rest mostly experimental and incomplete code to make high level functions generic ------------------------------------------------------------------------ r1660 | deepayan | 2005-07-18 12:32:10 -0500 (Mon, 18 Jul 2005) | 1 line Changed paths: M /trunk/lattice/INDEX A /trunk/lattice/man/make.groups.Rd added make.groups documentation ------------------------------------------------------------------------ r1659 | deepayan | 2005-07-16 15:15:56 -0500 (Sat, 16 Jul 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/tmd.R M /trunk/lattice/man/panel.qqmath.Rd M /trunk/lattice/man/panel.qqmathline.Rd D /trunk/lattice/man/panel.tmd.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/tmd.Rd updated docs, made substantial changes to tmd which had stopped working with qqmath ------------------------------------------------------------------------ r1657 | deepayan | 2005-07-15 18:20:23 -0500 (Fri, 15 Jul 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE A /trunk/lattice/R/make.groups.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.histogram.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/xyplot.Rd added 'make.groups' (no doc yet), minor updates to several doc pages ------------------------------------------------------------------------ r1652 | deepayan | 2005-07-13 11:47:44 -0500 (Wed, 13 Jul 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/miscellaneous.R added lrect and panel.rect (no docs yet) and completely rewrote panel.bwplot ------------------------------------------------------------------------ r1636 | deepayan | 2005-07-05 09:55:26 -0500 (Tue, 05 Jul 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/xyplot.R more modifications were needed for qqmath, since log scales were causing problems when densityplot was used as the workhorse. Rest is cleaning up some stuff. ------------------------------------------------------------------------ r1616 | deepayan | 2005-06-28 12:24:56 -0500 (Tue, 28 Jun 2005) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/singer.Rd M /trunk/lattice/man/xyplot.Rd considerable restructuring of qqmath, changed many range() calls to have finite=TRUE ------------------------------------------------------------------------ r1601 | deepayan | 2005-06-19 22:35:16 -0500 (Sun, 19 Jun 2005) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/panels.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/man/panel.functions.Rd A /trunk/lattice/man/panel.qqmath.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/qqmath.Rd doc updates to keep up with changes (incomplete) ------------------------------------------------------------------------ r1600 | deepayan | 2005-06-19 16:29:16 -0500 (Sun, 19 Jun 2005) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/panels.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/panel.densityplot.Rd misc updates, including putting back PACKAGE= in .Call in cloud.R ------------------------------------------------------------------------ r1599 | deepayan | 2005-06-19 16:28:23 -0500 (Sun, 19 Jun 2005) | 1 line Changed paths: M /trunk/lattice/R/qqmath.R reimplemented qqmath to allow grouping, panel functions etc become unlike S ------------------------------------------------------------------------ r1597 | deepayan | 2005-06-16 22:58:43 -0500 (Thu, 16 Jun 2005) | 1 line Changed paths: M /trunk/lattice/R/histogram.R M /trunk/lattice/R/plot.shingle.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/Lattice.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/shingles.Rd fixed histogram bug, added 'draw.in' argument to print.trellis, etc ------------------------------------------------------------------------ r1589 | deepayan | 2005-06-09 17:01:51 -0500 (Thu, 09 Jun 2005) | 1 line Changed paths: M /trunk/lattice/R/xyplot.R added type = 'a' to panel.xyplot ------------------------------------------------------------------------ r1585 | deepayan | 2005-06-09 09:01:41 -0500 (Thu, 09 Jun 2005) | 1 line Changed paths: M /trunk/lattice/R/densityplot.R fixed bug in densityplot prepanel when one obs in panel ------------------------------------------------------------------------ r1554 | deepayan | 2005-05-22 21:53:28 -0500 (Sun, 22 May 2005) | 1 line Changed paths: M /trunk/lattice/man/panel.axis.Rd added alias entry for current.panel.limits ------------------------------------------------------------------------ r1553 | deepayan | 2005-05-22 21:47:03 -0500 (Sun, 22 May 2005) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/print.trellis.Rd added a plot method for trellis objects, almost identical to the print method ------------------------------------------------------------------------ r1552 | deepayan | 2005-05-22 21:42:39 -0500 (Sun, 22 May 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NAMESPACE M /trunk/lattice/R/axis.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/tests/levelplot.R added function to retrieve current viewport's limits ------------------------------------------------------------------------ r1475 | deepayan | 2005-05-09 22:24:15 -0500 (Mon, 09 May 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/common.R M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/xyplot.Rd updated description, clarified docs ------------------------------------------------------------------------ r1446 | deepayan | 2005-04-28 09:05:12 -0500 (Thu, 28 Apr 2005) | 3 lines Changed paths: M /trunk/lattice/man/trellis.object.Rd changed \value to \details, to fix odd 'bracketnormal' thingy. Not sure what's going on, should read more about how to document classes. ------------------------------------------------------------------------ r1358 | deepayan | 2005-04-10 23:58:37 -0500 (Sun, 10 Apr 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/qqmath.R M /trunk/lattice/SvnLog M /trunk/lattice/inst/Changes M /trunk/lattice/man/panel.violin.Rd updated log, plus misc changes to pass check ------------------------------------------------------------------------ r1357 | deepayan | 2005-04-10 21:47:21 -0500 (Sun, 10 Apr 2005) | 1 line Changed paths: (almost everything) updated email address ------------------------------------------------------------------------ r1356 | deepayan | 2005-04-10 21:34:52 -0500 (Sun, 10 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/scales.R M /trunk/lattice/R/settings.R made banking function for aspect=xy user-settable ------------------------------------------------------------------------ r1354 | deepayan | 2005-04-10 21:33:02 -0500 (Sun, 10 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/qqmath.R M /trunk/lattice/man/panel.qqmathline.Rd M /trunk/lattice/man/prepanel.functions.Rd added argument controlling which quantiles define line in panel.qqmathline ------------------------------------------------------------------------ r1353 | deepayan | 2005-04-10 21:24:26 -0500 (Sun, 10 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R A /trunk/lattice/man/panel.violin.Rd added panel function for 'violin plots' ------------------------------------------------------------------------ r1352 | deepayan | 2005-04-08 23:07:12 -0500 (Fri, 08 Apr 2005) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX updated version ------------------------------------------------------------------------ r1351 | deepayan | 2005-04-08 23:06:28 -0500 (Fri, 08 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/common.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/xyplot.Rd some standard arguments now take their settings from lattice.options ------------------------------------------------------------------------ r1350 | deepayan | 2005-04-08 23:05:43 -0500 (Fri, 08 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/cloud.R improved behavior of labels in cloud ------------------------------------------------------------------------ r1349 | deepayan | 2005-04-08 23:03:28 -0500 (Fri, 08 Apr 2005) | 1 line Changed paths: M /trunk/lattice/R/parallel.R M /trunk/lattice/man/panel.parallel.Rd update and a couple of new features in parallel ------------------------------------------------------------------------ r1293 | deepayan | 2005-03-20 16:42:25 -0600 (Sun, 20 Mar 2005) | 1 line Changed paths: M /trunk/lattice/R/settings.R warning message reported using warning rather than cat ------------------------------------------------------------------------ r1292 | deepayan | 2005-03-20 16:41:49 -0600 (Sun, 20 Mar 2005) | 1 line Changed paths: M /trunk/lattice/R/xyplot.R type='g' now uses h=-1, v =-1 ------------------------------------------------------------------------ r1291 | deepayan | 2005-03-20 16:41:09 -0600 (Sun, 20 Mar 2005) | 1 line Changed paths: M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/panel.functions.Rd removed remnants of old documentation ------------------------------------------------------------------------ r1134 | deepayan | 2005-02-21 22:51:50 -0600 (Mon, 21 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/update.trellis.Rd trellis.last.object can now have arguments that can be used to update retrieved object ------------------------------------------------------------------------ r1133 | deepayan | 2005-02-21 22:50:49 -0600 (Mon, 21 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/llines.Rd added 'unit' argument to larrows, and used that for arrows in cloud ------------------------------------------------------------------------ r1132 | deepayan | 2005-02-21 22:49:01 -0600 (Mon, 21 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/man/panel.bwplot.Rd added do.out=F as a possible option in panel.bwplot ------------------------------------------------------------------------ r1113 | deepayan | 2005-02-17 11:46:49 -0600 (Thu, 17 Feb 2005) | 2 lines Changed paths: M /trunk/lattice/man/panel.parallel.Rd updated docs for panel.parallel ------------------------------------------------------------------------ r1112 | deepayan | 2005-02-17 11:31:42 -0600 (Thu, 17 Feb 2005) | 2 lines Changed paths: M /trunk/lattice/R/parallel.R added 'groups' argument to panel.parallel ------------------------------------------------------------------------ r1102 | deepayan | 2005-02-16 13:26:07 -0600 (Wed, 16 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/axis.R reverted to old tick label convention ------------------------------------------------------------------------ r1101 | deepayan | 2005-02-16 13:25:05 -0600 (Wed, 16 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R re-implemented larrows, but needs more work ------------------------------------------------------------------------ r1100 | deepayan | 2005-02-16 13:24:32 -0600 (Wed, 16 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/settings.R changed b&w superpose.fill colors ------------------------------------------------------------------------ r1099 | deepayan | 2005-02-16 13:23:37 -0600 (Wed, 16 Feb 2005) | 1 line Changed paths: M /trunk/lattice/R/xyplot.R changed NA-handling ------------------------------------------------------------------------ r1083 | deepayan | 2005-02-12 10:01:05 -0600 (Sat, 12 Feb 2005) | 4 lines Changed paths: M /trunk/lattice/R/interaction.R changed default labels to panel.args$subscript if present, when x and y chosen by default from the focus-ed panel. ------------------------------------------------------------------------ r818 | deepayan | 2004-12-06 13:21:19 -0600 (Mon, 06 Dec 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/interaction.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/simpleKey.Rd misc updates, including panel.identify now returns indices ------------------------------------------------------------------------ r786 | deepayan | 2004-11-29 10:18:25 -0600 (Mon, 29 Nov 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/R/xyplot.R changed behaviour of auto.key - text allowed, defaults are function-specific ------------------------------------------------------------------------ r785 | deepayan | 2004-11-29 10:17:39 -0600 (Mon, 29 Nov 2004) | 1 line Changed paths: M /trunk/lattice/R/layout.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/strip.R updates to account for changes in grid for 2.1.0 ------------------------------------------------------------------------ r784 | deepayan | 2004-11-29 10:14:51 -0600 (Mon, 29 Nov 2004) | 1 line Changed paths: M /trunk/lattice/R/common.R fixed bad use of deparse ------------------------------------------------------------------------ r761 | deepayan | 2004-11-21 19:05:12 -0600 (Sun, 21 Nov 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/latticeParseFormula.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.levelplot.Rd M /trunk/lattice/man/panel.superpose.Rd M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/prepanel.functions.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/shingles.Rd M /trunk/lattice/man/strip.default.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/xyplot.Rd miscellaneous bugfixes ------------------------------------------------------------------------ r731 | deepayan | 2004-11-11 15:36:41 -0600 (Thu, 11 Nov 2004) | 1 line Changed paths: M /trunk/lattice/man/trellis.device.Rd updates theme doc entry ------------------------------------------------------------------------ r730 | deepayan | 2004-11-10 11:10:26 -0600 (Wed, 10 Nov 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/inst/Changes final changes for 0.10-14 release ------------------------------------------------------------------------ r729 | deepayan | 2004-11-10 10:53:08 -0600 (Wed, 10 Nov 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R for named vectors, order is now according to vector, not alphabetically by names ------------------------------------------------------------------------ r728 | deepayan | 2004-11-10 10:41:56 -0600 (Wed, 10 Nov 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R fixed formattedTicksAndLabels.default to always return numeric limits, added a method (.times) for chron objects ------------------------------------------------------------------------ r697 | deepayan | 2004-11-03 19:46:46 -0600 (Wed, 03 Nov 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE D /trunk/lattice/R/gplot.R D /trunk/lattice/man/gplot.Rd removed gplot-related code into separate package ------------------------------------------------------------------------ r684 | deepayan | 2004-11-01 09:33:03 -0600 (Mon, 01 Nov 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/gplot.R M /trunk/lattice/R/xyplot.R gplot related changes ------------------------------------------------------------------------ r683 | deepayan | 2004-10-30 03:23:22 -0500 (Sat, 30 Oct 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/NAMESPACE M /trunk/lattice/R/gplot.R M /trunk/lattice/inst/Changes A /trunk/lattice/man/gplot.Rd updated gplot code, moved groupedData() to lme4 ------------------------------------------------------------------------ r682 | deepayan | 2004-10-29 17:38:58 -0500 (Fri, 29 Oct 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/inst/Changes misc updates ------------------------------------------------------------------------ r681 | deepayan | 2004-10-29 14:18:56 -0500 (Fri, 29 Oct 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/INDEX M /trunk/lattice/R/histogram.R M /trunk/lattice/tests/temp.R fixed missing pars in panel.histogram, updated DESCRIPTION ------------------------------------------------------------------------ r653 | deepayan | 2004-10-26 00:15:56 -0500 (Tue, 26 Oct 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/xyplot.R misc updates, including important bugfix in trellis.par.set ------------------------------------------------------------------------ r652 | deepayan | 2004-10-26 00:10:40 -0500 (Tue, 26 Oct 2004) | 1 line Changed paths: M /trunk/lattice/man/barley.Rd A /trunk/lattice/man/environmental.Rd A /trunk/lattice/man/ethanol.Rd A /trunk/lattice/man/melanoma.Rd A /trunk/lattice/man/singer.Rd D /trunk/lattice/man/trellis.datasets.Rd separate documentation for datasets, contributed by Kevin Wright ------------------------------------------------------------------------ r601 | deepayan | 2004-10-18 22:35:04 -0500 (Mon, 18 Oct 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R graphical pars were not being replicated in grouped barchart, PR#7293 ------------------------------------------------------------------------ r600 | deepayan | 2004-10-18 22:33:52 -0500 (Mon, 18 Oct 2004) | 1 line Changed paths: A /trunk/lattice/man/barley.Rd separate documentation for barley data, contributed by Kevin Wright ------------------------------------------------------------------------ r599 | deepayan | 2004-10-18 22:33:30 -0500 (Mon, 18 Oct 2004) | 1 line Changed paths: M /trunk/lattice/man/trellis.datasets.Rd separate documentation for barley data, contributed by Kevin Wright ------------------------------------------------------------------------ r598 | deepayan | 2004-10-18 22:32:39 -0500 (Mon, 18 Oct 2004) | 1 line Changed paths: M /trunk/lattice/man/panel.superpose.Rd updated and improved panel.superpose.2 ------------------------------------------------------------------------ r597 | deepayan | 2004-10-18 13:14:24 -0500 (Mon, 18 Oct 2004) | 1 line Changed paths: M /trunk/lattice/R/common.R A /trunk/lattice/R/gplot.R M /trunk/lattice/R/panels.R reference implementation of gplot (NOTE: MOVED to new package subsequently) ------------------------------------------------------------------------ r564 | deepayan | 2004-10-05 15:38:14 -0500 (Tue, 05 Oct 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R revamped show.settings, added a panel for superpose.fill ------------------------------------------------------------------------ r541 | deepayan | 2004-09-14 20:20:44 -0500 (Tue, 14 Sep 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/NAMESPACE M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/draw.colorkey.Rd M /trunk/lattice/man/draw.key.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/interaction.Rd D /trunk/lattice/man/reorder.factor.Rd removed reorderFactor, updated docs ------------------------------------------------------------------------ r538 | deepayan | 2004-09-12 20:41:57 -0500 (Sun, 12 Sep 2004) | 1 line Changed paths: M /trunk/lattice/NAMESPACE M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/print.trellis.Rd viewport (and grob) names now try use a plot-specific prefix to distinguish between similar viewports when multiple plots are drawn on a single page. Also some doc updates ------------------------------------------------------------------------ r535 | deepayan | 2004-09-10 00:05:05 -0500 (Fri, 10 Sep 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/inst/Changes M /trunk/lattice/man/panel.xyplot.Rd M /trunk/lattice/man/xyplot.Rd M /trunk/lattice/tests/temp.R added type='g', updated docs, especially for the prepanel entry in ?xyplot ------------------------------------------------------------------------ r534 | deepayan | 2004-09-10 00:03:19 -0500 (Fri, 10 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/common.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/xyplot.R some cleanups indicated by codetools, plus interaction updates (incomplete) ------------------------------------------------------------------------ r533 | deepayan | 2004-09-06 12:24:23 -0500 (Mon, 06 Sep 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/layout.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/settings.R M /trunk/lattice/tests/temp.R axis.panel settings can now be used as multipliers for axis widths and heights for relation=free/sliced ------------------------------------------------------------------------ r532 | deepayan | 2004-09-04 14:39:00 -0500 (Sat, 04 Sep 2004) | 1 line Changed paths: M /trunk/lattice/NAMESPACE exported trellis.vpname ------------------------------------------------------------------------ r531 | deepayan | 2004-09-04 14:37:47 -0500 (Sat, 04 Sep 2004) | 1 line Changed paths: M /trunk/lattice/NAMESPACE changed names of latticeVP.focus etc ------------------------------------------------------------------------ r530 | deepayan | 2004-09-04 14:28:34 -0500 (Sat, 04 Sep 2004) | 1 line Changed paths: M /trunk/lattice/INDEX M /trunk/lattice/R/axis.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/common.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/update.trellis.R M /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/xyplot.Rd amount of extension of axis limits now taken from an option setting, plus misc fixes ------------------------------------------------------------------------ r529 | deepayan | 2004-09-04 11:05:58 -0500 (Sat, 04 Sep 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/R/axis.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/zzz.R M /trunk/lattice/demo/lattice.R M /trunk/lattice/inst/Changes M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/interaction.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/lset.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/xyplot.Rd M /trunk/lattice/tests/test.R reorganized interaction code (renamed lattice.VPfocus to trellis.focus), plus misc associated changes ------------------------------------------------------------------------ r525 | deepayan | 2004-09-03 21:39:31 -0500 (Fri, 03 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R M /trunk/lattice/man/trellis.device.Rd theme in trellis.device now gets default from lattice.options, which initially defaults to getOption(lattice.theme) for back-compatibility ------------------------------------------------------------------------ r524 | deepayan | 2004-09-03 21:30:07 -0500 (Fri, 03 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/R/zzz.R drop.unused.levels now defaults to lattice.options setting ------------------------------------------------------------------------ r523 | deepayan | 2004-09-03 21:08:55 -0500 (Fri, 03 Sep 2004) | 2 lines Changed paths: M /trunk/lattice/demo/lattice.R removed par(ask = TRUE) in favour of grid.prompt ------------------------------------------------------------------------ r521 | deepayan | 2004-09-02 18:32:29 -0500 (Thu, 02 Sep 2004) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/rfs.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/tmd.Rd M /trunk/lattice/man/update.trellis.Rd M /trunk/lattice/man/xyplot.Rd deleted all data() calls ------------------------------------------------------------------------ r520 | deepayan | 2004-09-02 18:28:21 -0500 (Thu, 02 Sep 2004) | 1 line Changed paths: M /trunk/lattice/INDEX A /trunk/lattice/SvnLog (from /trunk/lattice/lattice.svnlog:509) M /trunk/lattice/inst/Changes D /trunk/lattice/lattice.svnlog updated Changes and svn log, renamed svn log file ------------------------------------------------------------------------ r519 | deepayan | 2004-09-02 18:27:30 -0500 (Thu, 02 Sep 2004) | 1 line Changed paths: M /trunk/lattice/demo/lattice.R added example of non-trivial strip in demo(lattice) ------------------------------------------------------------------------ r518 | deepayan | 2004-09-02 18:26:45 -0500 (Thu, 02 Sep 2004) | 1 line Changed paths: M /trunk/lattice/tests/scales.R more relation=free/sliced tests for factors ------------------------------------------------------------------------ r510 | deepayan | 2004-09-02 17:58:02 -0500 (Thu, 02 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/interaction.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/settings.R bugfixes related to relation=free/sliced for factors, and interaction ------------------------------------------------------------------------ r508 | deepayan | 2004-09-01 17:10:51 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/man/panel.bwplot.Rd M /trunk/lattice/man/panel.dotplot.Rd M /trunk/lattice/man/print.trellis.Rd documentation updates ------------------------------------------------------------------------ r507 | deepayan | 2004-09-01 17:10:31 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/tests/scales.R added test for relation=free/sliced for factors ------------------------------------------------------------------------ r506 | deepayan | 2004-09-01 17:09:44 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/interaction.R M /trunk/lattice/man/interaction.Rd fixed typos, and hopefully fixed possibility of inconsistent status ------------------------------------------------------------------------ r505 | deepayan | 2004-09-01 17:08:42 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R removed stupid use of levels.fos from panel.[dot|bw]plot ------------------------------------------------------------------------ r504 | deepayan | 2004-09-01 13:58:20 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/demo/lattice.R removed lset calls, added example where xlab and ylab are grobs ------------------------------------------------------------------------ r503 | deepayan | 2004-09-01 13:57:31 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION M /trunk/lattice/man/trellis.datasets.Rd removed sunspot data, enabled LazyData ------------------------------------------------------------------------ r502 | deepayan | 2004-09-01 13:56:24 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/man/xyplot.Rd documented new aspect='iso' option ------------------------------------------------------------------------ r499 | deepayan | 2004-09-01 13:18:21 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd A /trunk/lattice/man/lattice.options.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/llines.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/panel.levelplot.Rd M /trunk/lattice/man/strip.default.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/update.trellis.Rd documentation updates ------------------------------------------------------------------------ r498 | deepayan | 2004-09-01 13:12:11 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/interaction.R A /trunk/lattice/man/interaction.Rd more support for interacting with lattice plots ------------------------------------------------------------------------ r497 | deepayan | 2004-09-01 13:10:21 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R updated default prepanel function for relation!=same; also set default rot=0 for factors and shingles even when relation!=same ------------------------------------------------------------------------ r496 | deepayan | 2004-09-01 13:07:29 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/layout.R M /trunk/lattice/R/print.trellis.R xlab, main etc can now be grobs; plus misc fixes ------------------------------------------------------------------------ r495 | deepayan | 2004-09-01 13:03:45 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/update.trellis.R miscellaneous updates, formally deprecated lset ------------------------------------------------------------------------ r494 | deepayan | 2004-09-01 12:53:09 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/scales.R added more reasonable behaviour for factors when relation=free/sliced ------------------------------------------------------------------------ r493 | deepayan | 2004-09-01 12:47:47 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/common.R construct.legend moved over to legend.R ------------------------------------------------------------------------ r492 | deepayan | 2004-09-01 12:46:56 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R In levelplot and wireframe, coloring information needs to be shared between the panel function and the colorkey. This used to be done by evaluating col.regions in the top level function, but this involved reading the trellis settings at object creation time and not printing time. This has now been fixed. Also other minor juggling of arguments ------------------------------------------------------------------------ r491 | deepayan | 2004-09-01 12:41:03 -0500 (Wed, 01 Sep 2004) | 1 line Changed paths: M /trunk/lattice/R/strip.R redefined strip.custom, hopefully works better now ------------------------------------------------------------------------ r484-r477 | deepayan | 2004-08-29 16:31:36 -0500 (Sun, 29 Aug 2004) | 1 line more support for interaction ------------------------------------------------------------------------ r476 | deepayan | 2004-08-29 16:28:42 -0500 (Sun, 29 Aug 2004) | 1 line Changed paths: M /trunk/lattice/man/trellis.device.Rd added note about dev.print ------------------------------------------------------------------------ r475 | deepayan | 2004-08-28 18:29:34 -0500 (Sat, 28 Aug 2004) | 1 line first major commit as part of R-packages. There have been several local changes after the initial import, which are all being committed together. Details can be found in the svn log's of the older repository, which have been extracted (and edited) in the new file lattice.svnlog (later renamed to SvnLog) ------------------------------------------------------------------------ Change SVN location (to https://svn.r-project.org/R-packages/) ------------------------------------------------------------------------ r342 | deepayan | 2004-08-28 12:24:25 -0500 (Sat, 28 Aug 2004) | 1 line Changed paths: M /trunk/lattice/tests/test.R changed tests in accordance with new panel naming conventions ------------------------------------------------------------------------ r341 | deepayan | 2004-08-28 12:23:37 -0500 (Sat, 28 Aug 2004) | 1 line Changed paths: M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/histogram.Rd M /trunk/lattice/man/levelplot.Rd M /trunk/lattice/man/lset.Rd A /trunk/lattice/man/panel.axis.Rd M /trunk/lattice/man/panel.barchart.Rd M /trunk/lattice/man/panel.cloud.Rd M /trunk/lattice/man/panel.functions.Rd M /trunk/lattice/man/panel.pairs.Rd M /trunk/lattice/man/print.trellis.Rd M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd M /trunk/lattice/man/splom.Rd M /trunk/lattice/man/trellis.device.Rd M /trunk/lattice/man/trellis.par.get.Rd M /trunk/lattice/man/xyplot.Rd doc updates and changes. Added panel.axis.Rd, unofficially deprecated lset, merging its functionality into trellis.par.set ------------------------------------------------------------------------ r340 | deepayan | 2004-08-28 12:17:23 -0500 (Sat, 28 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/layout.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R layout updates, plus added a new default.scales argument to highlevel functions ------------------------------------------------------------------------ r336 | deepayan | 2004-08-26 01:16:18 -0500 (Thu, 26 Aug 2004) | 1 line Changed paths: A /trunk/lattice/R/layout.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/strip.R major restructuring of print.trellis layout in progress ------------------------------------------------------------------------ r334 | deepayan | 2004-08-25 17:20:33 -0500 (Wed, 25 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R panel.barchart had a bug, fill color code had not been updated for horizontal = FALSE. Fixed. ------------------------------------------------------------------------ r332 | deepayan | 2004-08-25 12:46:50 -0500 (Wed, 25 Aug 2004) | 1 line Changed paths: D /trunk/lattice/install.R deleting install.R ------------------------------------------------------------------------ r331 | deepayan | 2004-08-25 12:46:26 -0500 (Wed, 25 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/settings.R M /trunk/lattice/R/zzz.R more axis related updates ------------------------------------------------------------------------ r330 | deepayan | 2004-08-25 12:45:50 -0500 (Wed, 25 Aug 2004) | 1 line Changed paths: A /trunk/lattice/R/shingle.R A /trunk/lattice/R/strip.R separated strip and shingle related code into separate files ------------------------------------------------------------------------ r329 | deepayan | 2004-08-25 00:23:01 -0500 (Wed, 25 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/splom.R more axis restructuring (incomplete) ------------------------------------------------------------------------ r328 | deepayan | 2004-08-24 23:09:13 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/axis.R M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/splom.R restructuring of scales ------------------------------------------------------------------------ r327 | deepayan | 2004-08-24 18:55:57 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/inst/Changes added placeholder for lattice 0.10 ------------------------------------------------------------------------ r326 | deepayan | 2004-08-24 18:54:26 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R more graphical arguments now honored ------------------------------------------------------------------------ r325 | deepayan | 2004-08-24 18:53:26 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/cloud.R more graphical arguments now honored ------------------------------------------------------------------------ r324 | deepayan | 2004-08-24 18:51:06 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R changed alpha=0 to alpha=1 to track grid changes ------------------------------------------------------------------------ r323 | deepayan | 2004-08-24 18:50:15 -0500 (Tue, 24 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/legend.R M /trunk/lattice/R/levelplot.R fixes for bug with datetime objects ------------------------------------------------------------------------ r318 | deepayan | 2004-08-19 21:11:46 -0500 (Thu, 19 Aug 2004) | 1 line Changed paths: M /trunk/lattice/NAMESPACE minor changes, plus takes care of split of graphics into graphics and grDevices ------------------------------------------------------------------------ r308 | deepayan | 2004-08-05 09:55:07 -0500 (Thu, 05 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R adding initial support for alpha transparency ------------------------------------------------------------------------ r307 | deepayan | 2004-08-05 09:54:39 -0500 (Thu, 05 Aug 2004) | 1 line Changed paths: M /trunk/lattice/src/threeDplot.c changed order calculations in wireframe (now based on average facet depth) ------------------------------------------------------------------------ r305 | deepayan | 2004-08-05 09:53:00 -0500 (Thu, 05 Aug 2004) | 1 line Changed paths: A /trunk/lattice/R/summary.trellis.R adding a new summery method for trellis objects ------------------------------------------------------------------------ r304 | deepayan | 2004-08-05 09:51:55 -0500 (Thu, 05 Aug 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/update.trellis.R updates in what the call component of trellis objects stores ------------------------------------------------------------------------ r303 | deepayan | 2004-07-27 18:51:20 -0500 (Tue, 27 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/update.trellis.R update now updates call component of trellis object ------------------------------------------------------------------------ r301 | deepayan | 2004-07-26 11:18:38 -0500 (Mon, 26 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/zzz.R initialize placeholders in .LatticeEnv at startup ------------------------------------------------------------------------ r300 | deepayan | 2004-07-26 11:16:47 -0500 (Mon, 26 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R M /trunk/lattice/R/settings.R adding (half-finished) support for non-graphical options and saving last printed trellis object ------------------------------------------------------------------------ r298 | deepayan | 2004-07-22 20:25:51 -0500 (Thu, 22 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/legend.R M /trunk/lattice/man/panel.barchart.Rd changed choice of fill colors for grouped barcharts - used to be like levelplot, now from a new superpose.fill ------------------------------------------------------------------------ r297 | deepayan | 2004-07-21 22:18:08 -0500 (Wed, 21 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/man/llines.Rd added type=H to lplot.xy ------------------------------------------------------------------------ r296 | deepayan | 2004-07-21 22:14:42 -0500 (Wed, 21 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/miscellaneous.R M /trunk/lattice/R/xyplot.R M /trunk/lattice/man/panel.dotplot.Rd M /trunk/lattice/man/panel.xyplot.Rd added horizontal=FALSE arg to panel.xyplot to control what happens in type = h, s, S ------------------------------------------------------------------------ r295 | deepayan | 2004-07-18 12:29:32 -0500 (Sun, 18 Jul 2004) | 1 line Changed paths: A /trunk/lattice/man/reorder.factor.Rd adding docs for reorder.factor ------------------------------------------------------------------------ r294 | deepayan | 2004-07-18 11:58:04 -0500 (Sun, 18 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/cloud.R M /trunk/lattice/man/cloud.Rd M /trunk/lattice/man/panel.cloud.Rd reorganized cloud arguments ------------------------------------------------------------------------ r293 | deepayan | 2004-07-18 11:50:45 -0500 (Sun, 18 Jul 2004) | 1 line Changed paths: M /trunk/lattice/DESCRIPTION bumped up version ------------------------------------------------------------------------ r282 | deepayan | 2004-07-07 02:26:27 -0500 (Wed, 07 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/tests/scales.R fixed font secification problems ------------------------------------------------------------------------ r281 | deepayan | 2004-07-07 01:35:33 -0500 (Wed, 07 Jul 2004) | 1 line Changed paths: M /trunk/lattice/man/llines.Rd added offset arg to ltext ------------------------------------------------------------------------ r280 | deepayan | 2004-07-07 01:24:28 -0500 (Wed, 07 Jul 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R M /trunk/lattice/R/cloud.R M /trunk/lattice/R/densityplot.R M /trunk/lattice/R/histogram.R M /trunk/lattice/R/levelplot.R M /trunk/lattice/R/parallel.R M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/R/scales.R M /trunk/lattice/R/splom.R M /trunk/lattice/R/xyplot.R mostly cosmetic change to all high-level functions, concerns how limits and perm/index.cond are computed ------------------------------------------------------------------------ r279 | deepayan | 2004-07-07 01:22:21 -0500 (Wed, 07 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/common.R added the possibility of index.cond being a function. ------------------------------------------------------------------------ r277 | deepayan | 2004-07-07 01:19:57 -0500 (Wed, 07 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/man/panel.functions.Rd added panel.identify ------------------------------------------------------------------------ r276 | deepayan | 2004-07-07 01:01:03 -0500 (Wed, 07 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/man/xyplot.Rd updated docs for index.cond, which can now be a function ------------------------------------------------------------------------ r275 | deepayan | 2004-07-07 00:40:38 -0500 (Wed, 07 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/update.trellis.R updated to make index.cond work for functions, plus setting perm.cond and index.cond to NULL reverts to default ------------------------------------------------------------------------ r274 | deepayan | 2004-07-06 23:38:07 -0500 (Tue, 06 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/NAMESPACE added panel.identify ------------------------------------------------------------------------ r273 | deepayan | 2004-07-06 23:21:17 -0500 (Tue, 06 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/miscellaneous.R added offset argument to ltext ------------------------------------------------------------------------ r272 | deepayan | 2004-07-06 22:54:54 -0500 (Tue, 06 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/NAMESPACE exported panel.rug, which I guess I just missed earlier ------------------------------------------------------------------------ r271 | deepayan | 2004-07-06 22:08:25 -0500 (Tue, 06 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/settings.R made trellis.par.set return NULL ------------------------------------------------------------------------ r268 | deepayan | 2004-07-06 10:57:05 -0500 (Tue, 06 Jul 2004) | 3 lines Changed paths: M /trunk/lattice/man/xyplot.Rd changed HersheyPlain to HersheySans since these were misspecifications, caught in r-devel ------------------------------------------------------------------------ r267 | deepayan | 2004-07-06 10:56:21 -0500 (Tue, 06 Jul 2004) | 3 lines Changed paths: M /trunk/lattice/demo/lattice.R changed Hershey to HersheySans in a couple of places since these were misspecifications, caught in r-devel ------------------------------------------------------------------------ r266 | deepayan | 2004-07-05 21:53:16 -0500 (Mon, 05 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/print.trellis.R removed legend code to separate file ------------------------------------------------------------------------ r265 | deepayan | 2004-07-05 21:15:05 -0500 (Mon, 05 Jul 2004) | 1 line Changed paths: A /trunk/lattice/R/legend.R separated draw.key and draw.colorkey functions into new file ------------------------------------------------------------------------ r264 | deepayan | 2004-07-05 21:04:39 -0500 (Mon, 05 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/R/miscellaneous.R added function reorder.factor a la S-PLUS ------------------------------------------------------------------------ r261 | deepayan | 2004-07-05 08:10:39 -0500 (Mon, 05 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/man/panel.xyplot.Rd added clarification on what happens with vector type ------------------------------------------------------------------------ r260 | deepayan | 2004-07-05 08:09:41 -0500 (Mon, 05 Jul 2004) | 2 lines Changed paths: M /trunk/lattice/man/lset.Rd removed non-existent link to lattice.theme ------------------------------------------------------------------------ r238 | deepayan | 2004-06-09 21:31:16 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R added new strip.border setting, fixed bug which could create incomplete settings ------------------------------------------------------------------------ r237 | deepayan | 2004-06-09 21:28:45 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R added explicit fill='transparent' to some grid.rect calls to guard against unintended gpar setting ------------------------------------------------------------------------ r236 | deepayan | 2004-06-09 21:26:32 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/src/threeDplot.c changed R_IsNaNorNA to ISNAN ------------------------------------------------------------------------ r234 | deepayan | 2004-06-09 21:24:05 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/tests/MASSch04.R updated to latest MASS ------------------------------------------------------------------------ r233 | deepayan | 2004-06-09 18:11:24 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/R/levelplot.R added panel.contourplot, wrapper around panel.levelplot ------------------------------------------------------------------------ r232 | deepayan | 2004-06-09 18:05:54 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R use new setting value strip.border for strip borders ------------------------------------------------------------------------ r231 | deepayan | 2004-06-09 18:04:33 -0500 (Wed, 09 Jun 2004) | 1 line Changed paths: M /trunk/lattice/R/bwplot.R added check in panel.stripplot for empty x and y ------------------------------------------------------------------------ r169 | deepayan | 2004-05-13 08:56:49 -0500 (Thu, 13 May 2004) | 1 line Changed paths: M /trunk/lattice/R/cloud.R fixed cloud bug for lines with 2 points, matrix was becoming vector because of drop = T ------------------------------------------------------------------------ r168 | deepayan | 2004-05-13 08:53:51 -0500 (Thu, 13 May 2004) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R fixed fairly major bug in replication of skip, reported by Stephan Moratti ------------------------------------------------------------------------ r132 | deepayan | 2004-04-27 08:08:06 -0500 (Tue, 27 Apr 2004) | 1 line Changed paths: M /trunk/lattice/R/settings.R make sure trellis.device in .First() works ------------------------------------------------------------------------ r131 | deepayan | 2004-04-27 08:07:12 -0500 (Tue, 27 Apr 2004) | 1 line Changed paths: M /trunk/lattice/R/qq.R M /trunk/lattice/R/qqmath.R M /trunk/lattice/man/qq.Rd M /trunk/lattice/man/qqmath.Rd changed default qq/qqmath behaviour to mimic base analogs rather than S-PLUS qq/qqmath ------------------------------------------------------------------------ r130 | deepayan | 2004-04-27 08:05:06 -0500 (Tue, 27 Apr 2004) | 1 line Changed paths: M /trunk/lattice/R/print.trellis.R fixed incorrect code involving expressions (no longer working after bugfix in r-devel) ------------------------------------------------------------------------ r61 | deepayan | 2004-04-06 22:38:37 -0500 (Tue, 06 Apr 2004) | 1 line Changed paths: M /trunk/lattice/man/qqmath.Rd changed qqmath to behave like qqnorm ------------------------------------------------------------------------ CVS -> SVN ------------------------------------------------------------------------ 2004-04-08 Deepayan Sarkar * R/qq.R, R/qqmath.R, man/qq.Rd, man/qqmath.Rd: changed default behaviour of qq and qqmath to use actual data instead of sample quantiles. The new behaviour is different from the corresponding S-PLUS functions, but is closer to analogous base functions qqplot and qqnorm 2004-03-22 Deepayan Sarkar * R/print.trellis.R: changed behaviour of skip * man/xyplot.Rd: updated docs for skip 2004-03-19 Deepayan Sarkar * utilities.3d.Rd: removed palette.shade from docs * panel.cloud.Rd: adjusted docs for panel.3dwire's shade.colors arg * latticeParseFormula.Rd: fixed docs for drop * R/*.R: added drop.unused.levels as a high-level argument to xyplot etc. The earlier behaviour was a trellis.par.get-table setting, but that doesn;t make sense because this is not a display parameter 2004-03-17 Deepayan Sarkar * panel.functions.Rd: added panel.rug in docs * lset.Rd: added link to trellis.device 2004-03-13 Deepayan Sarkar * panel.cloud.Rd: added note saying x,y,z could all be matrices * cloud.Rd: added docs in wireframe for parametrized 3-D surfaces 2004-03-12 Deepayan Sarkar * DESCRIPTION: updated version * tests/test.R: minor changes * demo/lattice.R: added wireframe sphere * R/densityplot.R: fixed default prepanel function to not throw an error (in density()) when panel has only 1 point * R/common.R: modified latticeParseFormula to keep matrices unchanged (so that a formula of the form matrix ~ matrix * matrix can be used in wireframe) * R/cloud.R: added (way cool) changes to allow wireframe to render 3-D surfaces parametrized on a grid (e.g. a sphere) * man/update.trellis.Rd: added mention of legend * man/panel.pairs.Rd: fixed synopsis * man/print.trellis.Rd: fixed grid links (hopefully) 2004-03-08 Deepayan Sarkar * miscellaneous.R: added a col.line arg for lplot.xy to distinguish between color for lines and points (not that it matters here, but panel.xyplot and panel.superpose make the distinction, and it's easier to just pass it down here) * cloud.R, levelplot.R, scales.R, settings.R, update.trellis.R, zzz.R: many improvements to cloud and wireframe, plus misc changes 2004-03-05 Deepayan Sarkar * tmd.R: tmd simplified using update(), fixed potential xlab/ylab bug * miscellaneous.R, print.trellis.R, update.trellis.R: obscure improvements to axis setting usage and update method * R: bunch of updates, mostly dealing with fonts (fontfaces, fontwidths) and labels (main, sub, xlab, ylab) 2004-03-03 Deepayan Sarkar * man/xyplot.Rd: added docs for perm.cond, index.cond; updated other parts * R: bunch of fairly major changes, including code reorganization and addition of features, too numerous to list. A summary of the changes is available in inst/Changes 2004-03-02 Deepayan Sarkar * man: doc updates mostly to ensure R CMD check passage 2004-02-14 Deepayan Sarkar * xyplot.Rd: added entry for par.settings, corrected statements about subscripts 2004-02-13 Deepayan Sarkar * xyplot.Rd: added note on panel.number and panel.counter arguments. Has a related brief and oblique mention of the conditioning variable permutation / reordering stuff. Not sure what the best place to put a more detailed description is. 2004-02-10 Deepayan Sarkar * man/Lattice.Rd: wireframe is no longer slow, so removed statement to that effect. Replaced S-Plus with S-PLUS 2004-02-08 Deepayan Sarkar * man/print.trellis.Rd: added warning not to use aspect != "fill" with explicit panel.width and panel.height 2004-02-05 Deepayan Sarkar * man/xyplot.Rd, cloud.Rd: fixed errors of the form \link{\code{stuff}} 2003-12-20 Deepayan Sarkar * DESCRIPTION, NAMESPACE : made changes to deal with package reorganization in R 1.9.0-pre. Some other files changed as well (mostly dealing with loess.smooth, which is now in stats) 2003-10-17 Deepayan Sarkar * R/axis.R : added trim = TRUE in format() when calculating axis tick labels. Without this, labels often had leading spaces, causing a visible 'right shift' (reported by Patrick Connolly). 2003-10-10 Deepayan Sarkar * R/ : split common.R into common.R, axis.R and scales.R 2003-10-09 Deepayan Sarkar * R/levelplot.R: Fixed panel.levelplot bug where nothing was drawn if a panel contained only one unique value of x/y (reported by Wolfram Fischer). 2003-09-15 Deepayan Sarkar * R/miscellaneous.R: added some code to handle cex when pch = character, using new grid feature. However, grid has a bug when pch - numeric, so there's still a workaround in place, which should eventually be removed. This overrides related changes on 2003-09-03 * man/panel.pairs.Rd: added doc for prepanel.limits, pscales * tests/test.R: added code with splom pscales weirdness * R/splom.R: earlier interpretation of pscales was ambiguous. Changed to make specification of limits, at and labels consistent. See panel.pairs docs. * man/splom.Rd: moved bulk of pscales doc over to help page for panel.pairs 2003-09-05 Deepayan Sarkar * splom.R: added a prepanel.limits argument to panel.pairs to allow custom axis range calculations for each variable 2003-09-03 Deepayan Sarkar * miscellaneous.R: lplot.xy modified to use grid.text when pch is non-numeric. This would allow pch like pch = 'string' or pch = expression(sigma). This feature would disappear in the future. 2003-08-29 Deepayan Sarkar * levelplot.R: the older contourplot routine went horribly wrong when there were NA's in the z-values. This has now been addressed with a slightly crude hack: all z-NA's are now replaced by min(z, na.rm = TRUE) for the contour drawing routine. This may cause inaccuracies near the "border", but should be OK in most real-life cases, where the non-NA part should be a largish connected piece, with a fairly insignificant boundary. This incidentally fixes another bug, apparent when the at vector does not cover the full z range (colors used to be recycled instead of leaving blank spaces) 2003-08-22 Deepayan Sarkar * settings.R: (canonical.theme) also added clip option for the strip * print.trellis.R: clipping for panel and strip now determined by trellis setting "clip" * settings.R: added a clip = list(panel = TRUE) to the list of valid settings 2003-08-21 Deepayan Sarkar * levelplot.R (panel.levelplot): shrinking had problems for constant z values within a panel (diff(range()) = 0, leading to division by 0). Also, it turns out that shrinking was being done based on range of z within each panel, not the overall data frame. This could be misleading, so changed. 2003-08-20 Deepayan * common.R (calculateAxisComponents): the format argument renamed to format.posixt (to avoid confusion with the format function). More importantly, in the "plain numeric" case, as.character(at) replaced with format(at). So now at = c(1, 1.5, 2) will be labeled as c("1.0", "1.5", "2.0") instead of c("1", "1.5", "2"). Both changes suggested by Tom Short. * common.R, settings.R, zzz.R: Supplemental changes related to NAMESPACE. Also renamed man/lattice-internal.Rd to man/lattice-internal.Rd.foo --- this is ignored by R CMD scripts, but has been retained as a possibly useful reference for internal (unexported) functions. 2003-08-05 Deepayan * zzz.R: NAMESPACE changes (due to Prof Ripley) * print.trellis.R: changes associated with NAMESPACE (actually moving .lattice.print.more to an environment) * NAMESPACE: added NAMESPACE file * R/zzz.R, R/print.trellis.R, R/settings.R: changes related to NAMESPACES (actually due to moving a couple of global variables to a new environment (see R/zzz.R) ), due to Prof Ripley. Also simplified trellis.par.get() a bit. 2003-05-31 Deepayan Sarkar * bwplot.R, cloud.R, miscellaneous.R, xyplot.R: changed order to sort.list where appropriate 2003-05-29 Deepayan Sarkar * levelplot.R: added na.rm = TRUE to min in min(abs(slopes)) because sometimes slopes can be NaN. Also, added graphics parameters for panel.levelplot labels 2003-05-24 Deepayan Sarkar * panels.R: added a function called panel.curve, similar to curve() in base. * R/panel.functions.Rd: added docs for panel.curve * man/panel.pairs.Rd: added doc entry for 'panel.number' 2003-05-22 Deepayan Sarkar * tests/scales.R: added output file name * tests/MASSch04.R: changes a call to title() to main= * tests/test.R: added output file * tests/dotplotscoping.R: added output filename 2003-05-22 Deepayan Sarkar * DESCRIPTION: updated DESCRIPTION * man/panel.pairs.Rd: added doc entry for 'panel.number' * R/common.R (limits.and.aspect): Following up on a report by Kevin Wright, I discovered that the presence of blank panels (either by skip or due to layout specifying more panels than were actually there) caused problems in calculating factor levels (adding an extra NA level). This should be fixed now. Also, handling of xlim=list(...) improved in cases with skip (not that anyone is ever going to use it). 2003-05-22 Deepayan Sarkar * splom.R: panel functions can now optionally ask for a panel.number argument, which would be supplied as an argument only if the panel function has such an argument. Unfortunately, this was not working as intended in splom, because of the unusual nature of the panel/superpanel arguments. This has been fixed. 2003-05-19 Deepayan Sarkar * man: fixed minor doc problems to pass R CMD check 2003-05-18 Deepayan Sarkar * R: Almost all files updated to fix bugs related to the scales argument --- limits inside scales had a bad bug which is now fixed, also added and improved support for multiple (as lists) limits, at, labels. axs = "i" should also work. * tests: new tests added * R/miscellaneous.R: modified lsegments to accept x0, x1 as well as x1, x2 (a la S-PLUS). 2003-04-10 Deepayan Sarkar * man: Documentation updates 2003-03-26 Deepayan Sarkar * bwplot.R, common.R, panels.R, print.trellis.R, zzz.R: some bugfixes, added MASS ch04 script to tests 2003-03-26 Deepayan Sarkar * print.trelis.R: fixed problem with expressions as axis tick labels when relation = "same". Reverted back to using (slower) old code in colorkey because of (grid?) bug in new version. * common.R: added code in latticeParseFormula to convert matrices to data frames (for splom and parallel) before subsetting. 2003-03-15 Deepayan Sarkar * common.R: fixed some problems when outer and conditioning variables interact * print.trellis.R: fixed y-axis scales drawing * common.R (latticeParseFormula): added argument outer=FALSE. When outer = TRUE, variables separated by + (when multiple = TRUE) are made into a conditioning variable instead of grouping variable * several: updated support for multiple LHS/RHS in formula, auto.key, outer 2003-03-14 Deepayan Sarkar * levelplot.R: changed prepanel functions to handle factors gracefully. Fixed problem with unequally spaced grid points. Improved contourplot labelling. New argument shrink in panel.levelplot, allowing rectangle dimensions to be proportional to height. (Many of these were actually done much earlier, but committed now) * bwplot.R: fixed some problems with processing of formula in dotplot etc before calling bwplot * common.R: removed latticeAsFormula, no use 2003-03-14 Deepayan Sarkar * print.trellis.R (print.trellis): Among other things, a rewrite of how axis ticks and annotation are drawn (mainly how the parameters translate to physical dimensions). The tck, rot and cex components of scales can now be length 2 vectors, for bottom/left and top/right scales. tck can be negative, giving ticks inside panels. panel functions with a ... argument are now passed a variable called panel.number, giving the sequence number of the panel (not sure what happens when skip is non-FALSE) * plot.shingle.R: modified plot.shingel to make tck, cex and rot 2-vectors 2003-03-13 Deepayan Sarkar * bwplot.R: added code to panel.barchart (also panel.dotplot) to handle groups. Substantially changed the way arguments are processed in barchart, dotplot and stripplot before being passed on to bwplot. When y is missing, and x has non-null names(), names are used as the y variable. Also added changes necessary to enable multiple LHS and RHS is formula with allow.multiple = TRUE. 2003-03-13 Deepayan Sarkar * common.R (construct.scales): made changes so that cex, tck and rot can now be length 2 vectors in scales, affecting scales at the bottom/left and top/right of panels respectively. Associated changes in print.trellis later. 2003-03-13 Deepayan Sarkar * settings.R (trellis.device): Changed the default for the theme argument from NULL to getOption("lattice.theme"), which can be either a list, or a (possibly quoted) function, which when called will return a list. 2003-03-09 Deepayan Sarkar * splom.R (panel.pairs): the pscales argument didn't work when it was specified as a list. Fixed. 2003-03-07 Saikat DebRoy * common.R (latticeParseFormula): Compute a new element of the answer, subscr, if subscripts=TRUE. 2003-03-07 Deepayan Sarkar * common.R (latticeParseFormula): added a subscripts = FALSE argument, which is not used anywhere yet. 2003-03-05 Deepayan Sarkar * print.trellis.R (print.trellis): added two new arguments to print.trellis; panel.height = list(1, "null"), panel.width = list(1, "null"), which can be used to specify explicitly the dimensions of each panel in terms of grid units. Any unit is allowed as long as it does not need a 'data'. Not too difficult to add that, but probably unnecessary. Behaviour is undefined (well, it is defined, but I don't want anyone to count on it) when aspect is not "free" in the object being printed. Docs not updated yet. 2003-03-05 Deepayan Sarkar * print.trellis.R (draw.colorkey): Colorkey changed to use the vector fill gpar when drawing rectangles. This means all rectangles are drawn at one go, hence less things to grid.pack(), hence faster when lots of cuts in levelplot/wireframe. 2003-03-04 Saikat DebRoy * common.R (latticeParseFormula): Fix concat() to handle shingles correctly. 2003-03-03 Saikat DebRoy * R/common.R (latticeParseFormula): Allow the possibility of having multiple variables in LHS or RHS of the model formula (eg. y1+y2 ~ x1+x2). 2003-03-03 Saikat DebRoy * R/common.R (latticeParseFormula): Use the environment of the model as enclos argument in calls to eval(). 2003-02-24 Deepayan Sarkar * R/zzz.R: Restructured .First.lib following suggestions from Prof Ripley. Changed library(grid) to require(grid), with an error message if that fails. * R/levelplot.R: xlab, ylab, etc in contourplot was not passed on properly to levelplot. Fixed. 2003-01-30 Deepayan Sarkar * R/densityplot.R: changed prepanel.default.densityplot to return range instead of some-stupid-thing else when a groups argument is given. 2003-01-16 Deepayan Sarkar * R/settings.R: changed trellis.par.get so that when called with no device open, it starts the default device a la print.trellis 2003-01-15 Deepayan Sarkar * R/levelplot.R: levelplot used to calculate wx and wy, which was not a good idea since this should have been done inside the panel and prepanel functions. The prepanel function has been rewritten, fixing a bug, but some more reorganization still needs to be done. 2002-12-18 Deepayan Sarkar * R/miscellaneous.R: fixed problem the with 'adj' argument in ltext (used to ignore second component, PR#2380). added 'pos' argument as in text. No offset yet, though. * R/panels.R: Changed panel.superpose to pass groups and subscripts to panel.groups (PR#2377). Not very obvious how groups might help, but I guess more information is better than less. Also, several other panel functions didn't recognize the col.line argument, this was fixed. 2002-12-15 Deepayan Sarkar * R/common.R: The changes in lattice 0.5-0.6 added some code that gave bad results when some panels had all NA's. That hopefully fixed. * R/miscellaneous.R: lplot.xy used to call grid.text instead of grid.points when pch was a character. Fixed this. * R/print.trellis.R: draw.key failed when lines component had type='b', because of a missing pch. Fixed this. * R/levelplot.R: Minor fix related to changes in grid. 2002-12-06 Deepayan Sarkar * R/settings.R: added warnings and error messages in trellis.par.get/set when no active device, and when value in trellis.par.set is not a list. * R/trellis.par.get.Rd: rewrote some things 2002-11-16 Deepayan Sarkar * R/common.R: added arguments have.log and logbase to calculateAxisComponents() * R/print.trellis.R: made changes to use above changes 2002-10-28 Deepayan Sarkar * R: Hmm, lots of changes made without any log entries. Should be more careful ! Anyway, renamed inst/README to inst/Changes, and added a brief overview of changes in lattice 0.6 . Also made some documentation updates. Changed version to 0.6-6, ready to upload. 2002-01-10 Deepayan Sarkar * R: Too many changes to list, mainly in print.trellis and documentation. 2001-08-08 Deepayan Sarkar * R/levelplot.R: Implemented preliminary levelplot (no contourplot though). Also a version of cloud, though no support yet for nice axes/arrows and stuff (does allow panel.superpose though). Again, no plans of implementing wireframe in the near future. 2001-08-08 Saikat DebRoy * R/common.R: Added support for 3d formulae in latticeParseFormula 2001-07-26 Deepayan Sarkar * R/Lattice.Rd: Included llines, lpoints etc for easy adaptation of existing Trellis code. qq() changed to as it should be, should now work with tmd(). 2001-07-12 Deepayan Sarkar * R/Lattice.Rd: Major redesigning of existing functions. Mainly by collecting common code into a few functions and hence making individual functions easier to handle. Code should now be fairly readable. Also, more or less good support for log scales and key (I hope). Not much checking done yet, there may be bugs. Documentation might be out of step at places. 2001-05-06 Deepayan Sarkar * R/tmd.R: Name changed from trellis to Lattice. Prelilminary changes to account for change of Lattice to Grid made. New functions rfs, oneway, qq (not final), qqmath, tmd, plot.shingle, update.trellis. Documentation more or less clean. 2001-04-19 Deepayan Sarkar * R/trellis.R: lots of changes. Introduced trellis objects. Print method for trellis objects. Implementation now includes barchart, bwplot, densityplot, dtplot, histogram, stripplot, xyplot, splom and parallel (and excludes piechart(will probably remain that way), qqmath, qq, timeplot(?), contourplot, levelplot, wireframe and cloud). Cleanup, documentation etc. 2001-03-22 Deepayan Sarkar * R/trellis.R: added splom and some brief documentation for splom 2001-03-02 Deepayan Sarkar * R/trellis.R: dtplot (dotplot) implemented. Probably has lots of bugs. Some documentation, including example for dtplot (same as usual dotplot example). 2001-03-02 Deepayan Sarkar * R/trellis.R: updated bwplot (with the new layout structure) lattice/NAMESPACE0000644000176200001440000001726714576262623013150 0ustar liggesusers useDynLib(lattice, .registration = TRUE) import(grid) ## importFrom(methods, hasArg) # replicated in hasGroupNumber() importFrom(grDevices, dev.hold, dev.flush, dev.capabilities, dev.list, cm.colors, gray, col2rgb, rgb, adjustcolor, heat.colors, grey, hsv, xy.coords, axisTicks, boxplot.stats, contourLines, colorRamp, colorRampPalette, as.raster, hcl.colors, palette.colors, convertColor) importFrom(graphics, par, plot, co.intervals, hist) importFrom(utils, head, tail, modifyList) importFrom(stats, as.formula, density, fitted.values, loess.smooth, median, ppoints, qnorm, residuals, update, var, coef, quantile, lm, dnorm, qunif, uniroot, smooth.spline, predict) export(histogram, # high level generics: densityplot, qqmath, qq, bwplot, dotplot, barchart, stripplot, xyplot, xyplot.ts, # needed by zoo contourplot, levelplot, cloud, wireframe, splom, parallel, # deprecated parallelplot, tmd, rfs, oneway, ## default panel functions panel.histogram, panel.densityplot, panel.qqmath, panel.qq, panel.bwplot, panel.dotplot, panel.barchart, panel.stripplot, panel.xyplot, panel.contourplot, panel.levelplot, panel.levelplot.raster, panel.cloud, panel.3dscatter, panel.wireframe, panel.3dwire, panel.pairs, panel.splom, diag.panel.splom, panel.parallel, panel.tmd.default, panel.tmd.qqmath, panel.error, ## Components for use in custom panel functions: ## superposition (usually unnecessary) panel.superpose, panel.superpose.2, panel.superpose.plain, ## data-driven (usually summary of some sort) panel.smoothScatter, panel.violin, panel.rug, panel.average, panel.linejoin, panel.lmline, panel.loess, panel.spline, panel.qqmathline, ## decorative / adds reference panel.abline, panel.refline, panel.curve, panel.fill, panel.grid, panel.mathdensity, panel.axis, ## access relevant informations (works in strip/axis as well) current.row, current.column, panel.number, packet.number, which.packet, trellis.currentLayout, ## replacements for low level standard graphics functions lplot.xy, llines, panel.lines, lpoints, panel.points, lsegments, panel.segments, ltext, panel.arrows, lrect, panel.text, larrows, panel.rect, lpolygon, panel.polygon, lpolypath, panel.polypath, ## useful prepanel functions prepanel.tmd.default, prepanel.tmd.qqmath, prepanel.lmline, prepanel.loess, prepanel.spline, prepanel.qqmathline, ## default prepanel functions prepanel.default.bwplot, prepanel.default.histogram, prepanel.default.qq, prepanel.default.xyplot, prepanel.default.cloud, prepanel.default.levelplot, prepanel.default.qqmath, prepanel.default.densityplot, prepanel.default.parallel, prepanel.default.splom, ## shingles shingle, is.shingle, as.shingle, as.factorOrShingle, equal.count, ### construct.scales, draw.colorkey, draw.key, simpleKey, latticeParseFormula, ## 3D utilities ltransform3dMatrix, ltransform3dto3d, ## miscellaneous utilities strip.default, strip.custom, packet.panel.default, axis.default, xscale.components.default, yscale.components.default, do.breaks, make.groups, banking, Rows, level.colors, ## settings show.settings, trellis.device, trellis.par.get, trellis.par.set, lattice.getOption, lattice.options, canonical.theme, standard.theme, classic.theme, col.whitebg, simpleTheme, makeShadePalette, ## interaction etc panel.identify, panel.identify.qqmath, panel.identify.cloud, panel.link.splom, panel.brush.splom, trellis.focus, trellis.unfocus, trellis.switchFocus, trellis.panelArgs, trellis.vpname, trellis.grobname, current.panel.limits, trellis.last.object ) S3method(widthDetails, latticeKey) ## methods related to shingles S3method("[", shingle) S3method(as.data.frame, shingle) S3method(plot, shingle) S3method(print, shingle) S3method(summary, shingle) S3method(as.character, shingleLevel) S3method(print, shingleLevel) ## methods for ``trellis'' objects (see also tmd below) S3method(print, trellis) S3method(plot, trellis) S3method(update, trellis) S3method(dim, trellis) S3method(dimnames, trellis) S3method("dimnames<-", trellis) S3method("[", trellis) S3method(t, trellis) S3method(summary, trellis) S3method(print, summary.trellis) ## methods for high level functions S3method(barchart, formula) S3method(barchart, data.frame) S3method(barchart, array) S3method(barchart, default) S3method(barchart, matrix) S3method(barchart, numeric) S3method(barchart, table) S3method(bwplot, formula) S3method(bwplot, data.frame) S3method(bwplot, numeric) S3method(densityplot, formula) S3method(densityplot, data.frame) S3method(densityplot, numeric) S3method(dotplot, formula) S3method(dotplot, data.frame) S3method(dotplot, array) S3method(dotplot, default) S3method(dotplot, matrix) S3method(dotplot, numeric) S3method(dotplot, table) S3method(histogram, formula) S3method(histogram, data.frame) S3method(histogram, factor) S3method(histogram, numeric) S3method(qqmath, formula) S3method(qqmath, data.frame) S3method(qqmath, numeric) S3method(stripplot, formula) S3method(stripplot, data.frame) S3method(stripplot, numeric) S3method(qq, formula) S3method(qq, data.frame) S3method(xyplot, formula) S3method(xyplot, data.frame) S3method(xyplot, ts) S3method(levelplot, formula) S3method(levelplot, data.frame) S3method(levelplot, table) S3method(levelplot, array) S3method(levelplot, matrix) S3method(contourplot, formula) S3method(contourplot, data.frame) S3method(contourplot, table) S3method(contourplot, array) S3method(contourplot, matrix) S3method(cloud, formula) S3method(cloud, data.frame) S3method(cloud, matrix) S3method(cloud, table) S3method(wireframe, formula) S3method(wireframe, data.frame) S3method(wireframe, matrix) S3method(splom, formula) S3method(splom, matrix) S3method(splom, data.frame) S3method(parallelplot, formula) S3method(parallelplot, matrix) S3method(parallelplot, data.frame) # defunct S3method(parallel, formula) S3method(parallel, matrix) S3method(parallel, data.frame) S3method(tmd, formula) S3method(tmd, data.frame) S3method(tmd, trellis) S3method(larrows, default) S3method(llines, default) S3method(lpoints, default) S3method(lpolygon, default) S3method(lpolypath, default) S3method(lrect, default) S3method(lsegments, default) S3method(ltext, default) ### Local variables: ### mode: R ### End: lattice/NEWS.md0000644000176200001440000011025214576262623013013 0ustar liggesusers # Changes in lattice 0.22 * All high-level functions such as `xyplot()` now have `"data.frame"` methods, where the formula can be provided either as the unnamed second argument or as the named `formula` argument. * `larrows()`, `lpolygon()`, `lrect()` and `lsegments()` are now generic functions. * Support for paths (via `grid.path()`, which supports holes) in `lpolypath()`, as well as in `lpolygon()` using new `rule` argument. * The long-deprecated `parallel()` function is now defunct. # Changes in lattice 0.21 * The color scheme used in the default graphical settings has been updated to use modern palettes, thanks to Achim Zeileis. It is also easier to customize the color palette in `standard.theme()`, via a new function `custom_theme()`. The earlier behaviour can be reinstated by setting `classic.theme("pdf")` as the theme; see `help(classic.theme)` for details. * `panel.levelplot()` has a new `region.type = "countour"` argument allowing smooth region boundaries similar to `filled.contour()`. Based on code in the `gridGraphics` package by Zhijian (Jason) Wen and Paul Murrell, ported by Johan Larsson. * Improved behaviour of `auto.key`, including better default placement and better handling of the `type` argument in scatterplots. Based on patch by Johan Larsson. * Default values of `auto.key` and `grid` can now be set via `lattice.options()`. * New `smooth` argument in `panel.xyplot()` as preferred alternative to using `type` to indicate type of smoothing desired. * Vector argument support in `panel.violin()`. Contributed by Stefan Eng. * Better handling of degenerate data in `panel.violin()`. * New option to optimize some grid unit calculations via `lattice.options(optimize.grid = FALSE)`. Currently, setting this to `TRUE` may speed up some multi-page plots. * New "grid" vignette containing examples of using raw grid with lattice. Contributed by Paul Murrell. * New `fill` argument in `panel.3dscatter()`. * Improved `call` component in trellis objects, fixing a longstanding [bug](https://stat.ethz.ch/pipermail/r-devel/2017-May/074243.html). * `draw.key()` now considers title in width calculations. * Miscellaneous bugfixes and improvements. # Changes in lattice 0.20 * The primary goal of the 0.20 series is to further improve documentation, building up to an eventual 1.0 release. Specific major changes are given below. * Use `dev.hold()` / `dev.flush()` introduced in R 2.14.0 for smoother displays and transition. * It is now easier to use raster images in levelplot() by specifying top-level argument 'useRaster=TRUE'. * 'pos' can now be a vector in `ltext()`, just as it can in `text()`. * Explicit components in 'colorkey' (for `levelplot()`) to specify graphical parameters of boundary and tick marks / labels. * "spline" added as a possibly 'type' in `panel.xyplot()`, following a suggestion from Patrick Breheny. * Support for traditional graphics-like log scale annotation, using `scales = list(equispaced.log = FALSE)`. * `parallel()` deprecated in favour of `parallelplot()`, to avoid potential confusion with the parallel package. * The internal lattice.status list is cleaned up whenever new page starts. This should fix lattice bug #1629. * New option to provide a custom rule for computing default breakpoints in `histogram()`. See ?histogram for details. * New datasets `USMortality` and `USRegionalMortality`. * Support for triangular ("open") endpoints in colorkey. * Support for title in colorkey. Based on patch by Johan Larsson. * Improved prepanel calculations for stacked barchart with missing values. # Changes in lattice 0.19 * The primary goal of the 0.19 series is to improve documentation and fix some obscure but long-standing bugs, building up to an eventual 1.0 release. Specific major changes are given below. * Added new arguments 'grid' and 'abline' in panel.xyplot(). * Added a "panel.background" setting. * Restructured storage of plot-specific information, fixing bug reported in https://stat.ethz.ch/pipermail/r-help/2007-October/143567.html * Added a CITATION file. * Added a new "axis.text" setting. * Added the option to scale data inside panel.3dscatter() and panel.3dwire() rather than assuming ther are already scaled. This may be helpful for use in user-written panel functions, with (additional) data specified in the original scale. * 'varnames' can now be expressions in splom()/parallel(). * Added support for 'xlab.top' and 'ylab.right' arguments. * Improved axis labelling in splom(), including support for date-time data. * panel.pairs() now passes arguments i and j to (sub)panel and diag.panel functions. * Default prepanel functions are now user-settable through lattice.options() * par.[main|sub|xlab|ylab].text parameter settings are more powerful. * Added support for 'just' component in draw.key() to allow justification of legend placement. * Graphical arguments in panel.superpose can now be lists. * Added support for raster colorkeys. * Added new 'height' component for keys. * Improved vectorization of graphical parameters in panel.bwplot. * Expanded trellis.grobname() and used it to provide a name for all grobs. * New panel.spline() function. ## Bug fixes * More realistic check for equispaced grid in panel.levelplot.raster(). * Improved partial matching of component names in 'key' and 'scales'. * xyplot.ts() now allows graphical parameters to be given as vectors (inside a list) for each series. Passes lists to panel.superpose. * panel.axis() now does NOT draw tick marks if 'ticks = FALSE'. # Changes in lattice 0.18 * Hosting of the upstream sources has moved to R-forge. This allows, among other things, the use of the R-forge issue tracker. * New xyplot.ts method, merging versions previously available in latticeExtra and zoo (thanks to the efforts of Felix Andrews) * An argument 'group.value', containing the level of the group, is now passed by panel.superpose to the 'panel.groups' function * Specifying 'auto.key' as a list now produces a legend even in the absence of 'groups', provided a 'text' component has been included * The 'layout' argument now accepts NA for number of columns or rows. * Scale limits 'xlim' & 'ylim' can have one NA to fix only one side. * Date and POSIXt scales now use new methods to calculate axis ticks, and now respond to the 'tick.number' component of 'scales'. * 'panel.qqmath' gains an argument 'tails.n' for exact data on tails. # Changes in lattice 0.17 ## New features * New function simpleTheme() for creating nested lists without specifying the nesting structure (which is guessed) * Support for lattice.option(print.function) which is the function actually used when print.trellis() is called * New argument 'box.width' wherever 'box.ratio' is available (e.g., panel.bwplot, panel.barchart, etc.), to specify absolute thickness (of boxes, bars, etc.) * New panel.refline() function, same as panel.abline(), but with default parameters from the "reference.line" settings. * parallel() has a new 'horizontal.axis' argument; when FALSE, the axes are vertical and are stacked side by side. * densityplot() now supports weights. * dotplot.table() etc. allow change of orientation (horizontal=FALSE). * New function panel.identify.cloud() to interactively label three-dimensional scatterplots. * Added support for notches in panel.bwplot (based on patch from Mike Kay) * New panel function panel.smoothScatter (relocated from Bioconductor package geneplotter) * Added German translations (contributed by Chris Leick) * reordered documentation to make PDF manual more readable ## Bug fixes * Make translations available (they were never actually installed before) # Changes in lattice 0.16 ## Changes in behaviour * 'x' in dotplot(~x, data) etc now gets names(x) set to rownames(data). Update: this feature has now been removed, as the resulting behaviour is undesirable for bwplot() * the 'call' component of a "trellis" object is set to a better value than before (at least for the methods in lattice). One consequence is that update.default() now works for cases in which update.trellis() doesn't (i.e. those where data packets need to change) * barchart.table now has an 'horizontal' argument * levelplot.matrix() now allows specification of column labels or positions through arguments 'row.values' and 'column.values' * width calculation for rectangles changed for levelplot() when 'x', 'y' are factors; they are set to 1, rather than trying to accomodate unequally spaced 'x' and 'y' values. This is important when there are empty levels * dimnames() of a "trellis" object is now settable (this allows changing names and levels of conditioning variables) * labels ('xlab', 'main', etc) can now be character vectors. In their list form, they support more graphical parameters as well as finer positioning (justification, rotation, etc.) * 'strip.left' gets called with 'horizontal = FALSE', so 'strip.left = strip.default' now works as expected # Changes in lattice 0.15 ## New features * Default panel functions are now settable options * Limits of a parallel coordinates plot can now be controlled via functions * New 'panel.aspect' argument for cloud and wireframe * Better support for factors in cloud and wireframe * More flexible placement of legends with x, y and corner. In particular, corner can have fractional values, and (x, y) can refer to a position w.r.t. two potential bounding boxes depending on lattice.getOption("legend.bbox") ('full', meaning full plot region, or 'panel', meaning the subregion containing panels and strips. The default is 'panel', which is a change in behaiour) * trellis.focus() now allows choosing panels interactively. * New interaction functions panel.identify.qqmath() and panel.brush.splom() * There is now an error handling mechanism for panel functions. By default, errors in panel functions no longer stop execution. See ?print.trellis for details. * Note: Some of these are also available in updated 0.14 versions ## Changes in behaviour * non-numeric data no longer cause warnings in bwplot * the default padding between components has been changed to 0.5 "chars" # Changes in lattice 0.14 ## New features * support for custom function that determines packet-panel correspondence. This could be used to fill panels vertically rather than horizontally, or to split layout over two or more pages, etc. (see ?packet.panel.default) * support for customizable functions for axis drawing and tick/label determination * various accessor functions available to panel, strip, axis (etc) functions, e.g. panel.number() and packet.number() * arguments to lattice.options and print.trellis arguments can now be attached to trellis objects (as parameter settings already could) through high level arguments 'lattice.options' and 'plot.args' * llines, lpoints and ltext are now generic functions * The high level 'key' argument can now have an argument called 'reverse.rows' to reverse the order of rows. This applies to 'draw.key', 'auto.key' and 'simpleKey' as well. * extended interpretation of 'breaks' in histogram() * matrix methods for 'splom' and 'parallel' (whose absence was an oversight) * support of 'alpha' argument in labels and legends, which were previously missing for no good reason * panel.grid() now allows 'h' and 'v' to have negative values other than -1, in which case '-h' and '-v' will be used as the 'n' argument to pretty() when determining line locations ## Changes in behaviour * panel function is no longer given arguments panel.number and packet.number (see above for alternatives) * panel.identify() now has a more useful return value (selected subscripts) * trellis.panelArgs() without any arguments should return meaningful results while a "trellis" object is being printed, and thus should be usable inside panel or axis functions. * For formulae of the form y1 + y2 ~ x1 + x2 + x3, the order of levels of the artificially created grouping variable is now more 'intuitive' # Changes in lattice 0.13 ## New features * high level generics like 'xyplot' now have both 'x' and 'data' as arguments. The only implication for S3 methods is that they will have to include the 'data' argument even if they are unused (as they should be when 'x' is not a formula). The reason for doing this is to encourage S4 methods using multiple dispatch where 'x' is a formula and 'data' is some other data source. * R messages are now translatable. * French translations courtesy of Philippe Grosjean. * instead of ignoring it as before, 'panel.xyplot' and 'panel.densityplot' now deal with a 'groups' argument appropriately by calling 'panel.superpose'. Consequently, the default of 'panel' in 'xyplot' etc does not need to be conditional on 'groups'. * added 'lineheight' as a graphical parameter where appropriate. * added a 'grid.pars' setting for arbitrary grid parameters to be set initially via gpar(). * For a shingle 'x', 'as.character(levels(x))' creates meaningful labels. * Shingle levels can now be printed by strip.default. * The strip function, like the panel function, is now passed arguments 'packet.number' and 'panel.number' (although the default strip function makes no use of it). * 'panel.superpose' has new argument to make it bahave like in S-PLUS (interpretation of 'type'). This makes 'panel.superpose.2' unnecessary, although it's still available. * Added wrappers lrect, lpolygon (and panel.rect, panel.polygon) ## Changes in behaviour * evaluation scope: standard functions with a formula based interface ('lm' etc) look for variables in the formula (that are not found in 'data') in the environment of the formula. This was done inconsistently for lattice functions, which has been fixed. * 'summary.trellis' is now more informative * calls with explicit 'formula=' no longer work (used to give a warning before) * The 'bar.fill' and 'superpose.fill' settings have been replaced with 'plot.polygon' and 'superpose.polygon' respectively, which are more consistent with other names. * Default of 'data' changed from 'parent.frame()' to NULL. This has to do with reasonable non-standard evaluation rules, and probably needs some more thought. * Default Trellis settings (a.k.a. theme) changed. See ?trellis.device for details ## Bug fixes * NA-handling * ltext now supports more 'adj' values * scales$y$alternating now counts row numbers from top if as.table = TRUE * miscellaneous improvements in strip.default ## TODO * change panel.qq so that most work gets done there # Changes in lattice 0.12 ## Improvements * panel.bwplot has a new 'stats' argument, which is a function used to calculate the statistics in the box and whisker plot. Defaults to boxplot.stats, which was the hard-coded value earlier. * panel.bwplot has been re-implemented. Faster, avoids direct grid calls * panel.densityplot now allows more flexible specifications of 'plot.points', specifically, points can be jittered (the new default) or indicated by a `rug'. * (more) changes in NA-handling. * panel.superpose handles type='g' itself so that the grid doesn't get repeated for every group. ## New features * All high level functions are now generic. This change should be mostly transparent, but there may be some unforeseen side-effects. S3 generics and methods are used (this may change at some point, but not in the near future). In particular, usage where the first argument is not actually a formula has now been formalized and is handled via method dispatch rather than the clumsy hacks in place earlier. * The first argument of high level lattice functions has been renamed from 'formula' to 'x'. This is related to the fact that these functions are now generic, and is intended to avoid long-term confusion. The first argument is usually not named, so this should not cause many problems. If the name 'formula' is explicitly supplied, it will be used with a warning (as long as there is no argument named 'x') for now, but not in future versions of lattice. * aspect='xy' is now allowed when relation='free' * A new function make.groups (present in S-PLUS) has been added. * there's now panel.rect and lrect (similar to the base function rect) * print.trellis has a 'draw.in' argument that can be used to specify a grid viewport to draw the plot in. * strips can now be drawn on the left (as well as top) of a panel. This is useful for short wide panels, e.g. time series. * 'Date' objects are recognized and axis labels formatted accordingly (not heavily tested) ## Changes in behaviour * qqmath has been considerably revamped, primarily to allow grouped displays (the older implementation would not have allowed that even with a custom panel function). In particular, the (pre)panel function(s) now get the raw data as opposed to already computed quantiles. Some old code may stop working. * as a consequence of the above, panel.qqmath, panel.qqmathline etc have been rewritten and have different argument lists * tmd has been rewritten (mostly to deal with qqmath objects), but this shouldn't be user-visible. * densityplot defaults to showing points with random jitter. * arguments panel.number and panel.counter, passed to panel functions that have those (or the ...) argument(s) have been renamed to 'packet.number' and 'panel.number', which are more in line with standard Trellis jargon. ## Bug fixes * identification of when 'type' should default to "density" was buggy (inapprpriate rounding) # Changes in lattice 0.11 ## Improvements * panel.superpose.2 (which replicates behaviour of panel.superpose in S-PLUS) revamped, with new features to boot. * panel.identify improved * larrows improved, slightly different features. * [xyz]lab in cloud / wireframe can now be grobs, and honors a 'rot' component for rotation (e.g., zlab = list(rot = 90)) ## New features * some finer controls added to parallel (actually panel.parallel) * trellis.last.object(...) now behaves like update(trellis.last.object(), ...)) * "trellis" objects now have a plot method that's essentially an alias to the print method * new function 'current.panel.limits' to retrieve native scales of current panel (only in later versions) ## Changes in behaviour * behaviour of auto.key = TRUE now function specific * auto.key list now allows a 'text' component * defaults of several standard arguments now taken from lattice.options() * type='g' now calls panel.grid(h = -1, v = -1) rather thanjust panel.grid() * NA-handling (may have undesirable effects) ## Bug fixes * several minor fixes # Changes in lattice 0.10 ## Improvements * relation="free" and "sliced" now work for factors (at least, as well as can be expected) * the code that constructs the layout of a lattice plot (in the print method for trellis objects) has been completely rewritten. This is mostly transparent to the user, but as a side effect, it is now possible to control the details of the layout (things like the amount of padding around the plot, the gap between tick marks and labels) via the trellis settings "layout.heights" and "layout.widths". * col.regions and colorkey in levelplot and wireframe now honour settings in effect when the object is printed, and not when the object was created. * xlab, ylab, main and sub can now be grobs * datasets get separate documentation, contributed by Kevin Wright ## New features * lattice.options(), similar to options(), to control various aspects of lattice plots. This is mostly for easier code maintainance, but can be useful for the user too. * API now supports alpha-transparency (actual support is device dependent) where appropriate (some cases might have been missed, and reports of omissions would be appreciated). * API for interacting with and enhancing Trellis plots AFTER they are drawn, based on grid functions seekViewport, grid.locator, etc. See ?trellis.focus * aspect="iso" for `isometric' x- and y-axes. * new 'default.scales' argument to high level functions, useful when writing wrappers * convenience function 'strip.custom' to create strip functions from strip.default just by overriding one or more arguments * type="H" in lplot.xy (for horizontal line). New argument 'horizontal' for panel.xyplot, which affects what happens for various 'type'-s. * type="g" in panel.xyplot, which draws a reference grid * the print method now (optionally) saves the (last) object printed in a non-visible environment. This allows retrieval of the last printed object for 'update'-ing, and more importantly, to retrieve panel specific data for use while interacting with and enhancing plots after they are printed * a summary method for trellis objects (currently pretty basic) ## Changes in behaviour * lset has been deprecated, and trellis.par.set has been enhanced with equivalent usage * the strip function now gets the whole strip area to work with, and is responsible for using it appropriately. strip.default has been updated accordingly * choice of color for grouped barcharts now taken from a new setting parameter 'superpose.fill' and not 'regions' as previously * arguments to panel.levelplot has changed (this is related to how default colors are obtained, as described above). ## Bug fixes * axes now drawn on last panel even if it doesn't fall on the border of the layout * many other miscellaneous fixes, see SvnLog for some details # Changes in lattice 0.9 ## Improvements * Axis labelling code has been rewritten to internally use S3 method dispatch, with (unexported) methods for numeric (default), character (for factors), POSIXct and date. More methods can be considered on request. reversed limits are now allowed. * contourplot can now handle missing rows in the data frame (equivalent to NA's in z). contourplot now uses contourLines(). * cloud and wireframe now use better 3-D projection calculations, and are generally much better than before. wireframe is much faster, and has a better shading algorithm. It can also handle NA's and missing rows. * splom (specifically panel.pairs) has more functionality, including the option of using different panel functions below and above the diagonal, user defined diagonal panels, and a table-like layout (similar to pairs) * font specifications now allow for fontface and fontfamily * much improved update method for trellis objects * setting auto.key = TRUE now computes key at printing time, honouring any changes in trellis settings ## New features * arbitrary reordering of conditioning variables, as well as of levels within a conditioning variable. This works in the update method (as well as high-level plots), making it easy to examine parts of a multipanel trellis display and view it in different conditioning orders. * extended key functionality (via the legend argument) that allows multiple legends and the use of arbitrary grid objects as keys * option to NOT drop unused factor levels when subsetting, by setting drop.unused.levels = FALSE or drop.unused.levels = list(cond = FALSE, data = FALSE) in high-level functions like xyplot. * Ability to attach settings to a trellis object (rather than changing the global settings), via argument par.settings in high level calls. * Wireframe can now draw parametrized 3-D surfaces like spheres (generally of the form f(u,v) = (x(u,v), y(u,v), z(u,v)), for (u,v) in the square [0,1] x [0,1]). * Functionality similar to locator() (possible due to recently added features of grid). All panels should have predictable viewport names, which can be used in seekViewport() to grab a particular viewport. grid.locator() can subsequently be used to locate points in the native coordinate system of that panel. ## Changes in behaviour * allow.multiple now defaults to TRUE (whenever it makes sense), since '+' in a formula is interpreted differently than S-PLUS anyway. As in model formulae, I(x+y) works as expected. * default behaviour of qq and qqmath changed (from S-PLUS behaviour) to match corresponding base functions qqplot and qqnorm ## Bug fixes * Fixed important bug concerning interaction of subscripts and subsets * lots of other fixes, mostly obscure # Changes in lattice 0.8 * Major change is the addition of a NAMESPACE. grid is now not 'require()-d', but imported only. To use grid functions directly in lattice calls (which is a very reasonable thing to do), one needs to explicitly call library(grid). * contourplot() has improved when data has NA's. Still doesn't work when the NA rows are completely omitted (in other words, the full "matrix" has to be specified, even the entries with NA). * Clipping can now be turned off in panels and strips via the trellis.par.get("clip") setting. * See Changelog for other minor changes. # Changes in lattice 0.7 ## Grouping variables * The handling of Grouped displays has been made more consistent (and different from S-Plus). Whenever a groups= argument is specified, it is assumed that the user wants a grouped display and an attempt is made to honour this whenever appropriate (this ultimately depends on the panel function). A non-trivial addition to the list of functions that support this is barchart. * Specification of legend (key) has been made slightly easier in the most common cases. The key is used most often in conjunction with the groups argument, and using the global trellis settings. The simpleKey function (and the auto.key argument to high level functions) uses the global settings to create a key with a not very flexible but simple interface. * Handling of the formula argument has been extended to allow multiple variables on either side of the formula (with allow.multiple = TRUE), e.g., `xyplot(y1 + y2 ~ x, data, allow.m = TRUE)`. These are treated as grouped displays. ## Scales * Some components of scales, namely tck, rot and cex, can now be length 2 vectors, controlling left/bottom and right/top separately. * Some more functions (not all) now handle factors in the formula correctly (i.e., coerce them to numeric when factors are not appropriate, but use levels of the factor for labelling). # Changes in lattice 0.6 ## API change * panel functions: In earlier versions, panel functions and prepanel functions were guaranteed to be passed numeric vectors as x,y (and z) arguments. This is no longer true. All panel functions are now expected to handle other possibilities. This has been done in all the predefined panel functions in lattice (but not in llines, lpoints, etc.). In practice, the only changes required are (unless I have overlooked something) to add calls like ```r x <- as.numeric(x) y <- as.numeric(y) ``` at the beginning. prepanel functions can now return, as their xlim or ylim components, either a numeric vector of length 2 (possibly a DateTime object), or a character vector. The latter implies that the elements of this vector should be the respective axis labels, associated with tick marks at `1:length_of_this_vector`. * high-level functions: The default panel functions of high level functions can now be different, depending on whether a groups argument was passed. In practice, this now happens for xyplot, splom and densityplot. (densityplot has an additional high-level argument specifically for this, called panel.groups, which is passed to the panel function.) This is a convenience feature, (and is inconsistent with S-Plus) in that it presumes that if the user has specified a groups argument, she wants it to be used, where appropriate. * scales: In anticipation of future use (in nlme, for example), the at and labels components of scales can now be a list. Each element corresponds to a panel. This is thoroughly untested and not guaranteed to work. * Some additional API changes associated with cloud and wireframe are discussed below. ## New Features and Fixes * Mathematical Annotation; Following changes in grid 0.7, lattice now supports latex-style labelling using expressions. These can be used in almost all sensible places (an exception being in colorkey axis labels in levelplot/contourplot, and this is not expected to change). * Date-Time Labelling: Axis labelling procedures did not recognize DateTime objects in earlier versions. This has been fixed. The routine currently used is a hack of axis.POSIXt (without the format option), but will hopefully improve in future. ## 3-D functions * The 3-D functions cloud and wireframe have been greatly improved in terms of extensibility. The code is much cleaner, and writing new panel functions are much simpler. Earlier versions had a problem with the default placement of the labels (x/y/z-lab) and scales (arrows/ticks), which has been fixed. [The only major problem that still remains is when, in a perspective plot, the projection of the distant face is fully contained inside the projection of the near face.] * Earlier wireframe code used an unnecessarily large amount of memory. This has been fixed, although speed is still not good (fixes are in the planing stage, and would involve changes in grid). drape=TRUE used to give wrong coloring, which is now fixed. * The 'group' argument now works with wireframe, resulting in multiple surfaces. This is mostly satisfactory, but is not sophisticated enough to render intersecting surfaces properly (might be approximated by a fine enough grid). * There are also some rudimentary lighting options, which can render the surface as being illuminated from a light source. No shadows. (Try shade=TRUE in wireframe.) * Although these changes go a long way towards stabilizing cloud/wireframe, some further changes, especially in how the panel function handles the groups argument, are expected in the future. ## Known bugs * Handling of NA values are often inconsistent and buggy. Some of these are not easily fixable (particularly one in contourplot), but some are, so bug reports on this are still welcome. * Fonts specified in the new R font specification may not work yet. # Changes in lattice 0.5 ## Settings * The biggest change is in the way settings are handled. Settings are now stored in a global list called lattice.theme, and is truly device-specific (i.e., settings for more than one device can be used concurrently). * Improved theme management via lset and show.settings. * Changed defaults for color postscript/pdf. ## New features * bwplot and friends which had to have the grouping factor/shingle on the y-axis, can now have it on the x-axis as well. Far from perfect, though, since long labels can overlap with default settings. * panel.superpose now accepts an additional argument called panel.groups (by default panel.xyplot), which is the panel function actually called for each subset of the data determined by groups. Avoids having to write something as big as panel.superpose for natural generalizations like interaction plots. (Related new panel function: panel.linejoin) * colorkey in levelplot on all sides. Rendering of large key's much much faster (using grid.place suggested by Paul) * Other minor changes (doc, more arguments etc) * Following changes in grid, calls to base R graphics and lattice functions can now be mixed. # Changes in lattice 0.4 ## Overview * Some implementation details have changed substantially. This might cause some old code to fail, though no such instances are known. No significant new features have been added, but there are several bugfixes (notably in levelplot). The important changes are noted below. ## Improvements: * documentation restructured. There is no topic called `trellis.args' any more. The detailed description of the arguments common to all high level trellis functions can be found under help(xyplot) * once trellis.device() is called, Lattice graphics and base R graphics should mix more or less seamlessly. There is an optional argument in trellis.device() that can deal with the first blank page problem, with certain restrictions. * a (as yet very small) demo, called by demo("lattice") * Clipping: whatever is drawn by the panel function is now clipped to inside the panel region. Strip texts are clipped to inside the strips. * Axis tick labels by default do not overlap, some tick marks are left unlabelled if necessary. * The argument list for strip.default changed to be like S * levels() and nlevels() give sensible answers for shingles. new print methods for shingles and levels of shingles * colorkey (currently used only in levelplot) can now be placed to the left, top or bottom as well * new "lines" component in the par.strip.text argument that can be used to change the height of strips * xlab, main etc can be double height strings (containing "\n"-s), the spaces allocated for these would be automatically adjusted * strip.default now has style=5 * new panel.superpose.2 (suggested by Neil Klepeis) * the default colour settings sometimes seem too light on a white background. To deal with this, there is a new setting with some darker colours that can be set by calling lset(theme = "white.bg"). see ?lset for details. This is currently in a proof-of-concept stage (the colors in "white.bg" were chosen just because I liked their names), and suggestions for better color schemes would be most welcome. * show.settings() added # Changes in lattice 0.3 ## Overview * The overall internal structure of the lattice package has changed considerably in verion 0.3, in particular making it far more readable and debuggable. However, this also means that some code which had worked with the earlier version might now fail. (This is just a discalimer, there are no known instances.) ## New Features * (Almost) full support for the `key' argument for drawing legends * Support for log scales * levelplot (but no contourplot. In particular, the contour = T option in levelplot does not work) * tmd now works on the output from qq * panel function names can now be quoted strings * scales and its x and y components can now be just a character string like "free" or "sliced", i.e., the relation tag can be omitted. * extension to the `type' argument in panel.xyplot and panel.superpose to allow stair-like and histogram-like plots (type="s" and "h" in plot), as well as loess smooths (using the loess.smooth function in the modreg package). Also, more than one of these options can now be used concurrently. This allows, for example, a grouped plot where a grouping variable can be used to fit separate loess curves along with the scatter for each group. See example(xyplot) * wrappers around grid functions with API-s of traditional graphics functions to help port existing S-Plus Trellis code. See below for details. * changes in print.trellis to allow mixing of Lattice and usual R graphics. See below for details. ## Porting S-Plus Trellis code to Lattice * One of the basic problems in porting existing Trellis code to R is the unusability of the base R functions like lines and points inside panel functions. To help make the changes more transparently, lattice now includes several wrappers around grid functions that provide an API similar to the corresponding base R functions. The list currently includes lpoints, llines, ltext and lsegments [update: larrows]. ## Using Lattice and base R graphics concurrently * [OBSOLETE] Grid graphics normally do not mix with usual R graphics. However, end-users typically might want to use lattice functions concurrently with traditional R graphics. To allow this without intermittent calls to grid.stop() and grid.start(), print.trellis (which ultimately does all the plotting in lattice) now tries to preserve the state of the device on which it plots. By default, library(lattice) opens a device in grid enabled mode. It can be reverted to non grid mode by grid.stop(). Subsequently, both Lattice functions and traditional graphics functions can be used. Devices opened by trellis.device() start in non-grid mode, unless grid.start() is called. ## Still Missing * [OBSOLETE, except for the parts about piechart and scale] * contourplot, wireframe, cloud (partially implemented) and of course, piechart * Some components of scale (I haven't found a full list, so can't say exactly which are missing) * Fonts * axis labels badly implemented, no checking for overlaps. lattice/inst/0000755000176200001440000000000014773141535012666 5ustar liggesuserslattice/inst/CITATION0000644000176200001440000000050214410543425014010 0ustar liggesusersbibentry(bibtype = "Book", title = "Lattice: Multivariate Data Visualization with R", author = person("Deepayan", "Sarkar"), year = "2008", publisher = "Springer", address = "New York", isbn = "978-0-387-75968-5", url = "http://lmdvr.r-forge.r-project.org") lattice/inst/po/0000755000176200001440000000000013657201524013277 5ustar liggesuserslattice/inst/po/de/0000755000176200001440000000000013070415115013657 5ustar liggesuserslattice/inst/po/de/LC_MESSAGES/0000755000176200001440000000000014772676012015463 5ustar liggesuserslattice/inst/po/de/LC_MESSAGES/R-lattice.mo0000644000176200001440000003351514772676012017653 0ustar liggesusersT` Ua $  2 ** 3U   9 ! " 8 ,Y  > ' 4%<bHbg22!*,2I`&x##-K!c "J(%<b|/,7/d"tUU#58M( $#$6Ax+E44@i %0+ BPi1|$:7,F)s&H1/z 6%2^X   @8X?%VLN+$ m=j, "C /f - < !!!B7!-z!$!&!8!-"AH"6"6"?"#8#%\# #T#{#)t$$;$;$4%T%V%-^%-%+%-%1&F&M&T&&[&/&&&&&"' 3'%?'e''u' (/!(Q(o( (((8( )-)GL),)3))*3*x*J+/d+ +++P+J#,n,4v,,,1,4,'0-@X-----6.H9.?.L. //-"/BP//////;0'V0F~0R0=1AV11 1.1!1+2(?2Ph2@22 3"393=Y383o3@4 G4U4u44,44D4XB5+5i5g1676!66% 7174;^eOX3~).{lV+$| I:f&D[9=x/QB8Zti #H!oy10LbnaW5k\-CTPRqw,dMrSc>z }*JY" 2hg`uFU@Em]7_6v(N<A?' G sp%Kj%s must be length 1 or a vector of length multiple of group length (%d)'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''aspect="iso"' approximate since 'relation="free"''at' missing or incompatible with 'labels''at' values are not equispaced; output may be wrong'bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'formula' must be a formula object'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first'type' has unsupported values'varnames' has wrong length.'x' values are not equispaced; output may be wrong'y' values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid or ambiguous component names:Invalid value of 'aspect'Invalid value of 'log'Invalid value of 'perm.cond'Invalid value of 'pos' ignored.Invalid value of 'tri.upper/tri.lower' ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.Multiple matches to component nameNo panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested 'trellis' object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of 'aspect': '%s'You have to first select a panel using trellis.focus()bad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddevice does not support raster images with NA, ignoring 'raster=TRUE'device has no raster support, ignoring 'raster=TRUE'device support for raster images unknown, ignoring 'raster=TRUE'differenceerrorexplicit 'data' specification ignoredfirst component of text must be vector of labelsimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listkey specifies 'labels$labels' but not 'labels$at'layout must have at least 2 elementslength of '%s' must be 1 or multiple of group length (%d)lengths of key's 'labels$labels' and 'labels$at' differlimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnsonly using the first two of %d regression coefficientspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrange too small for min.nrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthspecifying 'labels' but not 'at' may lead to unexpected resultssupplied 'dimnames' have wrong lengththe 'at' and 'labels' components of 'scales' may not be lists when 'relation = "same"'the at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: R 4.5.0 Report-Msgid-Bugs-To: bugs.r-project.org PO-Revision-Date: 2025-03-18 11:16+0100 Last-Translator: Detlef Steuer Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s muss von Länge 1 sein oder ein Vektor mit einer vielfachen Länge der Gruppenlänge (%d)'a' und 'b' wurden mit 'coef' überschrieben'a' wurde mit 'reg' überschrieben'aspect="iso"' ungefähr seit 'relation="free"''at' fehlt oder ist inkompatibel mit 'labels''at' Werte sind nicht äquidistant; Ausgabe kann falsch sein'bandwidth' muss numerisch sein'drop=TRUE' ignoriert'expr' muss eine Funktion oder ein Ausdruck sein, der 'x' enthält'f.value' nicht unterstützt. Wird ignoriert.'formula' muss ein Formelobjekt sein'lattice.options' muss eine Liste sein'length' und 'prop' können nicht beide angegeben werden'length' muss positiv sein'multiple=TRUE' ignoriert ('groups' nicht Null mit 'outer=FALSE')'nbin' muss numerisch und von der Länge 1 oder 2 sein'nrpoints' sollte numerisch skalar mit Wert >= 0 sein.'origin' wurde für gestapelte Balken zwangsweise auf 0 gesetzt'par.settings' muss eine Liste sein'par.strip.text' muss eine Liste sein'plot.args' muss eine Liste sein'trellis.device' wurde geändert, 'bg' tut möglicherweise nicht das, was Sie denken'trellis.switchFocus' kann nicht benutzt werden, um auf einen anderen 'prefix' zu schalten. Zuerst 'trellis.focus' benutzen'type' enthält nicht unterstützte Werte'varnames' hat falsche Länge'x' Werte sind nicht äquidistant; Ausgabe kann falsch sein'y' Werte sind nicht äquidistant; Ausgabe kann falsch sein(lud den KernSmooth-Namensraum),Aufruf:X-Achse kann keine logarithmische Skala habenY-Achse kann keine logarithmische Skala habenZum Fokussieren auf das Bedienfeld klicken.Klicken Sie einen Punkt, um ihn hervorzuhebenGerätefunktion '%s' konnte nicht gefunden werdenAnzahlDaten:DichteFehler beim Benutzen des Paketes %g %sAusdrücklich angegebene Begrenzungen ignoriertAngepasste Werte abzüglich Mittelwertunzulässiger Wert für layoutUnangemessene ArgumenteUnangemessener Wert von 'as.table'Intervalle:Falscher 'shrink'-Parameter ignoriertUngültiges 'theme' angegebenFalsche IndizesUngültiger Schlüssel. Es wird mindestens eine Komponente mit Namen 'lines', 'text', 'rect' oder 'points' benötigt.Ungültiger label.styleUnzulässige oder zweideutige Komponentennamen:Ungültiger Wert von 'aspect'Ungültiger Wert von 'log'Ungültiger Wert von 'perm.cond'Unzulässiger Wert für 'pos' ignoriert.Unzulässiger Wert für 'tri.upper/tri.lower' ignoriert.Ungültiger Wert von index.condUngültiger Wert von perm.condLängenprüfung stimmt nicht überein. Sie haben einen Fehler gefunden!Mehr Seiten im Layout als anscheinend nötigMehrere Übereinstimmungen mit dem KomponentennamenKeine Bedienfelder verfügbarNicht übereinstimmende LängenAnmerkung: 'auto.key' ignoriert, da Beschriftung bereits vorhanden. Benutzen Sie 'update(..., legend = NULL)', um existierende Beschriftung(en) zu entfernen.Anmerkung: Das Standardgerät wurde geöffnet, um zu versuchen, das Verändern von Trellis-Einstellungen zu akzeptieren.Anzahl der Beobachtungen:Überlappung zwischen benachbarten Intervallen:BedienfeldPlot paralleler KoordinatenProzent der GesamtheitPlot-Objekt wurde nicht gespeichert. Panel Daten können nicht abgefragt werden.Plot umfasst mehrere Seiten. Nur die letzte Seite kann aktualisiert werdenBereichAngefordertes Trellis-Objekt wurde nicht gespeichertResiduenStreudiagramm-MatrixBedienfeld an Position (%g, %g) wird ausgewählt.Entschuldigung. align=FALSE wird nicht unterstützt.Nicht erkannter Wert von 'aspect': '%s'Sie müssen zuerst ein Panel mittels trellis.focus() auswählen.falscher Wert von 'intervals'Y-Achse kann keine logarithmische Skala habenSpalte muss angegeben werdenKomponente '%s' doppelt in Schlüssel und BeschriftungGerät unterstützt keine Rastergrafiken mit NA, ignoriere 'raster=TRUE'Gerät unterstützt keine Rastergrafik, ignoriere 'raster=TRUE'Geräteunterstützung für Rastergrafiken unbekannt, ignoriere 'raster=TRUE'UnterschiedFehlerausdrückliche 'data'-Spezifikation ignorierterste Komponente des Textes muss ein Vektor aus Bezeichnungen seinungeeignete Länge von 'lim'ungültige Dimension '%s'ungültiges Modellungültiger Wert für LayoutSchlüssel muss eine Liste seinDer Key spezifiziert 'labels$labels' aber nicht 'labels$at'Layout muss mindestens 2 Elemente habenLänge von '%s' muss 1 sein oder ein Vielfaches der Gruppenlänge (%d)Die Längen von 'labels$labels' und 'labels$at' des Schlüssels unterscheiden sichBegrenzungen können keine Liste sein, wenn 'relation = same'logarithmische Skalen können nicht per 'update' geändert werdenmissgestalteter FarbschlüsselMittelwertfehlende Übereinstimmung in Anzahl der PaketeModell muss ein Formelobjekt seinnächstliegende Beobachtung bereits erkanntmindestens ein Bedienfeld wird benötigtnewFactor != NULL && groups == NULL gilt nicht. Sie haben einen Fehler gefunden!newFactor kann nicht NULL sein. Sie haben einen Fehler gefunden!keine Intervallekeine Beobachtungen inkeine Punkte innerhalbnicht genug Zeilen für Spaltenbenutze nur die ersten beiden von %d RegressionskoeffizientenPosition des Bedienfeldes nicht angegeben oder ungültigpanel.smoothScatter() benötigt das KernSmooth-Paket, aber der KernSmooth-Namensraum kann nicht geladen werden.PunkteAnklickpunkteProblem mit 'hist'-BerechnungenSpannweite zu klein für min.nZeile muss angegeben werdenKacheln können nicht zusammengefügt werden'skip' kann nicht nur TRUE seineinige Bestandteile der angegebenen 'dimnames' haben falsche LängenSpezifizieren von 'labels', aber nicht von 'at' kann zu unerwarteten Ergebnissen führenangegebene 'dimnames' haben falsche Längendie 'at'- und 'labels'-Komponenten der Skalen sind möglicherweise keine Listen, wenn 'relation = "same"'die 'at'- und 'labels'-Komponenten der Skalen sind möglicherweise keine Listen, wenn 'relation = same'type='%s' kann in diesem Zusammenhang irreführend seinx muss (zwingend) ein Faktor seinx muss eine Kachel seinx muss eine Matrix mit 2 Spalten seiny muss genau 2 Stufen habenlattice/inst/po/pl/0000755000176200001440000000000013070415115013702 5ustar liggesuserslattice/inst/po/pl/LC_MESSAGES/0000755000176200001440000000000013657201524015477 5ustar liggesuserslattice/inst/po/pl/LC_MESSAGES/R-lattice.mo0000644000176200001440000003207414024041344017655 0ustar liggesusers $  2 *D 3o   9 ! / ,P } > ' 4 %3 Y w  H b ^|22!!#)@W&o## $B!Z |"J%3Ys/,./["tUL#58D}( $#$68o+E4+@` %0 " 9G`$s,)%&DkH/   1%M^s  $ :[8s%VL)+v$' 48S&P ";C)+<# C6 -z > 9 (!!*J!%u!L!!%h"0"M"M #3[## #'#'###1$-C$ q${$ $%$.$$$#%*% @% a%1m%%%f%#9&3]&&&!&1&A '"b'!';'9'+(I(a(v(e)k)7~))&))B)X8**0***%*.+&@+:g++'++7 ,WA,A,X, 4->--E--s-&----.+1.6].@.$..!/!%/0G/%x/H/?/'090T0m0:0u0<1E1Z1"x1111 1P 21^2[2[20H3?y3/3.3#4C6FS#la .e/3j<Bw8"_Y} %X'79^L=@:(cn*fDJ-?$rGP>AvMt 1E&px]iNTKk+m,ozUq0~h2uR`Hd; y I4{[s!|W\OZ5g )QbV'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''aspect="iso"' approximate since 'relation="free"''at' missing or incompatible with 'labels''at' values are not equispaced; output may be wrong'bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first'type' has unsupported values'varnames' has wrong length.'x' values are not equispaced; output may be wrong'y' values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid or ambiguous component names:Invalid value of 'aspect'Invalid value of 'log'Invalid value of 'perm.cond'Invalid value of 'pos' ignored.Invalid value of 'tri.upper/tri.lower' ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.Multiple matches to component nameNo panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested 'trellis' object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of 'aspect': '%s'You have to first select a panel using trellis.focus()bad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddevice does not support raster images with NA, ignoring 'raster=TRUE'device has no raster support, ignoring 'raster=TRUE'device support for raster images unknown, ignoring 'raster=TRUE'differenceerrorexplicit 'data' specification ignoredfirst component of text must be vector of labelsimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listlayout must have at least 2 elementslimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrange too small for min.nrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthsupplied 'dimnames' have wrong lengththe 'at' and 'labels' components of 'scales' may not be lists when 'relation = "same"'the at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: lattice 0.20-27 Report-Msgid-Bugs-To: bugs.r-project.org PO-Revision-Date: 2014-03-25 21:26+0100 Last-Translator: Łukasz Daniel Language-Team: Łukasz Daniel Language: pl_PL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); X-Poedit-SourceCharset: iso-8859-1 X-Generator: Poedit 1.5.4 'a' oraz 'b' są nadpisane przez 'coef''a' jest nadpisane przez 'reg'przybliżenie 'aspect="iso"' ponieważ 'relation="free"'brakuje 'at' lub niespójne z 'labels'wartości 'at' nie są równomiernie rozmieszczone; wyjście może być błędne'bandwidth' musi być liczbą'drop=TRUE' zostało zignorowane'expr' musi być funkcją lub wyrażeniem zawierającym 'x''f.value' nie jest wspierane; ignorowanieargument 'lattice.options' musi być listą'length' oraz 'prop' nie mogą być jednocześnie określoneargument 'length' musi być dodatnizignorowano 'multiple=TRUE' ('groups' są niepuste z 'outer=FALSE')'nbin' musi być liczbą o długości 1 lub 2'nrpoints' powinno być skalarem liczbowym z wartością >= 0.'origin' wymuszone aby być zerem dla ułożonych paskówargument 'par.settings' musi być listąargument 'par.strip.text' musi być listąargument 'plot.args' musi być listą'trellis.device' zmienił się, 'bg' może nie robić tego co ci się wydaje'trellis.switchFocus' nie może być użyte aby przełączyć się na inną wartość 'prefix'. Użyj najpierw 'trellis.focus''type' posiada niewspierane wartościargument 'varnames' posiada błędną długośćwartości 'x' nie są równomiernie rozłożone; wyjście może być błędnewartości 'y' nie są równomiernie rozłożone; wyjście może być błędne(załadowano przestrzeń nazw pakietu 'KernSmooth'),Wywołanie:Nie można mieć logarytmicznej skali XNie można mieć logarytmicznej skali YKliknij na panel aby go sfokusowaćKliknij aby wybrać jeden punkt do podświetleniaNie można znaleźć funkcji '%s' urządzeniaZliczeniaDane:GęstośćBłąd podczas używania paczki %g %sJawnie określone granice zostały zignorowaneDopasowanie wartości minus średniaNiedopuszczalna wartość 'layout'.Niepoprawne argumentyNiepoprawna wartość 'as.table'Interwały:Niepoprawny parametr 'shrink' został zignorowanyokreślono niepoprawne 'theme'niepoprawne indeksyNiepoprawny klucz, potrzeba co najmniej jeden komponent z nazwany 'lines', 'text', 'rect' lub 'points'niepoprawna wartość 'label.style'Niepoprawne lub niejednoznacznie nazwy komponentówniepoprawna wartość 'aspect'niepoprawna wartość 'log'Niepoprawna wartość 'perm.cond'Niepoprawna wartość 'pos' została zignorowana.Niepoprawna wartość 'tri.upper/tri.lower' została zignorowana.Niepoprawna wartość 'index.cond'Niepoprawna wartość 'perm.cond'Sprawdzenie długości nie zgadza się; znalazłeś błąd!Więcej stron na ekranie niż wydaje się być konieczne.Wielokrotne dopasowania do nazwy komponentuBrak dostępnych paneliNiezgodne długościUwaga: 'auto.key' zostało zignorowane ponieważ legenda jest już obecna. Użyj 'update(..., legend = NULL)' aby usunąć istniejące legendyUwaga: Domyślne urządzenie zostało otwarte aby umożliwić próbę modyfikacji ustawień 'trellis'Liczba obserwacji:Pokrywanie się pomiędzy sąsiadującymi interwałami:PanelWykres równoległych współrzędnychProcent całościWykres nie został zapisany, nie można przywrócić danych paneluWykres rozciąga się na wiele stron, tylko ostatnia strona może zostać zaktualizowanaZakresZażądany obiekt 'trellis' nie został zapisanyResztyMacierzowy wykres punktowyWybieranie panelu na pozycji (%g, %g)Przykro mi, 'allign = FALSE' nie jest wpieranenierozpoznana wartość 'aspect': '%s'Musisz najpierw wybrać panel używając 'trellis.focus()'błędna wartość 'intervals'nie można mieć logarytmicznej skali Ykolumna musi zostać określonakomponent '%s' jest powtórzony w kluczu oraz legendzieurządzenie nie wspiera obrazów rastrowych z wartością NA, ignorowanie 'raster=TRUE'urządzenie nie ma wsparcia rastrowego, ignorowanie 'raster=TRUE'wspomaganie sprzętowe dla obrazów rastrowych nie jest znane, ignorowanie 'raster=TRUE'różnicabłądjawne określenie 'data' zostało zignorowanepierwszy komponent musi być wektorem etykietniepoprawna długość argumentu 'lim'niepoprawny wymiar '%s'niepoprawny modelniepoprawna wartość 'layout'argument 'key' musi być listą'layout' musi mieć przynajmniej 2 elementy'limits' nie mogą być listą gdy 'relation = "same"'skale logarytmiczne nie mogą zostać zmienione poprzez 'update'niepoprawnie sformatowane 'colorkey'średnianiezgodność w liczbie pakietówmodel musi być obiektem formułynajbliższa obserwacja jest już zidentyfikowanaco najmniej jeden panel jest wymaganynewFactor != NULL && groups == NULL nie trzyma się; znalazłeś błąd!'newFactor' nie może mieć wartości NULL; znalazłeś błąd!brak interwałówbrak obserwacji w zasięgubrak punktów z pośródzbyt mało wierszy dla kolumnpołożenie panelu jest nieokreślone lub jest niepoprawne'panel.smoothScatter()' wymaga pakietu 'KernSmooth', ale nie można załadować przestrzeni nazw pakietu 'KernSmooth'punktówpunktów kliknięciaproblem z obliczeniami 'hist'zakres dla 'min.n' jest zbyt maływiersz musi zostać określonyobiekty klasy "shingle" nie mogą być przycięte'skip' nie może całe być TRUEniektóre komponenty dostarczonego 'dimnames' posiadają niepoprawną długośćdostarczone 'dimnames' ma niepoprawną długośćkomponenty, 'at' oraz 'labels', dla 'scales' nie mogą być listami gdy 'relation = "same"'komponenty, 'at' oraz 'labels', dla 'scales' nie mogą być listami gdy 'relation = "same"''type = %s' może być mylące w tym kontekście'x' musi być czynnikiem (musi być przekształcalne w czynnik)argument 'x' musi być obiektem klasy "shingle"argument 'x' musi być macierzą z 2 kolumnami'y' musi mieć dokładnie 2 poziomylattice/inst/po/fr/0000755000176200001440000000000013070415115013676 5ustar liggesuserslattice/inst/po/fr/LC_MESSAGES/0000755000176200001440000000000014131537416015473 5ustar liggesuserslattice/inst/po/fr/LC_MESSAGES/R-lattice.mo0000644000176200001440000003242114131537416017656 0ustar liggesusers$, $  2! *T 3   9 ! ? ,`  > ' 4 %C i   H b n22!139Pg&##4R!j "J/%Ci/#,>/k"tU\# 58T( $#$#6H+E4;@p %02 IWp$,)5&T{H/ 0A6]%^  0Qk 8%VLp+$"B_45:+pM! >$)c&>F :V 2 ; #!%$! J!Gk!!44"%i"Q"Q"#3#W#Y#a#0#+#:#8$Q$ `$k$,t$:$"$$%1% Q%(_%%%\%&*-&X&x& &'&7&!' 8'WY'C'6',(E(](v(o)&))%))])RO**2***-+,1+$^+H+ ++ ,8+,ed,N,d- ~--+-E-..8.H.h.).>.O.J1o112 2!12S26o282D2/$3fT3d3- 4PN4$4(4#4C6FS#la .e/3j<Bx8"_Y~ %X'79^Lo=@:(cn*fDJ-?$sGP>AwMu 1E&qy]iNTKk+m,p{Ur0h2vR`Hd; z I4|[t!}W\OZ5g )QbV'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''aspect="iso"' approximate since 'relation="free"''at' missing or incompatible with 'labels''at' values are not equispaced; output may be wrong'bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first'type' has unsupported values'varnames' has wrong length.'x' values are not equispaced; output may be wrong'y' values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid or ambiguous component names:Invalid value of 'aspect'Invalid value of 'log'Invalid value of 'perm.cond'Invalid value of 'pos' ignored.Invalid value of 'tri.upper/tri.lower' ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.Multiple matches to component nameNo panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested 'trellis' object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of 'aspect': '%s'You have to first select a panel using trellis.focus()bad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddevice does not support raster images with NA, ignoring 'raster=TRUE'device has no raster support, ignoring 'raster=TRUE'device support for raster images unknown, ignoring 'raster=TRUE'differenceerrorexplicit 'data' specification ignoredfirst component of text must be vector of labelsimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listlayout must have at least 2 elementslimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnsonly using the first two of %d regression coefficientspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrange too small for min.nrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthsupplied 'dimnames' have wrong lengththe 'at' and 'labels' components of 'scales' may not be lists when 'relation = "same"'the at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: lattice 0.13-1 Report-Msgid-Bugs-To: bugs.r-project.org PO-Revision-Date: 2021-02-06 16:15+0100 Last-Translator: Philippe Grosjean Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); X-Generator: Poedit 2.4.2 'a' et 'b' sont remplacés par les valeurs de 'coef''a' est remplacé par 'reg''aspect="iso"' approximatif lorsque 'relation="free"''at' manquant ou incompatible avec 'labels'les valeurs 'at' ne sont pas équidistantes ; le résultat peut être erroné'bandwidth' doit être numérique'drop=TRUE' est ignoré'expr' doit être une fonction ou une expression contenant 'x''f.value' non supporté ; valeur ignorée'lattice.options' doit être une liste'length' et 'prop' ne peuvent être spécifiés simultanément'length' doit être positif'multiple = TRUE' est ignoré ('groups' non nuls avec 'outer = FALSE')'nbin' doit être un vecteur numérique de longueur 1 ou 2'nrpoints' doit être un scalaire numérique >= 0.'origin' forcé à 0 pour les diagrammes en barre empilées'par.settings' doit être une liste'par.strip.text' doit être une liste'plot.args' doit être une liste'trellis.device' a changé, 'bg' peut ne plus faire ce que vous pensiez'trellis.switchFocus' ne peut être utilisé pour basculer vers un 'prefix' différent. Utilisez 'trellis.focus' en premier lieuargument 'type' contient des valeurs non autorisées'varnames' a une longueur incorrecte.les valeurs de 'x' ne sont pas équidistantes ; le résultat peut être incorrectles valeurs de 'y' ne sont pas équidistantes ; le résultat peut être incorrect(espace de noms KernSmooth chargé),Appel :Axe X logarithmique impossibleL'axe Y ne peut avoir une échelle logarithmiqueCliquez sur un panneau pour le rendre actifCliquez pour sélectionner un point à mettre en évidenceImpossible de trouver la fonction du périphérique '%s'DénombrementsDonnées :DensitéErreur lors de l'utilisation du paquet %g %sLes limites spécifiées explicitement ont été ignoréesValeurs ajustées moins la moyenneValeur erronée pour layout.Arguments inadaptésValeur de 'as.table' incorrecteIntervalles :Paramètre 'shrink' incorrect et ignoré'theme' spécifié incorrectIndices incorrects'key' incorrecte, besoin d'une composante au moins parmi 'lines', 'text', 'rect' ou 'points''label.style' incorrectNoms de composants incorrects ou ambigus :Valeur incorrecte pour 'aspect'Valeur incorrecte pour 'log'Valeur de 'perm.cond' incorrecteValeur de 'pos' incorrecte et ignorée.Valeur de 'tri.upper/tri.lower' incorrecte et ignorée.Valeur de 'index.cond' incorrecteValeur de 'perm.cond' incorrecteIncohérence lors de la vérification de la longueur ; vous avez trouvé une anomalie !La mise en page contient plus de pages qu'il ne semble nécessaire.Correspondances multiples pour les noms des composantsAucun panneau disponibleLongueurs incohérentesRemarque : 'auto.key' est ignoré car une légende est déjà présente. Utilisez 'update(…, legend = NULL)' pour retirer le(s) légende(s) existante(s)Remarque : le périphérique par défaut a été ouvert pour permettre de modifier les paramètres d'un graphe trellisNombre d'observations :Superposition d'intervalles contigus :PanneauGraphique en coordonnées parallèlesPourcentage du totalLe graphe actuel n'a pas été sauvegardé, impossible de restaurer les données des panneauxLe graphe s'étend sur plusieurs pages, seule la dernière peut être mise à jourÉtendueL'objet 'trellis' requis n'a pas été sauvegardéRésidusMatrice de nuages de pointsSélection du panneau à la position (%g, %g)Désolé, 'align=FALSE' n'est pas disponibleValeur inconnue pour 'aspect' : '%s'Vous devez d'abord sélectionner un panneau à l'aide de trellis.focus()mauvaise valeur pour 'intervals'axe Y logarithmique impossible'column' doit être spécifiéla composante '%s' est redondante dans 'key' et 'legend'le périphérique ne supporte pas les images raster qui contiennent des NA, 'raster=TRUE' est ignoréle périphérique ne supporte pas les images raster, 'raster=TRUE' est ignoréimpossible de déterminer si le périphérique supporte les images raster, 'raster=TRUE' est ignorédifférenceerreurspécification explicite de 'data' ignoréela première composante de 'text' doit être un vecteur d'étiquettestaille incorrecte de 'lim'dimension '%s' incorrectemodel incorrectvaleur incorrecte pour 'layout''key' doit être une liste'layout' doit avoir au moins 2 éléments'limits' ne peut pas être une liste lorsque 'relation = same'l'échelle des axes logarithmiques ne peut être modifiée à l'aide d''update''colorkey' inadéquatmoyenneincohérence dans le nombre de paquetsl'argument 'model' doit être un objet formulele point le plus proche est déjà identifiébesoin d'au moins un panneau'newFactor != NULL && groups == NULL' est impossible ; vous trouvé une anomalie !'newFactor' ne peut être NULL ; vous avez trouvé une anomalie !pas d'intervallesaucune observation dansaucun point danstrop peu de lignes pour le nombre de colonnesutilisation seulement des deux premiers coefficients de régression parmi les %dla position du panneau n'est pas spécifiée ou est incorrectepanel.smoothScatter() nécessite le paquet KernSmooth, mais impossible de charger l'espace de noms de ce paquetpointspoints cliquéscalcul d'histogramme défectueuxétendue trop étroite pour min.n'row' doit être spécifiéles lattes ('shingles') ne peuvent être concaténéesles valeurs de 'skip' ne peuvent pas toutes être 'TRUE'certains composants du 'dimnames' fourni sont de longueur incorrectele 'dimnames' fourni est de longueur incorrecteles composantes 'at' et 'labels' de 'scales' ne peuvent pas être des listes quand 'relation = "same"'les composantes d'échelles 'at' et 'labels' ne peuvent pas être des listes quand 'relation = same'type='%s' peut être ambigü dans ce contexte'x' doit être un facteur (ou doit être convertible automatiquement en facteur)'x' soit être une latte ('shingle')'x' doit être une matrice à 2 colonnes'y' doit avoir exactement 2 niveauxlattice/inst/po/it/0000755000176200001440000000000013657201524013713 5ustar liggesuserslattice/inst/po/it/LC_MESSAGES/0000755000176200001440000000000013657201524015500 5ustar liggesuserslattice/inst/po/it/LC_MESSAGES/R-lattice.mo0000644000176200001440000002316514024041344017657 0ustar liggesusersh\$2 *< g  9 ! , A >[ ' 4 %  ; [ Hv  !    3 &K #r     #   ! : "E h  J    (D,_tU*# $$5Zs+ %  7E^$q,)#&BiH/ /%K^q  ?8W%L+$/Thx"A3Z*>"-&P9w?-@<-}#% Md" """/9J), "# F(R{a% CdAo)/Yb +) "5 !X 6z  -  !)!;8'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''aspect="iso"' approximate since 'relation="free"''at' missing or incompatible with 'labels''bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'type' has unsupported values(loaded the KernSmooth namespace)Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid value of 'aspect'Invalid value of 'perm.cond'Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!No panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalRangeResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Unrecognized value of 'aspect': '%s'bad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddifferenceerrorexplicit 'data' specification ignoredimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listlayout must have at least 2 elementslimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthsupplied 'dimnames' have wrong lengththe at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: R-lattice Report-Msgid-Bugs-To: bugs.r-project.org PO-Revision-Date: Last-Translator: Daniele Medri Language-Team: Italian https://github.com/dmedri/R-italian-lang Language: it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Poedit 2.2.1 'a' e 'b' sono annullati da 'coef''a' è annullato da'reg''aspect="iso"' approssimativo con 'relation="free"''at' mancante o incompatibile con 'labels''bandwidth' dev'essere numerico'drop=TRUE' ignorato'expr' dev'essere una funzione o un'espressione contenente 'x''f.value' non supportato; ignorato'lattice.options' dev'essere una lista'length' e 'prop' non possono essere entrambi specificati'length' dev'essere positivo'multiple=TRUE' ignorato ('groups' non nulli con 'outer=FALSE')'nbin' dev'essere numerico di lunghezza 1 o 2'nrpoints' dovrebbe essere uno scalare numerico con valore >= 0.'origin' forzato a 0 per le barre sovrapposte'par.settings' dev'essere una lista'par.strip.text' dev'essere una lista'plot.args' dev'essere una lista'trellis.device' è cambiato, 'bg' potrebbe non fare quello che pensi che sia'type' ha valori non supportati(caricato il namespace KernSmooth)Chiamata:Non è possibile avere log X-scaleNon è possibile avere log Y-scaleFai clic sul pannello per il focusFate clic per scegliere un punto da evidenziareNon è possibile trovare la funzione del dispositivo '%s'ContaDati:DensitàErrore durante l'utilizzo di packet %g %sIgnorati i limiti specificati esplicitamenteValori adattati meno mediaArgomenti inappropriatiValori inappropriati di 'as.table'Intervalli:Ignorati i parametri 'shrink' non validiSpecificato 'theme' non validoIndici non validiChiave non valida, è necessario almeno un componente denominato linee, testo, rettangolo o puntilabel.style non validoValore di 'aspect' non validoValore di 'perm.cond' non validoValore di index.cond non validoValore perm.cond non validoIl controllo delle lunghezze non corrisponde; hai trovato un bug!Nessun pannello disponibileLunghezze non corrispondentiNota: 'auto.key' è ignorato poiché la legenda è già presente. Utilizza 'update (..., legend = NULL)' per rimuovere le legende esistentiNota: Il dispositivo predefinito è stato aperto per onorare il tentativo di modificare le impostazioni trellisNumero di osservazioni:Sovrapposizione tra intervalli adiacenti:PannelloPlot delle Coordinate ParallelePercentuale sul totaleIntervalloResiduiMatrice Scatter PlotSelezione del pannello in posizione (%g,%g)Valore di 'aspect' non riconosciuto: '%s'valore errato per 'intervals'non è possibile avere log y-scalela colonna dev'essere specificatacomponente '%s' duplicata nella chiave e nella legendadifferenzaerroreignorata l'esplicita specificazione di 'data'lunghezza di 'lim' impropriadimensione '%s' non validamodello non validovalore non valido per il layoutkey dev'essere una listail layout deve avere almeno 2 elementii limiti non possono essere una lista quando relation = samele scale log non possono essere cambiate con 'update'colorkey malformatomediamancata corrispondenza nel numero di pacchettiil modello dev'essere un oggetto formulal'osservazione più vicina è già identificatarichiede almeno un pannellonewFactor != NULL && groups == NULL non regge; hai trovato un bug!newFactor non può essere NULL; hai trovato un bug!nessun intervallonessuna osservazione all'internonessun punto all'internonon ci sono abbastanza righe per colonneposizione del pannello non specificata o non validapanel.smoothScatter() richiede il pacchetto KernSmooth, ma non possibile caricarne il namespacepuntipunti di clicproblema con le computazioni di 'hist'la riga dev'essere specificatashingle non concatenabilii salti non possono essere tutti TRUEalcune componenti del 'dimnames' passato hanno lunghezze sbagliateil 'dimnames' passato ha lunghezze sbagliatei componenti di scala 'at' e 'labels' potrebbero non essere liste con relation = sametype = '%s' può essere fuorviante in questo contestox dev'essere (coercibile per essere) un fattorex dev'essere un shinglex dev'essere una matrice con 2 colonney deve avere esattamente 2 livellilattice/inst/po/en@quot/0000755000176200001440000000000013070415115014702 5ustar liggesuserslattice/inst/po/en@quot/LC_MESSAGES/0000755000176200001440000000000014772676012016506 5ustar liggesuserslattice/inst/po/en@quot/LC_MESSAGES/R-lattice.mo0000644000176200001440000003174314772676012020677 0ustar liggesusers\p Uq $  2 *: 3e   9 ! "% H ,i  > ' 4%LrHbw22!:<BYp&##$=[!s "J8%Lr/,,G/t"tUe#5'8]( $#$,6Q7+ E64|@ %0)Zs 1$:7V,)&:aHy/ '6C%z^ 7Q g8?%V?L+$4HhU0"" :E 2 7   !A#!%e!&!$!4! "J*"+u"8")"!##&#J#Pi#n#!)$ K$6l$6$!$$$%%2%&J%'q%%%%%#%%&!&%9& _&&j&&&J& '%'D'b' }'#'3''(,-(/Z("(((|(US))#)))*5*8K**,* **$*#*,+6K+;++++/ ,I<,8,D, --)-0?-p-- ---9-$.>A.?.,.-././3/Q/&p//H/// (050L0]06y0%0^051<1$L1q11 11<1G2)_2f2L2/=3$m33334;_fOY3).|mW+$} I:g&D\9=n/QB8[uj #H!pz10LcobX5l]-CUPSrx,eMsTd>{ ~*JZ" 2iyhavFV@ER^7`6w(N<A?' G tq%Kk%s must be length 1 or a vector of length multiple of group length (%d)'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''aspect="iso"' approximate since 'relation="free"''at' missing or incompatible with 'labels''at' values are not equispaced; output may be wrong'bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'formula' must be a formula object'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first'type' has unsupported values'varnames' has wrong length.'x' values are not equispaced; output may be wrong'y' values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid or ambiguous component names:Invalid value of 'aspect'Invalid value of 'log'Invalid value of 'perm.cond'Invalid value of 'pos' ignored.Invalid value of 'tri.upper/tri.lower' ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.Multiple matches to component nameNo panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested 'trellis' object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of 'aspect': '%s'You have to first select a panel using trellis.focus()a formula must be specified for the 'data.frame' methodbad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddevice does not support raster images with NA, ignoring 'raster=TRUE'device has no raster support, ignoring 'raster=TRUE'device support for raster images unknown, ignoring 'raster=TRUE'differenceerrorexplicit 'data' specification ignoredfirst component of text must be vector of labelsimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listkey specifies 'labels$labels' but not 'labels$at'layout must have at least 2 elementslength of '%s' must be 1 or multiple of group length (%d)lengths of key's 'labels$labels' and 'labels$at' differlimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnsonly using the first two of %d regression coefficientspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrange too small for min.nrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthspecifying 'labels' but not 'at' may lead to unexpected resultssupplied 'dimnames' have wrong lengththe 'at' and 'labels' components of 'scales' may not be lists when 'relation = "same"'the at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: lattice 0.22-7 PO-Revision-Date: 2025-03-31 17:47 Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s must be length 1 or a vector of length multiple of group length (%d)‘a’ and ‘b’ are overridden by ‘coef’‘a’ is overridden by ‘reg’‘aspect="iso"’ approximate since ‘relation="free"’‘at’ missing or incompatible with ‘labels’‘at’ values are not equispaced; output may be wrong‘bandwidth’ must be numeric‘drop=TRUE’ ignored‘expr’ must be a function or an expression containing ‘x’‘f.value’ not supported; ignoring‘formula’ must be a formula object‘lattice.options’ must be a list‘length’ and ‘prop’ cannot both be specified‘length’ must be positive‘multiple=TRUE’ ignored (‘groups’ non-null with ‘outer=FALSE’)‘nbin’ must be numeric of length 1 or 2‘nrpoints’ should be numeric scalar with value >= 0.‘origin’ forced to 0 for stacked bars‘par.settings’ must be a list‘par.strip.text’ must be a list‘plot.args’ must be a list‘trellis.device’ has changed, ‘bg’ may not be doing what you think it is‘trellis.switchFocus’ cannot be used to switch to a different ‘prefix’. Use ‘trellis.focus’ first‘type’ has unsupported values‘varnames’ has wrong length.‘x’ values are not equispaced; output may be wrong‘y’ values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function ‘%s’CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of ‘as.table’Intervals:Invalid ‘shrink’ parameter ignoredInvalid ‘theme’ specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid or ambiguous component names:Invalid value of ‘aspect’Invalid value of ‘log’Invalid value of ‘perm.cond’Invalid value of ‘pos’ ignored.Invalid value of ‘tri.upper/tri.lower’ ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.Multiple matches to component nameNo panels availableNon matching lengthsNote: ‘auto.key’ ignored since legend already present. Use ‘update(..., legend = NULL)’ to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested ‘trellis’ object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of ‘aspect’: ‘%s’You have to first select a panel using trellis.focus()a formula must be specified for the ‘data.frame’ methodbad value of ‘intervals’cannot have log y-scalecolumn must be specifiedcomponent ‘%s’ duplicated in key and legenddevice does not support raster images with NA, ignoring ‘raster=TRUE’device has no raster support, ignoring ‘raster=TRUE’device support for raster images unknown, ignoring ‘raster=TRUE’differenceerrorexplicit ‘data’ specification ignoredfirst component of text must be vector of labelsimproper length of ‘lim’invalid dimension ‘%s’invalid modelinvalid value for layoutkey must be a listkey specifies ‘labels$labels’ but not ‘labels$at’layout must have at least 2 elementslength of ‘%s’ must be 1 or multiple of group length (%d)lengths of key's ‘labels$labels’ and ‘labels$at’ differlimits cannot be a list when relation = samelog scales cannot be changed via ‘update’malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinnot enough rows for columnsonly using the first two of %d regression coefficientspanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with ‘hist’ computationsrange too small for min.nrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied ‘dimnames’ have wrong lengthspecifying ‘labels’ but not ‘at’ may lead to unexpected resultssupplied ‘dimnames’ have wrong lengththe ‘at’ and ‘labels’ components of ‘scales’ may not be lists when ‘relation = "same"’the at and labels components of scales may not be lists when relation = sametype=‘%s’ can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelslattice/inst/po/ko/0000755000176200001440000000000013070415115013700 5ustar liggesuserslattice/inst/po/ko/LC_MESSAGES/0000755000176200001440000000000013657201524015475 5ustar liggesuserslattice/inst/po/ko/LC_MESSAGES/R-lattice.mo0000644000176200001440000003475014024041344017656 0ustar liggesuserszH $I n * 3   9 !R t ,  > ' 4C %x    H b@   2 2!Dfhn&# #,Pi! " Jdx/2,M/ztUH#5 8@y( $#$64k+4@ Wb%h0 $),N){&!H9/ %^ ls  8%,VRL+$"G[{a?3:Rnk6-$di'BD^/uIIdg>` @ ; }!!6/"2f"`"`",[## #'#'#.#B$?Z$ $$$@$1 %.<%<k%7%/%&D#&6h&&&&U'(|'''0'A'Q@(/(.(\(?N)')A))g**+]?+ +-++_+U, ,;,#-%5-3[-:-D-H.0X.'.2.P.e5/y/0(0Y/0g0-0;1,[1<131N1RH2Z2'2 36+3Zb3;343g.4U4!45%5X65n556E6/[6=696V78Z7{7s8I8`82.9>a9G9pE8Q' 59MG]Z+SFj <\/2qYwk tx?m@>e4L67h;niAcla( K%Trdv[-PoBW&yX V"CI^1H,#sR.3!gu=D0U`O_ JbNz:f$)*'a' and 'b' are overridden by 'coef''a' is overridden by 'reg''at' missing or incompatible with 'labels''at' values are not equispaced; output may be wrong'bandwidth' must be numeric'drop=TRUE' ignored'expr' must be a function or an expression containing 'x''f.value' not supported; ignoring'lattice.options' must be a list'length' and 'prop' cannot both be specified'length' must be positive'multiple=TRUE' ignored ('groups' non-null with 'outer=FALSE')'nbin' must be numeric of length 1 or 2'nrpoints' should be numeric scalar with value >= 0.'origin' forced to 0 for stacked bars'par.settings' must be a list'par.strip.text' must be a list'plot.args' must be a list'trellis.device' has changed, 'bg' may not be doing what you think it is'trellis.switchFocus' cannot be used to switch to a different 'prefix'. Use 'trellis.focus' first'type' has unsupported values'varnames' has wrong length.'x' values are not equispaced; output may be wrong'y' values are not equispaced; output may be wrong(loaded the KernSmooth namespace),Call:Can't have log X-scaleCan't have log Y-scaleClick on panel to focusClick to choose one point to highlightCould not find device function '%s'CountData:DensityError using packet %g %sExplicitly specified limits ignoredFitted Values minus MeanInadmissible value of layout.Inappropriate argumentsInappropriate value of 'as.table'Intervals:Invalid 'shrink' parameter ignoredInvalid 'theme' specifiedInvalid indicesInvalid key, need at least one component named lines, text, rect or pointsInvalid label.styleInvalid value of 'aspect'Invalid value of 'log'Invalid value of 'perm.cond'Invalid value of 'pos' ignored.Invalid value of 'tri.upper/tri.lower' ignored.Invalid value of index.condInvalid value of perm.condLength check mismatch; you have found a bug!More pages in layout than seem to be necessary.No panels availableNon matching lengthsNote: 'auto.key' ignored since legend already present. Use 'update(..., legend = NULL)' to remove existing legend(s)Note: The default device has been opened to honour attempt to modify trellis settingsNumber of observations:Overlap between adjacent intervals:PanelParallel Coordinate PlotPercent of TotalPlot object was not saved, cannot retrieve panel dataPlot spans multiple pages, only last page can be updatedRangeRequested 'trellis' object was not savedResidualsScatter Plot MatrixSelecting panel at position (%g, %g)Sorry, align=FALSE is not supportedUnrecognized value of 'aspect': '%s'You have to first select a panel using trellis.focus()bad value of 'intervals'cannot have log y-scalecolumn must be specifiedcomponent '%s' duplicated in key and legenddevice has no raster support, ignoring 'raster=TRUE'device support for raster images unknown, ignoring 'raster=TRUE'differenceerrorexplicit 'data' specification ignoredfirst component of text must be vector of labelsimproper length of 'lim'invalid dimension '%s'invalid modelinvalid value for layoutkey must be a listlayout must have at least 2 elementslimits cannot be a list when relation = samelog scales cannot be changed via 'update'malformed colorkeymeanmismatch in number of packetsmodel must be a formula objectnearest observation already identifiedneed at least one panelnewFactor != NULL && groups == NULL does not hold; you have found a bug!newFactor cannot be NULL; you have found a bug!no intervalsno observations withinno points withinpanel position unspecified or invalidpanel.smoothScatter() requires the KernSmooth package, but unable to load KernSmooth namespacepointspoints of clickproblem with 'hist' computationsrow must be specifiedshingles can not be concatenatedskip cannot be all TRUEsome components of supplied 'dimnames' have wrong lengthsupplied 'dimnames' have wrong lengththe 'at' and 'labels' components of 'scales' may not be lists when 'relation = "same"'the at and labels components of scales may not be lists when relation = sametype='%s' can be misleading in this contextx must be (coercible to be) a factorx must be a shinglex must be matrix with 2 columnsy must have exactly 2 levelsProject-Id-Version: R 3.2.0 Report-Msgid-Bugs-To: bugs.r-project.org PO-Revision-Date: 2015-02-09 00:06-0600 Last-Translator:Chel Hee Lee Language-Team: Chel Hee Lee Language: ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; 'a'와 'b'는 'coef'에 의하여 무효처리 되었습니다.'a'는 'reg'에 의하여 무효화되었습니다.'at'의 값이 누락되었거나 'labels'의 길이와 일치하지 않습니다.'at'의 값이 균등(equispaced)하지 않아 출력이 올바르게 표현되지 않을 수 있습니다.'bandwidth'는 반드시 수치형이어야 합니다.'drop=TRUE'이 무시되었습니다'expr'는 반드시 함수(function) 또는 'x'를 포함하는 표현식(expression)이어야 합니다.'f.value'은 사용되지 않습니다.'lattice.options'은 반드시 리스트(list)이어야 합니다.'length'와 'prop'를 동시에 함께 지정해서는 안됩니다.'length'는 반드시 양수이어야 합니다'outer=FALSE'이며 'group'에 NULL이 아닌 값이 주어졌으므로 'multiple=TRUE'는 사용되지 않습니다.'nbin'은 반드시 길이가 1 또는 2인 수치형이어야 합니다.'nrpoints'는 반드시 0 이상의 값을 가지는 수치형 스칼라(scalar)이어야 합니다.분할된 바챠트(stacked bars)의 경우에 'origin'의 값은 자동으로 0으로 변경됩니다.'par.settings'는 반드시 리스트(list)이어야 합니다'par.strip.text'는 반드시 리스트(list)이어야 합니다'plot.args'는 반드시 리스트(list)이어야 합니다'rellis.device'가 변경되었습니다. 'bg'는 아마도 생각하는 것과 같이 수행되지 않을 수 있습니다.'trellis.switchFocus'는 다른 'prefix'로 전환하는데 사용할 수 없습니다. 먼저 'trellis.focus'를 사용해 보시길 바랍니다.입력된 'type'의 값은 사용할 수 없습니다.'varnames'의 길이가 올바르지 않습니다.'x'의 값들이 균등(equispaced)하지 않아 출력이 올바르지 않을 수 있습니다.'y'의 값들이 균등(equispaced)하지 않아 출력이 올바르지 않을 수 있습니다.(KernSmooth 패키지를 로딩했습니다),호출(Call):log X-scale을 가질 수 없습니다.log Y-scale을 가질 수 없습니다.포커스(focus)할 패널을 클릭하세요.강조해야할 한 점을 선택하기 위하기 클릭하세요.장치 함수(device function) '%s'를 찾을 수 없습니다.개수(count)데이터(data):밀도(density)패킷 %g을 사용하는데 에러가 발견되었습니다. %s입력된 limits가 무효처리 되었습니다.적합된 값으로부터 평균을 뺀 차이layout에 사용할 수 없는 값이 발견되었습니다.인자들이 올바르게 입력되지 않았습니다.'as.table'의 값이 올바르지 않습니다.구간(intervals):'shrink'의 값이 올바르지 않아 무효처리 되었습니다.입력된 'theme'의 값이 올바르지 않습니다.잘못된 인덱스입니다사용할 수 없는 key입니다. 최소한 이름이 주어진 line, text, rect 또는 point와 같은 구성요소가 하나 이상 필요합니다.올바른 label.styel이 아닙니다.'aspect'의 값이 잘못되었습니다'log' 값이 올바르지 않습니다.'perm.cond'의 값이 올바르지 않습니다.'pos'의 값이 올바르지 않아 무효처리 되었습니다.'tri.upper/tri.lower'의 값이 올바르지 않아 무효처리 되었습니다.index.cond의 값이 올바르지 않습니다.perm.cond의 값이 올바르지 않습니다.newFactor의 길이가 올바르지 않습니다. 당신은 버그(bug)를 찾았습니다.layout에 필요이상의 페이지가 있는 것 같습니다.이용가능한 패널이 없습니다.dx의 길이와 dy의 길이가 서로 일치하지 않습니다.노트: 범례(legend)가 이미 존재하기 때문에 'auto.key'는 무효처리 됩니다. 기존의 범례를 제거하기 위해서는 'update(..., legend = NULL)'를 사용하시길 바랍니다.노트: 트렐리스 설정(trellis setting)을 수정하기 위하여 기본장치가 열렸습니다.관측치의 개수:다음은 서로 겹치는 부분을 가진 이웃한 구간(adjacent intervals)들입니다:패널(Panel)평행좌표 플랏(parallel coordinate plot)백분율(percent of total)플롯객체가 저장되지 않았기 때문에 패널데이터를 불러올 수 없습니다.플롯이 여러 페이지에 걸쳐 이어지고 있는데, 오로지 마지막 페이지만이 업데이트 될 수 있습니다.범위(Range)요청된 'trellis' 객체가 저장되지 않았습니다.잔차(residuals)산점도 행렬(scatter plot matrix)(%g, %g)의 위치에서 패널을 선택합니다.죄송합니다. align=FALSE는 지원되지 않습니다.다음에 인식할 수 없는 'aspect'의 값이 있습니다: '%s'먼저 trellis.focus()를 이용하여 패널을 선택해야 합니다.'intervals'의 값이 올바르지 않습니다.log y-scale을 가질 수 없습니다.column의 값은 반드시 주어져야 합니다.구성요소 '%s'가 key와 legend 양쪽 모두로부터 발견되었습니다.장치가 래스터(raster)를 지원하지 않기 때문에 'raster=TRUE'는 무효처리 됩니다.래스터 이미지(raster image)를 지원하는 장치를 확인할 수 없어 'raster=TRUE'는 무효처리 됩니다.차이(difference)에러'data' 인자에 지정된 이름을 가진 데이터셋을 이용하지 않았습니다.text의 첫번째 구성요소는 반드시 라벨을 구성요소로 가진 벡터이어야 합니다.'lim'의 길이가 올바르지 않습니다.'%s'은 사용할 수 없는 차원수(dimension)입니다.사용할 수 있는 모형이 아닙니다.layout에 사용할 수 없는 값이 발견되었습니다.key는 반드시 리스트(list)이어야 합니다layout은 반드시 최소한 2개의 요소를 가지고 있어야 합니다.relation = same인 경우에는 limits가 리스트(list)가 될 수 없습니다.'update'를 이용하여 로그변환된 값(log scales)들을 변경할 수 없습니다.잘못된 컬러키(colorkey)입니다.평균(mean)패킷(packet)의 개수가 올바르지 않습니다.model에 입력된 객체의 클래스는 반드시 포뮬러(formula)이어야 합니다.가장 가까운 관측값이 이미 확인되었습니다.최소한 하나 이상의 패널이 필요합니다newFactor != NULL && groups == NULL이 될 수 없습니다. 당신은 버그(bug)를 찾았습니다.newFactor는 NULL이 될 수 없습니다. 당신은 버그(bug)를 찾았습니다. 구간(intervals)이 없습니다no observations withinno points within패널의 위치(panel position)이 지정되지 않았거나 올바르지 않습니다.panel.smoothScatter()는 KernSmooth 패키지를 필요로 하는데 KernSmooth를 로딩할 수 없습니다.pointspoints of click'hist' 함수를 이용한 계산에서 문제가 발생했습니다.row의 값은 반드시 주어져야 합니다.슁글(shingles)은 연결(concatenated)될 수 없습니다.skip의 값들 모두가 TRUE가 될 수는 없습니다.입력된 'dimnames'의 일부 구성요소들의 길이가 올바르지 않습니다.주어진 'dimnames'의 길이가 잘못되었습니다.'scales'의 구성요소 'at'과 'labels'가 'relation = "same"'인 경우에 리스트(list)가 아닐지도 모릅니다.scales의 구성요소 at과 labels은 relation = same 인 경우에 리스트(list)가 아닐 수도 있습니다.type='%s'은 문맥상 올바르게 이해되지 않을 수 있습니다.x는 반드시 요인(factor)이거나 요인으로 강제변환이 될 수 있어야 합니다.x는 반드시 슁글(shingle)이어야 합니다.x는 반드시 2개의 열을 가진 행렬이어야 합니다y는 반드시 2개의 수준(levels)을 가지고 있어야 합니다.lattice/inst/doc/0000755000176200001440000000000014773141535013433 5ustar liggesuserslattice/inst/doc/grid.pdf0000644000176200001440000054421214773141535015063 0ustar liggesusers%PDF-1.7 % 21 0 obj << /Length 1633 /Filter /FlateDecode >> stream xڥXYo6~IzDMѢKYKﲕ%UGl!˖]LJ"g3|3(8QEHRG?廋WqД0&`B ȈW}Xd]grx(6FHLcdwdW?)B DPJT3\%2 vz-8ixݛsӪtcWō;J%IwMt)+n*4k=!MjhZ8_iMgu6O#RA]Tt<@4$ p)uQuӊ;S{[rb) 3cAEd K·:@49/є9?!J|iq:k;ͯYc2۸Xxڹy!7҈}|kkJ$T|L1noEbp#9@ܜO 94jX|}-u{N-B# x d?&@x5,IHKua-9JUP~f`?6.jGgZO'Utj<pA\sSR4hgr29X|ѵ MۍmWv-t1纔`()u1o4^.u&-]IVâd)=:2>jP iw38)8g[orqsR2xfm\xxLcYmd5._vVR=GvϧIqD@m&Mstm`.n\ᶼ Z ~u{捹'b )t.{o.. endstream endobj 41 0 obj << /Length 301 /Filter /FlateDecode >> stream xڭMo@9qg?ڴֆ[ӃA%$wmB4 ,ne &VoA30 >Xt]ֿ:Y{0<w:y?%|XƐlE" Z$_3\ٹ"THZ>ξ@ n?ޓi,ZyQVUFfP֝*6\U~(._:<"9X]YEA%"Gt/9ɫ/OHƨ%u+. NUoe-* "?lu*nX4t endstream endobj 12 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpKkZuJt/Rbuild8b7fa37fbfd95/lattice/vignettes/grid-trellispanel.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 43 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 44 0 R>> /ExtGState << >>/ColorSpace << /sRGB 45 0 R >>>> /Length 7736 /Filter /FlateDecode >> stream x]I$m}P)c*6 ç\ll{zךüi1*{?Owr_6?oRZ{+rW׷o~~I篦jiRfu/ncy;nteozŰ~r[n~7Ç+ʽ{[E~gIMזbR,}S.r.PV$ܷ*@ݗ;zmNJ&VqNly6Z-6]mq[a?nJTOosKK<]Ģ.q4Q&uȩ@_DN#fyƺgM筍u/74coO74/5Z3-ge|2cG uwv;c:Ɖ1|Qct/vxEzogJ۽'-Ӹ10]ZADQ ֗?¥y ӣӔA}C5zA㾗K>Ʞ)1'vnP,%]vYF})X切?W\u7[ҊD hWqc"xa[@`lէXN~ sF(ϊdKۅ5,-N¢nP()]>g91񄞅Œr+=ÂZʲXY%M Y&zbMۥ>&CFdb]h| 1pBリC`INY!\. ^.Q12 'ժb_uc1Fb# #Fjm,)fiqXZ[:MYTn?+橢bΎ6Ɔ_aP)cNXQ[ys0'yL+Kne~#Fǔ['f1 <@bN(-XY+>T7jîyÜ1=q0{v%-`ŠndlI7(Vݒ.ag,#c  H([KSE:8cjz&ҬrY*leA&^,1(в|pJ[ۄ,-ihnRneݚ{8"b%G[x6y3Kq$` ׶FJEY2V/6|롥8%֟Ma_qi^45/)4aGǥgm9n̈́=㢷[5]Yꄯk:$;m C[F9Em f_cF̜;-8pJN5*"ݠ<Җ#嶋'Y1fo%ec̀cUWaeG곟/Ώ_k&C>*70JQW7i.7E-cx1xאRcXX'."縎ȫ@z09똜 MDN1߶ȩgW~xs6c~xu ۉ| ݖh8ƊngػK7)fݖwvsэ^>fNuZ>xpAcKk*aEA7K3ʱp4v~ubim92v[N?Ŝ,|7m|w,ͫ,ȻCOݶ/itYT7嶋',ظHU3Ǡ 3zI.i*zQlavb{,#S7(Vݒ.ag,af$hŕRՔ{| kcINIXne/>͡"Ns9Jw/K~1Vt8%B]{Knez fEbNuSmC_f(:/y 'XSG%vT_I\v dK뻈M,豚ro>K +jooh\џu&Ҭrele_Ew1gE?e9([adyCi, [IŮQ-v}Ll9-hؘc—b>%/Wnh5ۥ[^r%lc,RN;ܒk_louAw=b(QR 5&ӂ^䵘nK&Ș >MNVDȩG98ZLY@;&зm'WMm?E[߸Z(7m(oPn[}oPn1W6= p LI8*,pT pTbNqgȔ"q)竻w:-ޣfd݌l؂Xk5 6ot&p]np i%[᫭1n6VQ =}䜱is'sc1dBe}Nw*,-!Gcw_I4\v ;ۭgYOl/-#<۶سk[e|qZm-ޔdŠnx]"XAvdeb36cVӦea IhBƒnw66-/ݤXu[.Kֳ*,?0l̜Q ~p݇r:#jdI~Y,-Pcb/ݤXu[.ֳXWwq#EEԋz~%gXQ@b[,SwtM"n cǓ_j}K&<;wq.trwR+Kőo)NRm92vLBM ;c&k`(ap"VkU* uR*kmuYӽ 1sEU.TfZ4zQZKVT$g ,nIݙGuK.vZ#=&FY7>kc'l~FFm q&XbL1FVψ[c<#a.ofF왇>ٖ#S%Vg$GcIlC~u7peݒ.ag,syF4gŬ6j_|||.X)?|ψ4>O.%gD-vQ(E> E>[[-w Ău~XT =m9}:B@r>cp!ScuA\.9s1 MD:s9V_fNgPi&4gbC# w)g/Er$s&VT񘗜ś7MAQKne15Ed}X,Dp1_pm5d8Њ,1nA.߬:%5Ͷ:gis0= ԫxǻ)ft-_F6VpIb;Q;s&\v ;g&i<ܒp;|s\0E7T%ٙWJútK\䶋'_c)HuA>0F.ojY+k[d$u;<>٥ԋZH--%I>ǫYrҬÝDe^5MNrvHŽitRWTMd=ŊW4]dEh 3+K7)?ym92v{:}uu"9ڕhfE\^&VԚ4 D鮙s񜰳Wid34o.'vow%ֵkZz9Llinim,v/1ؠy̜ӱ s"N =W$k =b! )l^IDݒ.b쾒TS>|̜#%>bƁ5vI9A8/9+*ѠMlA;t_Jm L'qyb<̜4뜱[)bAH輰y:<'W2\v ;gZ0Vf+<8e0m+HD][Cp"̨¸q`lRcy4}}º_.߼ ;ѷnL+x= /k4ֱFn ~3 dYhqK3x}[M.K7)fݖ.cgY=SrAVedk=Lb-d93%EWꮙ%]v_iyWiy4.DL9i[/yVTu79H¥t/fݔ.bҿbٝ)NwP0!K;8遉x gv UwŠZEH,n J-[vd؉/=A~ i=2 )sʼVtg$Gꦰ!,uqwݔ.bbZ:^{g}l~G9UmE:{;JUa%?.>m?XEMWfSfngSw%LExUD\w^EDExUDT=7,6SsN9SZȹ@+sZȹ@>si}"h>\o8Izq+ q0S7ub`|L5|6 o7N\nhqnSRō>5;aqv VmǎOGڿAZY8" )lvɑXQGgvnQ,S.H[~K&'N5gxM LI$q r.Ys@OX/ݤXm)OvOR0,GN9T&B2aO#XS2 n2^`M"n'*購:1spJyAn1dp,E$|rr*t_uSn}[9W&}L ĵ^V+X %͌dLZQT5Y+twIVeVVP1xғJlҼlZqPR^.Gʕ?aG\'VV+6nUTj9L((H|o9k Qڜ  UKnZ*sN޷ytW|Ȝh˖klG y6]Lݤqzvڍnm08C!bińR8qѱp&F`Di\*MZI(߿)5=O"bgD}hN}bӔ3)[IyTs=9if.Jw2UKnppEX11vaX\y<8(-:eK~kg-֞٪RYCl땠sΤVq*9H9ƶTzpU2՜}$tzQQ>e| I±+@|z;{ĪOD=WD^fKFUX* S Z#ܓ״(s.meW^b/)OةE=կ[O|k襻pM"va0k+j@2ΘZdܲW K8k'3c:.n:nvGsksAj)䍣hs,lct+=ZuKnZ=mac4Z #TS\}۔oKYz&vmQ\I4붼x`]>[̆=@v~_ l ߓ= ʉ1X#vuxLV^kfMh}O&¸AaabI1)cIQ7KJ7)fݖRag'slz㫈/?㫈wNY/@~Kfd'< *| ]"=?Q@=Xh[.6T$wTdpȴA"!piEG"&׏'{j. 6橭 2'j7ڔ7+*SWũԝne>5QcFLOH3tlHD5s!Ēn@,ZyK7)fݖRagюV3A/9H̥pѼ z|kLKNa֔pZ"E_1BΖ+XS:͒9_8"*ҽiM"n-yV9Ag%t>R/pxUzKlR-Ɂ'Xd[\ g}? ͗6mW.ֱF?vS>or2Л̅:XoM"nƞ7s ӯ1<\&|'Š}a2˺.\v ;}a=G nQRId&;8`lŁ뮾#\v ;g3,9|8"ѫ"v%ZĊDTa#ug"X-ym9/>d9?[O r˨9?e;>+. endstream endobj 47 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 15 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpKkZuJt/Rbuild8b7fa37fbfd95/lattice/vignettes/grid-trellisstrip.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 48 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 49 0 R>> /ExtGState << >>/ColorSpace << /sRGB 50 0 R >>>> /Length 7415 /Filter /FlateDecode >> stream x]K%Q8˙ǕʪbH `ay|%wܶ𳿪=J}J?kݞ</oE-UM>jiRW˿Ǿ?zr=w~?~X^1컟?Wo>X1 ˣ_϶".x\Zg_ \ lK(9vVzYv?~SQY>;I;bڛ@d|y*Q%>ybQlӬrKz=Ǹ \ HY@] fL]xn9k4lj 3L} s OHРz?qРyAw0`p \NsdhYQtv9Xڢ1'ZY/̈dtMUSi_z$2k4ewN+K&Ǎ%I28?<޵g/dݕyɵOc K_~ݷs?oo(_Eɜ_Q_J~-|zwUf+]@] ֟X\ ]kKQW]_Zbskg(cR9l~;ga1$ǐAvn7uS\v:Gfp>4*#\:{r}3aiL1 c\g uJJk[l{ X/f׻?.x3$0Qn!&H@+1DMV,:%5- yigᦞQMlvь,M|gIlKnR,ͺ-]Ʈv%+Xrp|-mngilDnݤXu[.]ӦwO 9}&gDjNߤMLEbWHv$ԛ[r%jeN995b'1P?罈5LqU7,-Μs"R5 E͖(W &(\ Gxr6m᧒rum3_9#9t޺ItqXr%j#Fƌ#\  5MÌiĉVc0q=b ZYFV oce/ +mK5NrK,]ɺ%]®vY*۩g30*VBƊn?98;='GU-v[2Gxak1oN"xwP\gʧ:n(fiqNl' aiݤ8ne)ֳA a3fsEņ`rtʓuOb_,6[7)fݖ.aW,[Gx{.k9'm4g_y`6ӃqƧ՜(^V߼O_)=bAgh5{tgz R BRYCj3>vF:zY9c6Ʒ;C2 ,ģ)ošpXXtrvr%jʝ7hˈԦS)fˌR~XQ-es cb]Kn.<|`^rG'7]b4uNW5 NL=sZoݤ]XKWvYb@;0_4A0c@RqQ/F떏ؘI(fiqv1PXwρuK.]wiC.T~wNȫnn]MG}һݹUoݤ<]Fݖ.aW3G'&Pst.nOz81ͮ\ɘȉAHdR=3i1:S*|eӤ81]H"8\j#GfU!7$(ܡ`cX-Q@23~܋}T:M55PTXp55gGw1Ld΅. lӑ9rG(& $A5cIQ7KCBؓ^tbim,v[ ܚ}Ҝ8Ӑ])Fjn9|Ēnsp'vMYT; -3)`}An1XFXSXFfΙE9!#iwB̆~Y9HQylXX>ƚ:1%C{tuK.]v6B!U63c)VH1 )?#ؖXR +p7vnݤXu[.K]t*K8i:Ny:DZ'Tsuĩ3|`Wv:,<,X;8wejJt=Elc ml,onݤ>-߽*vѣ^VJp q.BSNL-ƚlΎpcI==-".g'XJi~1gǠ8сύQ t&9GYcEA7K.寸.b_8RN[R{G$xM$O WN묻wͺ%]®v wqNN{AYnW,(o(+X[r%j7&}?9 /Zq~u1dY~a83t{ℍ#urߏT{Lֳg;ILF2ŴU &H}QXSa6Ļ|wSg?CBԹa.s$? [sĞCrŠ:rܜoawnK~nɻvkdɯhd7\F}zq 4r$&V5SrnlܺI4\v \JqZdNg]|2(9߭;a2ubim,vep2p9aDb>L1e[NQKlR۝BΆҽQm9".G+8V11D(0ݣ][l9=G5UT1qx$c dݤ]X岋Wv/ #;ᯢE*SעE*De_'ŠjވH]uK.]vmcr+ƚ);b1aXTŪKZ kyrT3aqfݤK^֜͹^ΜУH.iUQh`$sKkCY{1UO쒩!njC;얩eLEGo~4qgsJ5!@_uIgsv bmݤu[.]/%JN I-dlt[>ؾUJC[7>ovɁq);C z,%eA1ĊjX&"Xye֝gbڝ9q% f!R#M8'ngʍ#AʉxwvVJ+ ՚RGj2` \5{fh8|w`,X-8A` \8$\olNb%kxjvLS7. slbԅV񽱢؈ߺI9 ^TnCKksz |O̽pI!Jl\E,-vbKeܖn $EcJ \U D[!0/`R[^&ΎiAwDK1 >4H^{+Μ4F0bԉNuSokXcO!sp47!Mҡn2g\<X#'lĆ}m+š:3stX-퐻.b_٫t*39fZO>q2匵Qn9r+jTfrvl3䩻%]®v . 3LJ8iL] Ô#D!(QbEQ,&Rb_٭`Sww$F‘bk*E6Sqtu}KHrx] xPu aŖF_;qx6Mgqx_&skj~=w XџFbQ]џ|XSsZ^Sk :f7D4R6rǍ\d #G.\ı#YGޚ[tbWe\{3u1--居ucEÛw=7稛ne፽f̆\/+Pi5&nP1Y1;+f9{Va%ݤ[ySr%j`:@99"fXyo-?VԞ ce+^A-vO:~UqQCHxgLi.ŔzKy, n,)v~N׿\ƆVR('Ƕ\nX_=XޛԱdž^5*(˻uS{%ӹ-)lc.t;WPuSnznK.,*\'A3@ɠǮk)/S&ofu;IZW^^Xu[.K]ֳD!R7Ĺ?0ؔNȄ{0,557D\c;uݝs,ng*/ 'nf`/oz+YZblǡ &mlSnK}eBZf}+p)ob3*?Ke$Tˬs 27ݐa[f}nesFc6D5sF99PQK΋5u䓛"$|r-v[2؋owqv?9ǢPbB6Vu9'une˹vs/'˕rRC53ܜ\<굑rE+_)T[pk^[XCŠв8`ݷO-]Ʈvt r99l*.Wb9O,B%dW5YK\Tnc;}{136އ=[yXq1K7TyX]uK.]RbN㸉pxgQS[Nt+`*جJ[~-v>낿)F"Gfu(|ŝXQ#V>P/[ tݒ.aW,1?]s C_ ?8-LFBwxƒOrxtoyu[.K]Ji|s0DzXw6Gl;>o?cC57@StOq(CXk/nerpvii)rս /XM[r%j_Z͕ƔTdXZ6S/?Ɗ*6G߄Sr%j{q^:_HH/}?& endstream endobj 52 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 57 0 obj << /Length 681 /Filter /FlateDecode >> stream xڵU[o0~WX]=vP`FPbr~kP{ endstream endobj 53 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpKkZuJt/Rbuild8b7fa37fbfd95/lattice/vignettes/grid-trellisgrid.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 59 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 60 0 R>> /ExtGState << >>/ColorSpace << /sRGB 61 0 R >>>> /Length 7869 /Filter /FlateDecode >> stream x]MqWܥ26 , /GZ'9 ;>]uΩK?ႤTϪQ.ϫ_~ͫme_v_]5Kԯ/tWT/h]j?~ yi_ֿz!i*zj~<]Rt>e<@Kr\}7?.o|})嫿חo_vgkW/?ᄒ|ǻ }/W?|7?K^_~|n/y^[u/7o|7743폗o~z~zOnj-<23w{ Ǜ?+tanMi~۵KN嚒7k˟=k?.mtrn3]z1X.}]8۷kv5@~Ü =_k W^c*\zrUH㟜\T@=]`{ _j5~VwtN3_z˵jv݋o8~=1f]Ӻf}rdNQӵ/ $6~E0F(\kS{]Sh|qr͟|Sm>{OcN+ngVc+?V8aS跏 c&ao!Y9OnN<=1 M U0ʵ6:U )n7g7jpM9_M]|q W xõXrH[7VSiġw/{+f[+^|y0+c3E. eEaL]Q0Q`32qY+TPp Kp Pa PA*,*DpkpE* He <ēYيmm 6lA4:ݔ$=|+L U0nd MJ qcy\Ev[fNt7dn7@U:67v=){#+/m~$}gnv?ael5Im iNI U0-č8*z=V_aOJضAlJFAl;϶Ċڴ!98S`[9޶LݧmPhֶo>˘8swZӢ(e ˘O.gK>)Ċrۮ-T Ѷo>؊5{9Xm1-Dy{yC|1Ö5:8','2,saI'n\cjS8WQm(co~ܬ6 aOIOۚ ­BlO!\դݺڤJ]F[i> 6AxCKI}&[*jwyVA@ps)!nuNTDk6٩bI9EiiʋjS=b+lvJSC.[=ib+ 2NQJxGް5H6 QZ"4%CGi1VA'yV_Փ6Ӝ6?Ne687+K=X(\;RmtB  ަpWm86E9Nvv7ƒ1XY+ٲMRp 5[GaȢ7$RrJxG[v$a)ǽm 7tGl <cγ7uW_o%嶡 h’qĎ[AAmSN[`]q|qe, j ݋(I}rTy<82Mg I{hrEBSX̕%DzCzBcݕJ&l+9YbݦmP [ےS`oV7u@cdr![F-)yE@XRnbEbGڦmPrEzqؼrN8lXK7{^.m)@a-"2m6ږ~e9옜'@N^8SdRV~sL,(sqKa2.{q X;<`9**NWUXP= 񠀰}GJ>3h[rzJ~6~dHOydg|sKJ3GKj-rThۦ~=fÌ+a&OvNǔmT<8Q'6.l;yۦ~g턟FGn*!'{ fl$(%m Rnf 9h ;I6)_Į~kxōɮ/9 cٳ]ǘ/eڞh`I5EO`}%RjrEwo=wΒ6e-gks9G%cmb%öS)_Į~9t/x\9*^ Q(GWXQ~{`w/Ր}mᗰ̣߳U!8p=mX9Ӏ(oMyyXQ% A9ρ9mo׉[d+'tMj^s`x2r+3b a*mSNSOsLPu[)z\wN^ryOx`  I(A$TTBRYBRQHB*KH*anytwcӿwW] {wZhpYw-0; HjOW^ KlQ Xc{Km?p7n9[ Jc)_®~6 RGXDw6${E=pf%v`[;kUkdYږ:S?_KYAَ~OXraAGAFLɃ[ErՓ/WIߨ7*cjkCoTPX;U@zc/]Yc[sL]wރ{j{?jEX"-7$FfAh;مSPKn!gXXR]K^pbخV۔/bW.v=;ݙcSrsNu\&TF?8Ŷ͸lrE7%@MǕs1!zSejJ9$f~m-9"v[קR+jDRWԊKwR>.;{ޢo+-(U؛"XP=6 hry D 馫*ҵ6»~Sr"0WppUXM۠"|\~2n~oznY%6m˿S"w *{`Im6/mP5CRN]cWoc9'|98Rr$Ɖ|+_:O Jcڦ~{Rͅm;f5IV{0>4 ڤ0ǔ{!`;p#R,Zd\5q[ƹM}LOu[vਲ਼ RES_q,}LDXHA6o=GmzT8*咅|WUBJoܧae%TUv"LnʎmSN]~ [N/B;C=ޥ|z 顥ϗ~<xQ%3qUw9JEG^,G^++yy#T#Ttr}ԌQ|[܎'{.{ZךHM~)A{yڴ J׃sᗰߊTE$ix]WS[yx HL eGRNO]V׿asq[>,a_'mwvJM{m)7~~r=:gT\(D(?}!,]%r5]ڦ|yy͍3w=,]N <&ꁱz?RP^pVԦnqV`mCb$3>7eos;H,).X+A)[[7~tY^~m;ówP^z۫ ~5{26[n&E49;^{AD!nTO S|ޣmߊyẘғB"{6#-o!OVm7466oE[/~qē|"mԸg_Snb5lCj!x>mBmS.[gfA6ǮӡOʒ |[Ċ q!^2Al[]=;jQz4][=0Rҗ2ņܶY3m!_Y1}/X&|,L_SԂi=> lIE>"% ElN-9"v{޽jVPDɩNS> ',&(ZXwXQefOjZysmo3}<_kmNj -P>]RGebEm?j6Mرzı>&IAՆ]c@!Q`I>&Nכ1,m/}mKN]szTbNvftp{W)niBOP:־6m3v~ڂ]VjC59~VqŃt{)+`[wjbM۠%Į~+OՑx٫AS$?E=0hoʫƄ%zIl؎hr>ræۋ /BEAy%U",N Iahr3kuď+Ǜ7OY2,xiǂ% NEDXRhį`WU| n8 `EL4s 9Ʉ8<+l9mM9"v{y|(o->kv"|$'Y>겝=rM9"v{ط>Nj8#6ќDiN6{:x}^XٞEmSN]^SPp,)s沽o운K}1(!VTㅜ>OlxȻO!_{}}'dWqAܻ!XP c&VT)8;:;vgh[rF_vYr~v{-/} gg;]^2 endstream endobj 63 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 74 0 obj << /Length1 727 /Length2 10519 /Length3 0 /Length 11095 /Filter /FlateDecode >> stream xmxeP]ݲ-l`=@.  kЗ{έ2z]\2NZ>@vfv6;Zhrr2w tVM3ŽD trqغ, tV +@ yzzyyz-@5 H˫dU@G9aY@@G7 =tr?=Y:9eTUҒZsG+rGw7hcײ߬-$vv`9"K7yGk'ϿVI%+_bI:98{]NV@WG tZmw7_ɀVj [JO\WWm{VN`iwڱ(i1w IK;Z:Ym5wo9;*) o!˿_,EIH8y2spp9y<\~n+uH N!v-a_`&̴!ǻ/ 1AV{D7ZD^(A[g7͔@ѱR*/"L.`t,U`.#3W1qe* cʲǘUtbl$,9bewk0lC.,D P. Mm* v;NV9B 8;sDIC~Dl*m-kpSM/E߶dP1\G͘Q;J4R!ZP.:tai զ M\yTxd~@bM?ж[#P (IjӽsmI.GսPlDcTbE!+]j ?sTjE4"Z In0N qWԏ[Gb !L #&v͖} V*)lb1JgŻ´ģŸd&D :2ޓb|8ݙ``䵠? f`rF/7׿J,'I \̵6##&S{z3Ps[ȨgGWir=D@pӧ6iY Y'28{E[NUvpw1zCM49 Bxݬ23N/vRie4L Ov_:>e6 G~+/FpϪʭpSOQlq{ir^wm ⶚a0pEѝY" .RyܙF|-jSgh:vUd@\oցr`QM>>Q|P 4>:By 1Ȓoh*1}4$Ƌ{˃.,<$ygShM|- %Io֮Pqg̱3f8p ljhp%kX$"=lPXB;hPCvy#i2"B[U ,Sk__zY-x.y GbčseCMf;@ ,T;1R32hGަXq7m~./=?lvuX_CeE@ws8⒃ؔǶoԴHE| =>}uZ] ђe"= #iaMa"T>ՕpxؕN?|(4:#גGJ;U`3`o}*(mxoQ!cah>JwcH,~̗g!6my h#K/l#h6x8\#V'D^~=qׯP $́ٿмzt/ X~+n);IȞx;)9OOIVƞZwke0[EF֌DL~=T3؄[fnrVlc`cPkmud \0`f0{q8Ӳ[g ]lx̔9f[nRCS.QXb:=[xآŲfrDiܨt[wX-]R6:ơ_hl5_rAߩ 7|J_iw i/7MM~NI 3a>q>\veq$.T%!o-0izZNJY"QRƷn1KόΊGgS|}.i$b6)Ʀ~t6'{V[պKKKD5I2eo. A7>"RL`DVNp@h(rHF\ͩkǞX^Qu;)E.r3㨃nkr{W؄[Nfy{ۼr;3U?Hˮle`DL?X01`ACYGW/0F&Dj|O_)i/$2T6|N/fy:|2 Ct(HBQw&.IǮ$BmyG e3Ŵ8P9yR$j"^`*Lbu [8lW Os႗jqEU=q3 X9ӦG[~;i3KpJC3>]2̃% A94$Y0x!m4+LubP!+m屩+=BF$z@Mqxg +;-O/| K[F6a}½äOjghёAPoe).L,_%' `u2򏶆wh8}}g5 V&PB.3%&X{~K~.bXwo6wRS $&vmT#pܓC1YhC82?ۯRb̸`C }*_BvȅF 4eGŔc"@Li怈yu AjèlۅebA_n,l}F V#X$p_5a(v KhVmQfstSb.;uN5h~!va2uyc('NU`N'ioHo-"OPCJ s{nm.dpj'Ίu~/#?CL)Vݴ+`wwO瑶ZG}tH-{*Q]Ftڅ_ 6|6V *-}n=,CR ,S IrC ]и\EpCipv9nglOov;գ&ϴWlQ'xAxN U3H"`1ʁ\5Utjb`Lb_YNImtr(Njx37YqhRqPKئ ӔKC (Qr+ Py}cl8ʰVKSN1fp+3y\/!dw bB|F#ptQ.Enjxbz\A^!*&.{GzPZFWTN$w蒎wҢz쪤It۴8f1+}Tl^9pCF[3wnVJiʆMA?tsV ­>pUᇢ>KȞ7 &BQ^-m3"dab]SSK#4K_~lK֙#:3 etkh L o>10@=fKadC6 Wx. ܖCb;x GMz؞3>eХJ0x}c"g6 a6e,tx#P>Sx__2+?vwU)>qI%7-s/%?`.ޤ&KdX蒸|~Uy6b?QǞCVҺri`2G=qȜy/0MC6TljFdfzIv53EitWs|=>P 8TLH9:@rR~L+Z%Qi m%.8OdnŒ7C ^a "~_z*QPx4)D 2ٳ ]mOL x17/ebO6ӿ;y%[v"hOK"[5!h+tP"CG!$eOCIVZܬ󹡙'.lMKз$Cf'EcgM C<\ W$O3McV16j'ugŠ5|_@ 2,|z21r׾NI_J_TA;lA=g¤^,{X9Qĕs,!M6wæiFLϪSBB_Ók >0 5&~n1'Q m刋 A<nrZSS9O}.@C+(L0l0]W0#*D 6Zu:2]<q$]ؽL1(QGj#R2zyF_J88o G`l#k1ݙ?6!b K:y`<TlTF2lz ?O#(xOΟBS.c.uKVϸX-&#dp_Z;|НS R֛F)؅A EE6ݴm Bh%,w]aȹ{`xzDKLWH/ k C) np `Dq" OhX {\09!T<HkB'"e WʻGe(x>S_nwzn Uh4 nZl&=J~3Iž's(P鬭fK3E4ԗ/u'ѵ9$ЍP)|ǞV`mQ YSC5l!P4H?V 5Ӟu'ǖ`Z`G͜MGp3DŝF-<'2-ZE|KId-HmY/:[d$vX>[37ў顺RI:|خ+,!1.Wq'_<4ߜ&Cٶ~b]Ij#% yu,,%/S8$<>ď"R5(j pi.W> >}xsɟR:)ah5zY֠)bvsHO-Oc:!&"C(_fK#` 5oZw+޴Ts92 \A+4va=ԃ6t5'Z'dvAa`k`=mH=@D*@SD=!Z J# dG/fwAu)vKYy W30CI<Ȣ-utG%BCR\WU;ʌ6ҡ&9S̸DŞ[ߚ}=$؂(J Fzi\q= vNāb(Oiv4YLu$Lj DwƯgHϾ)ҀG2@Gy0% T[ٯ ·8/n=r4F'xk!0xqz Jb~+q>A>h GsA"^gyͿC/ER\px=4M(f@.6 e?eL=WVh=ߪ+שs-r8p|]YNS0g!]MdjP (0N._APUɾs8"9Q+n^_cH>4&!lC ^&DqJnVfӓ\iQ]<]>%,/A A岧 '?oРhTw~" Rہwq* 4P>s34-[v )ǒW mԞ m2%}ZV-_ZV~'{!7SO" >bU=qɼKic [y {+1ZVxGX-~͆+cW>b.5xeȩŊKVvYЫq0.x wnE${߸ql4H}X%>>yXRV9Ri07UB`㔮aݬ\\n:F"FOPhf'6gq‘7FĸblRb8_ݥo[w&x毡#Z[kތA܏P<ݲ7}S€}F> stream xmct5xvǶѱcN:ضI۶msg1qYU5׬Z(I%]<L,UIQV ;%hb`/nh@G+ tИhYYnV~777a7gW& E@ 0Ĕe4R)=dl Pv52[흁s_!`%fr(HH*)$Ęfy]y Upek_ [L3+S _؛;86suO/!45]mm1;GW `TfYzB"cwYhlWoscۿ:ro_I^;o%,$.N'-ao`feoPu+1쿁VnPOCXW0vYytY!,cJTÛ+ ag ^= |!֩$ *&X;/uѭ- oܑ&M6enɌcHcQ+,_?~73UvI_YRsR-T*.eT4{g/EOܡB -0z^ B3,(t ɯ=ӃӜҭe5} Evpo~j c]R ?]=YƻxɮPN\_#%~_:y-߆nP㏗`1(¨ i_ֺ7/&{ ;Nm<6} Ÿ|OrY.?bY_o(bZTʲV|`qopթYM) }W(~^{Xr`RKY[sDy0x$ALWn;21+I=M[-~{%~)ٻ <+h)HC3v>[X"CޯFD'Wx^Evx{F@]|պYxm<0<3=?_J^+>qއj`~ )sP*o$L (1J^-N(OxI 4_̀!-,X ZՎڦ'Ls6c#[U\jl<2{Gk}1:"tUվCȀɔ[LG |RcHn_g&-9 V7k,tCe9l:lP||FP6UDy@I%GEYi8BJՂ̝ uxJ$} Lú ؂LeIb¨ CxYy@HWE\u4Ov UmE Vò >׎^VZ +!{KxFq(ɌŕWd;b]Z83\U/qsj52hNyx ֐ ߡXUIcoŒ}'trh{Pl_E{2r6v/Mz9e㷠UC9K]q{iK7!b_oB#@Q{~?j8H1H kYJFԮoqvJd=mUnBDOx6$o$orjD4wPbvAjkg`cC\ WN$ث#bȽ*kp~ 0^{ E,0nyrQ;fʳk Q*L{c1I`!s(ӌ13\-?}0lA{]:;7%!6sq"1 `4i%S DW\*ap%kf}OR, ͵5+j.B $;=ˊ|8.92:.s9ϾКgt-C6 a \J&KO*y}iZ΋c9}hQ}Ɛb裃#~U5.otU[5[ 6 M)xJy?lK_>ٵJ 8%T14yOpGN0ehx쨓x2Z}uaw3.(^VX<]b`z07[(,zOyȷI|0Ʌ=ۅmpuK[%AH:N)sn585VV[ZN\']>nƍwL@&8OP7Ma\[begKߑ`aWJ"AS>,EO߃'{PG"qK/ rQn<-\!`C.ܪ|)fj?M'eDI߳z6QEg8@4VA|G.!/6/ iBLգGŴ©ہWn](5d6R.kVnE6`M~#`REN/ev_)pT>=$+0~?75V[a!6DJh@%3v_u1C݌)ŧ}/Q,T(BZc!lGi{YС@s3aVaaIE A;^k9qP/C >c]Ψލģb=mE"vR\ `%!1CZA康 Io%8_'$S0oyVM'l6*+ygbSw9kQYe z]F)[maH 08g#>m&S@ ~y2EP>0ΒGX5'srm6M9CgDŽ[Y㗤D =:Q;[oy?ÀJ]M;?<Ȳ]ȇð]8GgU.w7W N*/[y0׻rӨEW?hh|qxKH3mxD`ʈ&ȥ[5tX'3֭`-FV@ @$zP~4$ALճyi]CD;P΅M:`JU"H~3MJ $E主I׻eV&.MQƧI5AfJ@#QѶe/ ƾdcLzuDt TOZ!~l|T%Ґon`: X'Œ/9?q$6wcSrԃM* MA׈"B?)sziM~NU느%jS( 2nC@C(i1N=_㋬vr.qA$pMb]lڇ.;ě7ٷi^%E#^%{:NI$Zfhzn99z*׏%/ 9cs~-Mѯr!8G^);CψK#r&I; 9j k`yXKZ Z?徳sG{s;a5?PMrh۰t־>()|Ym( mjɍEʛZ=짎"'xf aWClY^ʰgɈA86OUkvAgT .2& ;qhɈ+ A^Ogn!IBemg,% pb9S z9odawi(?gLr5K6t^Z)^mJե0ެ<+kVBɿ;"qWA"5)xO|Lu~itQe%6bЩG.R6yZ*;ߐ+l|y+̾бof /J$U]ͬ=t%sI+^2޹Ţ0LG٬`uH=4ź0zT)ԉ2kSd8"Xe5 D7͏K F#J_v{;DcHm9#?#5B`*_݌Joe<xchՑeInKB\ϔCnQۢe? XHrcԲBC!2=_z\B%kpϏ[s*ONB&>Z&F8(٨xtYEqcȿH;@O󃖣SI p=axbĠNZ%xgdpVDxpKD3}`18Wz{ΒP c6݃߻۟MÒ@h5 ufjgbt sgw MQ>kA?*u^f6-8pmWE q" 킨ZJYN.w;6_Ȁjg͑8vUEĪq6e.sUkoL|A.%CO%NT(GdJw&D"#$g_٭fRE*t+ӍlMQ)h2yB ).7~{A]K.*~A& ŀH.q+'/ N;-f݉ʼnz {c5Ű! ߆ac}U|rsKTlbs697Gos30:sJoPLS>u@!9+T _0IoIQ(cplWkTz~?Ot9xCF0B# 7 f6u2wZ(h8炂XZqI+Om]7f="hP\A&f2)x1TXv`5NKKm-oY%O/ (%Qd 3TI@Ƶ(9KY'5{],Z`m{-U汍Fj Աr=3EjqX Z$j"!?BWo:vtCԼؗ'?# 26?^ mQB7h]{NMu૴t'%O E!Ε;RBKEM]gQ8Xr|^رɹU۫vɟ髛I4>WIxC,#c_1d>XX&0'>7ޯWe_zKwwb=apr>.>,7'DɍvML~pa(w 2cΜy1Q]*BgpV.FDD;.jg?GR_|]JPJiFO\CaYn1Q vCidT ڳ©Mi-ýI|L9Đf*w\7fGϥ84|Yx&P vl 3cZiL_>=_;R%2`V28@=懀Ri4O]r_~1OTA?#Mw#h~kY~^^dwߗTDSy8qD.%afN{}/:9H\riVpTHﯙSV{-N } ߒ6:lZ7 p,J HI >Yؙmy@|=G\G-Bɻ@;u HbgR 2lNX?놬c϶9yGvk\wUJΧ *"<Үfp(݋0Q% }& m{nf{o-q[ /ok@cW_ /E$ן L:zJ?]"nc;e re6br΃AQ`q`LUss?֗#xlSWvjo<ΛO[ ywC@vYI0rV7=x~cSȣ<J[ƜT `yPb E2w%S sB$5ˋŵqq;T}`gv:AIQX!Av:=e]8ooq^Ttʐ{KFGa݀FR{iӇb2l?&{%{.{J*9w?%{] ~jF[Z.0WimFqꊬ{vR1$Sw2}v@wm2C"KFL%i9b-nX#˧ Κ7JK4R-),#Z`Pm|To&f'vsO5YH&M*,rX 1k '%}H٧*T>xɜ ]WKu h+@vʥRmpn&/91M߈kLB,ypm(8Xs9BC7i e=8{;CuAw#n$}C߫ Ҿ_Uy|WL+aˠU8P,Kn=sjBdzbź#FJ *%n{B˹"Lϴ?$kĉ!'P}Iܸ\|ysi9Bq:ySmsj+;k̇E ݅j V^3&vc!͝.q}GISOc^ {y[ |)9h7JniY'Ӗ Oy/ag1U[CLbh fCfV|&W-'D8]4qoFSe,)Ф8ZWGT?*L%5``٫̹Ɍk>:mީQu {hOHEOzI&+䱂oA^EQv>xS_Cy{ _9Ki$"Eb ,Ggs8B+1$SWbEZ9s,i2g&XLo 8Ɇg cʢ?ח|ژ26A6oFϧ&U&gG אsuSߏ }F~ّN7ku}!mN1UzHJpen^ԅE _mJI%8i+:y& ;Ԁ4kf`FDNV2Y)9H VZڅGԄMJoL^ң́"0}ԙ)c JgVbr}44*6Kӝ3>e$%1>adK>ws+ѡRWR`כAt,h8&=wa}Ԋ!VͿr|7.ݝ<|kdv~ᕜ2"neOEσCc$dh§M!yqU>! /s_QJb3@PFuHh4[kp\lpX@ p}+Es6EMPI&-q.7*9vco#z7<522#2liu9- G/X'N.YFnJ\c9 ]$ZQg*!ZvUN@~ (̋+ o|8&}O(UyGb@׎NiZK792C#0B/83d QݕS,8pnWxqd TlW N4"Ȫ ")5D'q57hػX6 v""rv"Q껰Ƞ]pP̜81 _8IE+0$Hhꧨ49ڴϫ3[; ma LmPpSw) !sٱs.um7vZ\$SaViD! p8uN4 <_gYA7S 6$=m7 :~ېXbDEß`r IENOBm03 TD0˲h1:{VbU|b2y B.-W08ӄœ S<̬D<'lgԅ. fU]lCxo܉M?u\p<^cbv~gTO o廉ނ:fF)wx#'yƯ<}?Dh[h&a>&Wrjۗ Fu Ih<Y ZVEtHx~ Azu+0ișf{`nې`rֻ &ޑ! .p N[c?}<q' d7ӽ͍{  }u٫hh(椭JQjOY0y#{8*DY1'KI-Ny$B_Y>Iz5 q-Ôj.'kjx\!G { 4aOQ#`%=hRb۰μiR474ڠ0W]'Q/iKE,?&bĆR`~3ˆT҈kȤ@Oۡh%̶me=d[og2MM'hF ԰z F||mo1??WZ.v! ?/giyY)LB=}qaj5I2xGρhbD;wn y*hͯF9?X9:¾\7fZ-jn aKN=GB\Q`H9sAEF:D53[ȀT`س9L]?,DnvIl̕x1nVi[{3~RN9 N/ Jd1:Wzyweh@%j8$WѨ\< gm<6@vd [[8i|:8FbLϩK,{Br,Z/{292x(k'!¾O@k5o9J]E)[[KY r'!*6:JC ''6UΑ{].l|bƆSӬA2)䋁iA>ov_i,Gc"ݱ^oe'p||\SM!e߽Z?t `]. KGE޲)Mn^7+Jsrϥ{>=6=la5iExz?t?Vѳ`t/F,HL)]䘊ы}"\gZ?܊ÑQ%afY?Ijz  `i¸ʁ ,H}5k'ܢdnOO|ތ>6;|l z$0k'ByFJotɐNO-*s2-{fkO?7Ǹ + f,ߊnJVJVu9/#ojxt}3j1Lo~~i\/LMPGkqZS@C :$]Q) "J d<}gS~@V{b_\saBGO1e9 YAŊUIysU0ekɐ%Is>5䄤+_qňihvb!\oD ˬYUrjȔ?2@l_.̩iR5MM4+u:9W%hOLB\ C0xƾRFP&`eksK{v+b;L*)wg'LrRgXaN Q<i6aU%ZFxԔv`vk3e䷄%YOB!Xb9dgzEJ$.7Gu%x5}thδNq[jANS}t^8le(): s@F'G;oX7_ +Qbl+qaT<ШEJ`ӥϘJ 4}NoL O=Pa椨$(UpzigzZCz3, {'PgJN! ƆNAC?OJ?}1|wȒei.b `R8TD0%ԇd m8 (SbENT^f4'j$B3#N~"&Bbϔ={z)RݝH{CxC(o@FV[52]_dϔ s`L[CR^M=*s~e\MLp%\!j?{;| D;{̍P|mi4:0`ޔ[\qŇx g: XR|3V2ȍ)я=5HB(U7rC 9~Z?V*;HCʛ|// .ZA˲F; {"4Y !#&)BHH^DԆ}^e\SYc #K͐ K?uf7'Cބ:2‹^ E /($wTUt_+sa&fljɶP(hTKt*ljܓ<SʑbZn=Ɩ4GZRBZƪkӴvHT4҄)Z? gg{G3$ 3-RޑfYXg>&6=/z ䷑EqL)8E8s%i8 N[6963%w<}?YaL~x @;Tc(m˫|0Ҕ E yB"4h&hy endstream endobj 78 0 obj << /Length1 724 /Length2 11614 /Length3 0 /Length 12214 /Filter /FlateDecode >> stream xmvePͲ5!Aww ܹ9?^3';>vo\37gg???y̐SC|%~L2NOk0.C.Nt^aZ[]yN nm\7PĂPƣ( -|֟Uj /`4 a.,Wf9u*Ĕb2.m؈[7}G0Ę .0 rIMhdYPskҊw`P*{NKo! bҮ>SkmuLr,sۡm'3} + v)A2>ju[L⬍EZپ|`x_I'w~xVc3;oh@ MF<Ka=ϕŵH ;" Wd=,,{]N;~>v@M|n+]BGviK`ٳYpCBByWF$O\t& +Iy fg@9Cqn/?CesU_2 68Vċ`;nRq9vېHh<x]rÊiFأxڸ(ܦٓ/5\ܜㅃ jLK[rezSC&i 9q^D?RPR3IvsEIh۬s)SϫIFJ@l:ϐoPKjIuj''Ǫ$}rJGu5L%;eZ.)#$ bTLζEiN~v e%oSןr+ Bo\S|ER J#X03FފDH@d*6l/ }Fe;ć7lͶ> Y';siEЌ3hZ_pHW1m;][U\4ѰـWR;][~߾ O=l"eǿ  =oEqG?֕]cG;ߠ־um~GS@F/zϱ*?vu:ښ E|π%̭٘L/d\m5ZIx:AQW{~(!"4a[h4etHu /ͦO#Svs&jR ő3`7u9g~ĝ9A7%£7{e1?$X,滹e Y&-Z4f߫O#m +ܗ̕Ϟ޸k<+3d(+&\Χsyo2O B oU=v/`j`vM0Mm^MC/|l}/}=elb3=J1d~U?}ug3?ZjC掐A(' ),>`0=sU\L]EF_93:E?ːv>@/(s`QdJkkzI͜0BUD@UVln(a!^L&و HNRP9ڗvHg hQN@?0P<5"X@%8LĈ6ISeJ5s/]GaI8V:e.2tf <_uSk')3?E>|hrb»B\B'NrCKgY@\t@Xè_,I}F%z54n)Bd; |=]^i"nXģ+5Zq}){[r9Ö)BCkfGmb0-D{ޯHBҙ/_RB7H>7^AJ«htL)Z&H৒αAQy**fɷ>cm)Uesy#ηT9[Wm\:Ŏ qE/z1%&0ߟZ mvKk\.ΣX@{;EZ`? ޟ K6e ]F>hOQK>RȮk#۸g|=h.]b1!Rl*5 E=2ⶈ%8D\$XFn[.n 7x׆Nzٹ + /kb-Ěv>3mMը U]^'Qu=bCڱ1~hr TŊU-jOFɞ5.H==؂:ei(?vh4 (sS'P(X:y~v1\6;cv=ף,Gb?c+X{rx1Rj%8s5 ٴoT X`YM}xz';%v8UD4JR\ߧy"x{`3K i ztH 0` xgDeL?5MW#!Y٢.a ZqvhJMvNy#p<92tig@|Äu0מhJbbA#[ZBXdeJ@x//-my3qg4gljh7@=}5Ȏ/cOEi\R6E)d1(&ۧ92AxBf|Y28D9YeGJO)4xpd%TKMlEѮϋIC?q\U2|V;WTH< jQu9/&6ŵwƋ{ڗVbKZ@ڹO 9 0s '}DaP=vP&eV'Έpt}[i\_cJ8,qѭVq@Q1%7;wBtA1-,Y[?VR%FQ*ỒuiU7^߶OG%gYtd`0L-/~?Zϩ42k1fXF#4kG>1'z[p\Gb1v4vUo 2i9N:*{OW),6®,F IFf$-2.(}jr_`~9G 1izrPa&TdFR3p`Ҵ0YE8"2xMUurUdz*?j3i 3F %FE8/1ܻ QaGc8{6{[aDZ=|?ԙ7XgKLt,xw#'{ k}Vm"A?N̤oئ y9l'vu«Ж:ƵVW[ޚѮyUZY+5cy.<-tM#HX8忇{/[}0*5:txh+bX@}CQ,BƇѕ|Di2iXpi-GsC`9^]eN-yʹǛF|CnC|!W ƽVB,//y3_l3E M#>n>G,~;0""=-JTܤ_{*hWTN\Mɮ-lKl@y٦9|2TN !j:#{^1I5S^_aV3/siVg).Uw+R֑`*lU`輛2)qH/7>TJRmS✊^vDHc2U=9.Ryd~w>,7Ge]3 n^} B`: |XXrJ2B9i FeX k 2^Y|AQTI)b:g8X쓀@]ڡeO9s>ܫ'nZaev`>WTU^:gh?x@h}]u&T" #[#wveڵ`+ZKZ*mt()+A%m#\v;:dMRD6 _d` 0|a h3M$uE- Us3柛[oh]$dBoư9iQaKSL @Rg;[]lwE 2\BXm7f $K_eT԰qe_ŵclΒB3yT%$>2fr'#}0I0ÇH|@e:=ݔZ qq[y (^6Hã!5zgf\Q`ޞN6jXGaT:^ҙ)ipQ?NzXSJƎZM|al7 @FloQtoiSl%_WF(%)E(N[Lj7Rj̥tH^єxmj@WNIE"-<~b62_CJYﶓQ*zؠ4%IX릈H$Dž眣bW(z6Eiu0@؄s",}r(FPpN.Zev"jGMPZZN[t*IYỳo1G)g+;,>W0^yXKz5>vvQ u3R7?@ tK3tw&Y{`߄`|8[< 1N+pT8* AI3p=h%4ULy`ĤE 3E)6Б:Uui?KnV`#O(nW5NtEʾZJD,hY1Yr$ h߱9L -JƫXaF g?(/#!Q ¬ՍxPsZF k `H^Uut/c귵=2@VБHcJm< )W_VxurЌI؉7“Xa[ĺy^Ic<p0Q5[oZX@YܘT}'PlrCP2.QHMZ!5NT<g]8UѰ G-={mӓ= T*rn6%2~{R|3 qP}: T9>/i ŶZP$ @>DŰO筺 !@MfjIy^M,>i^? /;j>?0 qG$B  ;0ˎ9GQeK),l4j7 ?Vx:&xÈ[^^ 듥u*۽m]:֒Z)Sjp _y=z@5xh}ָOoTI^c߃-=( E<4: ?EͱdzrϛUYX\EN)`8 T8# Uw mwy˃+GK+c\5Q?9D e vB}{S5og,\<@ՙ~9C yqv*eL["y>.Un=-i;P8=9/\[@tZZF+7& Jjdfa,gБy]kBU{o Hmp$Џh ~Sڸ&k֍aeCNxkVq'3{qR玠-6dؙ߰_QE7GĬ"&0P.o0sCmaZ`3(5'NCb=6-(5,zßwO:7[PAqz(tͣvlsQn 7&EE'U!>J 2wG1bN:Ҟ0"Jv p҅ZUMg>PԲ} VOH_n}1|ilE (`̢Jࣔ7G>`_uDY| [oe Anl6ҁUþD:Fִy\sꋈIUi'5Us;HwԽM 6HJ(Ox6Fcр]f8 'qaZX{Zf0TdmM7&y}}D߬^rЁk5WrX"4g>"oDu3yNχ/K!|H?U sAE_T2ҽ\iF]p&UAb}1 v0L?j$KpMO-I,-}U3z~co?-%R4Cu:m޶fm{!0¤UjvИ mo`~eo^D슠5s>³'?;ɟO}]Tܣ 0ԟ8<^3;q.WlпpGfJ{EO,eh9sOclA+- xY~j峨EFP>+F{rLE"V-zk;5!mv͞0^Pf@X1U0=] ŧ1glkX6Wm2]Vj7IO2bhgSf>M)7-Sf[LYeK8C\aC r$OMض?Hn˪t4.]0ݼ@5)is<]s;rQ ZXMT{ʫh$ֵy6ij!`m n uK~sDL/[&!ҹ}F +Z[-/f?H9 ~Z(yE.!Ɉ*ׄ;q\J3Rɪty<=zM@%B$o ʯ.349\^]AEv1A<%e5m R\" )ZCX͞{*ԓDkr~ԐDn[AFXUmcXyD;A%)]mfjgPNJ,dUķoq8m#a"m E>ƨSsH_;L.!]G$DGl/=ϛT6d8/BRƶflisT[<A[rjICf'OV0=Ё$U=,{۰B>[ |#t׫:Ɨ,PWlOv.~{じ{/zDZQl͵W|展QtY*}J=֌BT1]?##S/xtWǵ}" =x 03PrN rS9r<)xa{|cg KHtzV7既g.+[9[Fwt-?z"c䅖VIjrِ̹M.RZC}4jcI&Rt<:(`j.^&ف# 6BSeZhcyjZdg0HD EW Wj] ֜<4ADDu& |V] `SnI;n.o;E!^ag.U8_.v㼊OUMw.]7Hkq_ 6xJ((Y~x.a*+NQ2ԗ͵9 9LU-ޱw I+6đ(H%l]!@"ך:S׻#4'b'/4KCY!74y:6P!̘W^}ySjKU|y;]i|BZ RTmpN9Y!QY~2p)ANČ|vz ,=T5g0'?9VAR%I些c˄|vyQӈDZi:o}T? R+{~cArYwdoMX `O+ؾdNy8U d$OZ2y*:*0{bϞEhh-w?7I?pZ1i <:'b%I [ ō\ MnŶ晖_"Xϭ_`b/|VO5AL߼V|6jƤȔ qciP ]B}+1(f9O)6Cxj47f"?&0`I$E<#S7%҃; Lzy'Ri5v6ED 7su\:,oxaɗ 'WǗ݁2&3 ^wq׈ԩC)W`r֍FY+C7hj-ĔYooG Wв夆 endstream endobj 80 0 obj << /Length1 724 /Length2 10870 /Length3 0 /Length 11455 /Filter /FlateDecode >> stream xmxcfͲmiL۶mۜƴmۚӶm9ܸ_ԟv\?*69 3=3@YLI KN.hblag+blP7M,&&fXr3ʘ$@hacPs06𹺺 :08|gIln06+hJʉT&&#k c 5``lg &'غ8:fhgUS 3 mmxMUG#Xff`dbfa /$mMN]S+>_@ӿlkk9C#@hh P1YC5!l A[1;e$fnTp뷩_ɫr&-{@;[k9o'Ǩ),@,jkl5(;?eCg:;Z5!LZAsgг2sXY\>G???dbnb hglZ+Z0SA;3eJ 4Jb{O0`Ŀ}%yDbp|"8\w̷zU1.\\ X*9mu%Pf-#ZʡE9ڠy3nϽ8.%j'.myHяаܠm+r}0{v5`RaHxsLCm&FP Z]j|LP>j * bt<})p}Vٲ:B,5zms._$躎!kVhO |Q91Ǭ ,k@}NH'ޛUFTqB ^$E?56+q䉯6h>^㲮RRHcAl^>Ga!o(IFtaiN7K&kEQ~"UGVg*o=&OG *;|v:n Yv(O 3xjgo q ]6y╼^(GMZyAߢKzi&SvKj|uxׁ k>+JcLϐس% 2ZuwCm陱TUsHδuWnjˑOh*!:HkId>{ vG^*) OU NL"ߛ +o%<2(2nwW_tJerI(AN1N[jB#k0,e ߌ>~Y0/bf]dgz'Qw2ǥ@O# QF~%""UqeYS1 ϱD_# T4䄳m d.%'l]bթq-\ffʍ ث%}˩[]f<džKӷKf};#EPt4K#Bhv6,k VԆDH 7ּȯ6ȰwGNP^a;`)"w7J؃u0lQց~'R<9]4[GY&S@AD%I5ws 0[װSf UOg9NFr '쐇H %1rB΄K6N+DcY &2ٯx8[]6^]uCT"ݔGDbDP^hv6 djʠFml K:@z| ,_}OFlDLjU7M=ZWt?2K>VS>k2g^QJ\%m REm-[_2bb UǨ\̠[SudRu>2RB<$tEDllgla Q#+|S|tQAJ4tm;YLum9q^a-n=N0d'? X聆!1iw^nv"y Q~ L>ߓ,2 ]F!{x N4))-vqߗYn0=!@%Nwu(Xaq`e:-3,jr3"| ,TN!gS"^9nQ]NND)+PeH}|eK]J[ox0AW-Ԯ<7O_ZLK e~ޅEyDQ<.W9M4<"*#jہُ/kUMՀ1-j,UNrGі\5ף6i_$uwjhSW:'&ĥ7HR* ${E'a$t.>zJwX Vk>ᘞou]cm1ĎҭĹW$#[H @4:u\%v6Z+)݋dZת/0-U o[!~58@1Ŭ s6j) }1\;kzp-\i)BeicKÂ͔ʹaseeP{XBfUHUZ]\8=|@c.eƚ#ot۱`O)T z]V5 yn1@oSƔEp߹CSŔ&= 1f C9:F}x-N5>4T][6vcR:O0. V2q^|;@mrr0\#/GGAS9 狅qq{rEc|Ӧ{۟2T}:akOC9]s$5GjFtHNJ@Kـw̏}lwSdEacvpfoGAEGy-"/"_7L9Y&I>5*_B&=}We/O0e;/mfV)^o* ~dS&tpXzUd/,s+80kMaK F^STH/c{UKzRIo7M4IZ@E9$nOl'ʳC>+3zH\U {M_lkW$ؼZ$>u/I ٰ.?=AwFzzjYQE%O g92C7]\ЌoFT}EoV d[r iKz5H͔ߝ*g4^RNwmWx/]o7ʭ^ ʗ~VVý?i^_1f쓪<›0Xoi”ƘH`Jm c҃.1/Ս˹+#hRG_m#t}t\%^9GAKrO>#| waAmS#F}`ff?{W^Ԥ8bVJv k&Ƭ DԳQ1v^{L P&~4qWq>cQ*sTbB* 9@uջ^&+$E_1tEp@g\KK)ۃH5Ls7ϙbQF %0JH$4̤~g3( u8־}y(_- 5"K_=j'6.{Pi{*GH xt&Sį ?%GدA[O܈FpQ",ctpOuQ>txpt2nF'KuBy8K'$ av"޾gS,pG =,"Yڕ0p¦Sfö/ ,4OAߩ` |>< ¼ X4ba:ģZ_(W{x~}tA NBrJ?̴jnUʘ|"'GZ r?3c^Κ +՚JOst(M̧b4<.6(8@Bw 𽐊uᤚcǿFgrҦ?ZD9 k3n蓛hGe#b ) !olUoX; Rce{Bw5OӇJg^^gnAmܱ,>jl>7&/ߺ'f PU^,G&G-\W@l/6CfMiG)&DXDu. 쫲(Rσe2Qm:7Te|sàHQ6}]"Jfz;s\@' u"^:Y0OJbgQb N: #Vw ]u Z­@*Q Rޓxqk8{Xg/pjhdi9ۅѼ*D#YN rC):K;?,1 =J7wEH[(Lr-r5vYqu%=]PdNaO]'$ ]C`fwI)(v*=\o(`@Lp(P(WYl=X7XM0C~+zCBޡ?[ǩf< @ xCCFU}mY҉$zr5RR7 >m0"3d*SC< k&MV[Ĥ^XM_@XW;+LbկXtKjŕnqwUhnA3-| K!0Q48n`nV.v`VQi$aZ"EQ>QueM; pr`] ݹ1UZ]J!m;<Tf'_ ~)p@]Yk WN;AU\/nYz}zPpE۵ެl-@#=c7U! V3/~/#So\ó3]$."w(KڙUYc {M^AHͧ33 pwV ]h{o2P'% E,Á_O\p+U?!Ѻ1y;Rm$u:Clse&fIb&;'4=$YN_4mQ1-Fyd!zAHa3 ${<2?`]ٱxW+%YqܗG`1] ¶Hu=-} !i&gN]|y/V=<L_fi|-qܓ->TqlHLawXwy͑*r|,+g؀װJT+}{UODBC :uG9oo8 \4y!xe}$ Uu@2.=~k : ?qJW3}>+9PS|@"cO-|)ηr%f&MwWcAt_j;#6L`s@1*{^u xH73 NpKKNqwӸD55s嘫Hb85&IOۗ?Zn:2ނNN?%S3訸Z(W CCfh|I" ݖdw;ؕ-j^!"Ż(-gGժc;4.| (m}=Ch^:S\25]\gZd‘?9טYҀ|Lf:UkDYvg~X}TD>VY^tܨ~eb]lT ||_y"E:)PC F:T1FczљXMu?qP/5:u‹"Ҏ9ZчCswz`Ad 5c1|=aXYr# >jd@] B;J/ԾxwR0GM']R=yW>(]@.Q_<'cwrLy7Pb'`Y)6cF|\!kIsov5I0;һwfg|lM]mu2JN]X` >]\YėoYݶo<DufnןC҃J`EEK4)tQ/rd+6vZXlJ4jp%"y,_,^ږOh]#(\㳪9ɂ&A~R0+)nD2<*n׾7mM(/3N[0}:ﶁ?Jy aoJ #4baxȶ#.dq I\_& M9iSbYa3l@E̾w7eSOL[m^luώ#s՞oȨX)JoX/!j7WϹ}@LzQ ӣ?d4kPSMZf)Ҡe]e lA#Ӹ6ɝXE /^[<= lp!j?d endstream endobj 82 0 obj << /Length1 721 /Length2 17105 /Length3 0 /Length 17701 /Filter /FlateDecode >> stream xlcp_-v~m۶m;'ضqĶmx3sgnݪ/ݫW^v=#7@E\YHCF&lfj`/jj 039̌L0dGOg+ KW տA3@.FOO `nekQPԒPJȫ$͜lnƶV&Y+3{3*3? _\-av91U!qyU +O ?l3gMG p_dkaV&c3 +{&eo`l?\C*?l7[[y#;33@`gd_/0\AY[y*Zc?0ϽșZ?QS{[s?c@YyI%9-b&V4r6ﲢbM:[yt_7' b䚸9;ٻfoE2303Y[v0 No +6TYf^A458¹W?h̷{#uBlow<1CZBRiWT mg"vy皱H=ɚ{^+TƇ,cXh/AG gOS4kZxm, wCm`YXxuocl2+SF(<8)̊lt}Q{a1ޯIK ɞ(kk JZ9.` d?=jW'ͦ{;h۟|hIK <]үr6){V˖@cy_wAaE8< 16͵ZSymovXjΥBaQ ;3#^]EhYv|vzK9@28CCub i!ZL1{`jH2bL {TYhsዎ~bBHFS oգ#j^gK10.kHÕ!8LF:p~fU41a×׿yQN F_;x9`ƛ8r&c?p<e=:dBc7Lw!虤KtQ- i#$#?')Se2VB̎d`) YB'yP3,\,s2W"8UQ2xŀx9oZR~VoqOgL0G-F51QRu+:i'Mjs; ; R!2oPv&jllsU8? ֚I4oKM3 O qw~^aq:nMpw/2顣/ig?uԁ`ǯ]5dڒg^kCEXe|LOQ^tQCnB憌kN6"Mx*ܑrJeORp}Py/VT 8>0Ӻ!aq?<bImHR*BZΝ?$ DžBtnz=IgcDX?ϓ[!{{7W| {3nzE+bJ+bf'BJ#)cFCy{h@},#[Pt>vʖZ,Û*e^vЂQߵ1$^>/CP>h =/lfw ISV8T hC^LU-2D [XIKɱjkn* ߤ bB'oԤ9[C[Ex? ZC2 7Fb4 [bق ℰX1$w ۭtb\M~SBcl^!9\^Iƴ{lQ,rfִ+ɌG.ZN> k2IA_wHh WiU>J"to}gJG|]1*oS ^.ED0 -}vKDdC^>;26FРۏ% VU{'/d~ ?TX21ޢ2'Ax{yH<+zJ^w^K\)o3LbÉk?vp6Jt +7vuN.o>,ӛH5]̎k9!?7Y5]%Eq%*5j2 (DZdIhޔz)>ˤW>i GR3J_Spf59V .Ϡj] lur(o3pG N)+r\=vS -I'z J%mk>b%ufpi>17JG):н9ے\ÆEg}Rx0r Mld`SXqsU?h KnBY'٢-ħ '<-%3%.'ax҇SeGX˷xMYHbp.~r :z$! neÔz(P5&ڻ.DU 4X`ua-b:(O:l0Hfוu_Q'`P핾U2,BѮeyW{qiLHQxƫX%B4/ TW*n6bL ';:TQپٵMh3=8R"kػoҔ7{;Ld \bt k vrg1{{(JPSA\k!ߋJԮѺ>GB|9U͆y{VG|VG^$ڙ=J> (ѲEl寧 hso=ѷĦY8qsVI 1sFFJS^ɳ> 8B|SPkcґvlJ\@1VaA'{ֈa@ߐ:; +)idݼ*S-g&>wlc=g'M=uԶ7LfnϹMt>ڜVpl7ʅXK/q(aD=v;fwȓĖ쪵?5NQLNy9loS S->˒wcLEbt*8eqpXBB?na!L }"?f)e]r=s4cU[gPQƷuŠD$PctúB*P!|- Yv? u'1BX.~-k4⋰QT]\Srܼ1R#㇔7"ey1T#?f[_\^(ʤgT?TdbĒy*2wU͂ sl`CbKIs%Ώͱĝ1N"*헫Y(tjJ:t_9HtxeQ`^GedBHKK֘/u7y1;i2_Yϸ =x 9x5 !룴GFNsmƼٵٗ\qKuɅ$RNo3jXt.`M-6ߪsXiŊd 6M#[+O! Ma>#ch:5ROzS3TPdMb,qPmpa{14ά_N3bC Q߾gePoԄe/1/z'A=;~ksR \]2=) 8۾Eހ O=l\@8o%z&\PI3mPPN |UdKQG2L.:jx,7}L5oRbh681EO,0K{k//(6Q %My4,)CC8|5[tu>({S6GN^v!8H2N][kePԼo3@(TxBc{u]ts}|kllTۧkQo">fRoW6=BI+)oTƅq 3ѻʞ/@0MJN; !-Vַ'nIm.V]vJS\":5ZHgX)ZNe,)+`t8N'pn}nVӷ ئ,SLu_}Uei^5=e e7nPG ;8ЮZVx@t|kY?ݘh%N7rg_dU$m;.&1B9vj/ɨA^HōWօhƒ,??nU+<yh"z^4JL1+A5A~xȟNA?\8=晭]GϘ*{Ѯn&3VtJ7N9v߃SDKχ NOW4@vz?e&NTa:epwq.gN,zx؜ob(Q=LQ4gGIr.9{L|Wp,Q O9G&и),9G3f p$N -~0R3LɎ |KᷰY R V >]܈gݎBBdgpN=78 1Rގ JMxed‰]r˓` $9r!Zo  M{'4  T5Dqwla!$&e6W(qutT*4'ъf$H܋Vښz7qۣPs< 6]@mGu[Vڭz&aW9a5ԐAL#qm!E E[R1~f;Zz`(^ߗ; 7YawQ˦8ϴiQxHĄ ƪjR61󡸜oF-ibFydyU:Zύ$7X3Crυy.⡸,nzߨ3c$S 6<%1UG@,ϰJtk 43J\aY(2U'-@05{<;uo_M+F؆#( 9c:/r3t&:ĔtDcC؉l$EeVLGQ,3hvz~rxANI^7ɛ*;dEE u?ܻ@jjK(ci]\%O̘&ִF0I_6\7Lad`% ሻgA+f?X)/:h+T"kEzGH9rwK~Pȫz(MHս/}}umHÓZ<2m>)r/K핞?e@[ ]3^7Wmk'Q\2v]\35M7&֣8+V8\ӰJ΄Q |JxƞxꙢW|t SM(I-Ԃd⳩[W±ŧ@%O% QW^V3 o WT:9g0+SlQ[q&ލxҷ |QpCL#/Z~!CLB8mUkF0E: }#)m`i눌Mmc 9acP򅧁7߫ѷv,#oc]ԖǞֶbt[,@r4="}ʡSxwV32׉^'3,.^(_D̓% l&9x9j`j3ȌCkךzCD\%|Sx#L# RɥXDxzU?iN>T栺,NPs{X+](xQq[mb(:(vesI¨OG!!w}m7 C 4շlZҌ%֓. 0x3sF!66"02gix'_~z[]C\Yʟo\lg?beY f!f)41_M2 WS\gǖV2AFo\MCrh'3AY*_ar& XTq2 j;8uůO'k_ c u=H[{5kOzCI(7ƍjS̞ʑx51~뚡4sr]رW\͏ N< s iJ(t!^H&iiN.}tsIH˖Ɔ+5lxKVD"u]BՇd m"Sn6C[ eםcX0#;*Gڟ-Nfwae9v4R׊4:#MNf!*PwfzT8aL(uMKͻXhe!ωt΋nwڝ8V@ja.aΪKj6f`rgtAq9ϞR쩒P/UD OY@5˓,q[m‡2QݙqVhݎb0`>d7!$`y`V&gTϲ=R.ѫÔ2ںi&̖BB>0V^y!ً d{.,K5<55p_AH]7_HSfYY%h=7J P)QHGD1-z!S6YKpC}\Dȩ(G|0A]} Eiƍv rs ųj枍}.stD)]7c4ө'tst4û}b<7O`[ hV) !x_`n C.IО2 hRq%+M^C U5U/- XP|哆iC-XP4ׁw%0<6En ظLbOCՋDZFl#NeZ@#r3]٭;^Q)'wi|CV %>)qaVc6ŸSK&B? WNUUu -,P4wc7GR"'/c̀) dqdU*y~ L#w ZA:rÔ(@l׳i^R-9(/qNS%g*wC dC~̠"~؃5Lh)-饔.جN2-IPcn厊\x}1 Rte Aq'Pb87Gd=%SBmEdE%(oWL6+8%3,Tz@# #J yݱg6-r>Aםmjn|lq:^|0K9{c%tkK#/5O n2B\OD?`g ٵxǂHG)[.3kNe;-A8`1XLLXpM|S)FO:9'ZW eh]98ĖNk+j4k{5 u`&.w-jǵ^s1Ox7lʴ_V'fbR{8X;(.#ؐ-~UN.eLu{E 0iniDjĕyDͅ(Z`[ny\?dwNsU-Pb /SO]wb%_Y5\r1>Qf{^RNड>4 I&Τ L-F_2EbU5S"Xy2_`PPp5yȩ,4@]2"+.WNEqlmuƸƢG6>-Bo#S.9GYGmjLUyL޵|n ZTe_+*._(IX L7KQT d Ohh-o!б|`w@}ףN^Y9 &.Ԙ@v59`}@۪T/-, WNH+N`<0eiM]O}#55ɺk bh?}$`ru*@ѫ q-K@@/Hq.? 6L\=! 3}V=uDvIsY]d # lj&x-  3icy{(!mYOcd6̒x0 6J F=ӒTM?FuoezSkCsj5a1 ;(7׼1 Q}?r| $, ͫ*6~ׇ@  }!W Xhl͛d{,ZR՘zb}lơ# qһIh p2| {i@2}πHRaRc%~68.љǁBP)h]M憬zRq=@zPeS)D%p0b}0!lk=|?[܋~7C&EAx~>ŠИg4[4S10; #.XqqQ:ăkˡ{ VitN9%S*xZ.qVBH˫ ) tHTqpUV1N?Lν٦#$02C,*7JВӟRP4pY_#ǔ^+Rm邘\~?_.X(Pm2Np=c9%;%:I[RaĈ S3xĮ y幇1!IiKv6r5qЎNaeiLʳwԍ!8í#xe HAҨvO?}N,?^7USX*yQ^< ޺;|)ع5g9:g-]tҨ%<&JEG~Q2&sıHg{@-D>} c㹘֦rC-^?bgebxe ߸xqy6;U:#.~.zQ%ʂ)PPn9JΗ}D?]Dqaʍꠤ-F8n̸}.ʡP[t5=dQ)+&Jj_K0H$TB>ͅHLm]#T>w ]n4ꈴ/M=ـth]"[UVb?N0aAC^:O$N[Gu /LlF"^լ>2M-fh%CLcp 0DJ! m*@--lgCjQ摍dҐ•hBzZrmN eq-t***LNUby2`$ ܲMܟs"T ^SK"xAe@ױhD-D|greՍ+jtFhu=ެij,&\{0KXKkuDw7BA6 ggS'Y~c?Gd,i 76pˠB;Н}}̂ۈNsF2+:|!t * 0hF GKM I/$@`!Zb|?,sv0j& 3S яz&YW;]e0|C7tA լ{ŽątW-HHu5 x%l WԔdA 67ڐml#F)-QDŽUFޟәؔh9rE,w26jf!bh bJX\ǿ8'Dr6K) ec7] |K@aLɤA i0 ]Ήn)݃~^\VCŭ/^{P59$MDY卢fsYAi@q8u,&3oǑXSd..]-n°#I%Ez6AHXܗBIMG`۳+pq6ZmEc*bd?kD⳸1y䛯O@Q/ͽ($[; wu_ /o9Wam$:cN; s+綸c5Ӳ 9!E^=MeW;~fҩ(* Te"d,j]Tco*^PݜLrA 7C@\-A8nz&+yۏ @+NTé$MCT֠Amx8n\3&QFYen7s\[Ý]x߆D{ONq{ѷ:?V}VEV's/O{1ϊ,V9`[J X é*"qVw!Zo|U'ot64l`H{OvoN:\ppߍa\1^}GmPȵ4~^!@o{zf# _+ˏ52(AmLXQ)Ƣ ']-o䁵4tf0Zi?{Nj_.jTTj}jCRC+ @5ŶU64 \̃ʠ+E#:@U^%7ܓf7@q{ +>?DY6J{35s+FCKYdYj~NN"['  8Q.6 ؽ~weT(cQk jf4 Q ΝSX5ZH@SR%OA_3qe2bt[UYΛv%U|Sik #)Kj 8B_i%LG,ꬱ ]i7w7T"`k vY'cDY1ؔE }W`cxh%I8J %;YZGź]Zt;qoʧ f#?4^> stream xmL-)@q{aV='VeʘYc5QY[9(313r~2132 PP;DFEc3/  lmj45sPR􍀖@;5 hhqrrpws[hl p03Aa9yuIYq2@Nw4 2@Cc+{cj02=?3UU 3( 2˭ ,-He\F@C) ?IZX 97_~RMA Y}Kc৵@R(}K u2!HWj}_{.?Y[\gCAYue ?iQ+Ck#)@ᯖvF ;=%i0?H`PBB.tĽ&Nf]CG;;c+ayڐ;<1K4 fjBOf |qRgfwNpDD5oL;g[b:J=[:?/2OabNZ%ā.I#!l7?9(IFᓡNtMʐCcH_ݢxIlT t)(xؠÅBWqjF'>mP;L+uuSm|&xIiφo`m 1HQڭKa=ɲX,EWdޞ@j;R \]r>>Jsn;zs>=D. Ŷi11xL ׯW&ޯ1fbIJ<5+FXSs"ZPUG)҆:a~"1T_7)DjWgSG-o< :4DQ-Hd]Xk^#p~#k0?r3ؿ'`7FE,L3.I=/ ڊ̄5{{Kؽm`HTx3ng7%.R.ә}JٳzG }n20QYxiO٨bF,Dnc'iQ+Yԩ${q@rw*iif IZIvs1wZ$ '"2]WM5JU9OͶzLȟ?>W=ҳBΙS;RƵ²476@vw"DI7Is'R!ѩ߇TO1HҒ8 \Y# ~T6CuL[}܏IЇA@)kdv ޣ+3Ns7H{?ytD1Ivo@{1or#p7~ &{VW[@YSw0t"v;.6'7*mL~T04|y,ڻwhЂ36\jI#>\Y.tTί LaaQbW3w)M=+Yy8uF!9Q?yLL 7r'ߦ`f<º\q[,"}7@Qv)%^M 68T8vދD0vi7 FsVTtlT ls&9;G_kp8׌[̔Zny#>kė"TИ/C`4{{B :uAӬ}{pEW?4K];@&CoA8b5L<^[E-5S'V)]5 ?P w6WS~S8 x[%jtF5n[: ai|#qbdgwc T:z:'MAb#oZů^\ΚmX~2| b s@WoN4z%9g1DZ VGFpL)pz8B,\5UU|R9`5TG5乒(<dÊ "V|uU3c3B3 3!*O ;#}+{\;7="b G%8xJ[]5}c[ 9y%_E? VoF!aLX? Sԏ;qIb*^2eX3m^ HbaOJ6/ڍCiU#0f(5GJE;':r\==!QJ`O²`ϙyw_EzMׂzZ&KoY!AidtR{2ZmtUfi3V7fha2qa8/ K12n(lC$QBRUt2G6 "JqUbp\I="~Kb_aSa޻sr{8Ou* BܻGE4 Xg^/ʹqrO%ʄP>X{෼& _ ֶ*",)ؾ1^J(XWP3 `bal?9+J@$)NYs\9d~k^'Y ig+E~dA $U{ɩ̂a䥴+fi+5qf*u\ [)j>G#gCpjq7j1-5>`7Ɋ'utMFV#X#Wv>7bU& &S 2&LRN+9(ˉoJp$!`ډTnœ4a Byrb6%JA9wg,7NVŰ7?(&̸rU{L#O`VɛO(ThFa˕Ƨ[7CR[-{Q~ GWX?a wÂRM뤮N$t͂ jN}3N |3b=ɴwu1պwJ )_4RE!:sKS_Z6~ e:{yr5 Xv(n@NʚN=.5F7BcͿ   1,r&*88ɧJ:eBWUrb/GlP ׌m@A9ҠkSJR?4]:pe Qhpm?梷<&-ɞ*$@]vk^NLp6u@^֎:MG->b5e;pqՎUmr4^<1?Z6]KL!~e(: !^ɰ&S^+AE?dY;5Gi]֬ի)]qm"k} N@Sw+Agȫo{a͑V|`v.]jHM7y(W[B+Vk)2viFUoޑ&cɂ-iMoŋs+un<#G yвl;'<+6Sh)*DD>5TN(+ψAZ` ގLhGA69屲Z_3HdnB8(ѾќF UjvßS-屵$ŧFѴ@TGg:י+$Ws4J+}NW$ڮ7Uᶥ GB{{EhaήL4OclmZ8*;e?P٩" &w%$ )^' yɂtYmވ9OHbaUCD;yQF#6 }]-_[ykDeK?N` &pҮvh5`Ci䐱@AZ BfPkmo" \`Q91-גH8Ȓ`S ep&;Ӿ9> BF˃@<5|oz;I֫W([f w?882Ӯ ƃ;ARd6*JɕJ:Օ&buqݪi7핻S-FRc]pC/ XI,?FjHh5Lţ.%/&gI,fzFҾD#k2~qCQ!dgc||dO#UN`F2[{@'!L!(('y\f9.ej]CH˳V y) *(ky|ΤeC$瑄4Rd< '򥂵^0bM."{\4%q|0?ebdE57'hRFDk@& p O: dhAش#[zDnf;oB.T9j~I/ (\\c`<뒀h|a,t}J⃩1.:I0݃H/񻱏3v.yۭ`?׉0wmLl; |֤!̒0H:UCĦհk"Kٵ?d9IfH>30q[eC@nO"l:xa ƱS8Q#rrQZINl IIsgЃ:TTLSӄ^fe}J&_gر24F9ex .2"©>_ !>z~b; "}L"Xԙ;F2H)mq֫rweS0I%9(^ fK/ )qy#bk1C Sd(I-p;ڎGR! q,Ć-OVSp6}!I|q &FTCnN" 䟳#*fC&E\!QaykdV8ᢊD%XB)UjE*ɭI"dL&6y/[k]e4wIdo:( œgY#(ڐs۲^()m/D<fW]p`S`m#"OY3KaVxxˋk; V !&Iҏ=$cexce\/^覚/?ħ?5yn@gW"*'-4ͯu[0%rXId00i-BYSO\J#OwuS/)98VQg)?tM˙p ff6G'`-L ACW/jF  ?O ӟ2cO&0M<.ݐ([kx!pT:.eЏn qn-CI{42TDLTnʉ ꎾꟿI}"!f kYu'Es^ug$=:85# P'B-eHq[ح_sI{0v!Bk{.2wLVo*8+x39 ,N[tB5rDdR&zQ%28 Vu]dY@7Ǖ..ίlmUc#@ⅤKķe51{v?"/ڶ)m3SьFp22h9_  .~ &!xSXS4G%4 -bwME{D՞0Q^>Z;[Z f5*VRf|hcY5Q,{ʤ~o*wHg|J\ /9HDe{(W"Y;zTۼaOQT[ˍ}!˸Kec'tpJ`_ d,Υ0heX 1/řyFq4^k"ݥu^BϧAyJܫۨo9KA!zK/5^y- ?8yS{T 9L9s鰗Uvoڕ0:W~'y{8Tàxr$a@u:J0yٺp7$Kâkg_p>Ēב SHRk3v(N>'M6ȣeHWޫ\69$,ӕ)dbe[X됏{k}o;e7"=J)/ʸ4UW{9sПmv w ݄}J o01# }cr4.s7U On [<2u{z;C0Y&nݣ9G:p7fH #Lz"UAo AyX筲Wm!}w٢Idݰts+t'"rD#߈??'&<; G=CeE6sQ_3(U' *D!_zw^@Khn.~\dn-y8a]#֥ $kmii, BUJp:=~ f:چ&kHzVYKGx,-fyBpR_~C)Cj.ȓP=\wnN1ŮI-MV/P|cgNkzܕZj K!cc1JB^eS5[(o_Ȭ)"SocDgj9J'̒@k6CEwa^BF#1jƩcgmů9\;eNr|PD+~z_iur(qb9q Ρ"H㇗4_Je♐jmQX7ߕ7d~Π*$&+Ve}-Y R1V@5;a"nm´fn۫~%ݾ򤆜^)W>lLS6oQ'+F+9z-e]F`XxmP@d=r( gʾM<_ 39{F9iʹ\T!(kȩQx4mԿjJ<'t3a vYf!OS* vD:'ApS FyN]&r4U`*k- /ʛQLrD &/.BF!H@r͉,M%woݨ0Mh>NPjk_)m *Ff`~)L @m`8vrq9z0R#Cġ{GNNBQ~)$)=;ݼN/jlWsSc|Xqb!Iʳ #ExB/KZl^"@@*X&> OQm1ԭrݮphz \ܩhazQ44xM%rXxdI%m852a.K9Esv@ڌ|Ltu' } gЬ_mUzPE%xhtw&޴#GèQlÙeG:.+@ ?&DoyS_VlWH$;p:# Ȱ_[}@j(w'*Ut› iF53WR6ZGgh1e ҜS-9cNwFɴ& -mLlK̸V!WO8^"t!px6"l֧p̥PBmSem77G25s&4SX3{u{jm2?-o*>_~_*|areGk=ialC"\TH@^0" 1 cŮWrh;Ѡ]?V[)o' N *f9bRm7[ФbRzY~q*O[[c5VE}:>J4Sh/ZXG7\Q9-TD=\RhNezVӣ-OA,<ɝ#0jmM9P]KgJ*qFC0؎Qɫ-pWaNKbRɃUo t{ N*ʻۘ8Ģ DJÍ SFSꃃ/bu7 \iuw]( b%o WLgy@=&qvB^y{Zu+l _Sx~<{Tclb`?r$Z]t/(;m4WGkKDpoƙ,h%/콥1T؂|~h-jU]pz{?:-./Φmp}Gkյp^֛Ru k OD gq̺mD'*mʼ6F endstream endobj 86 0 obj << /Length1 721 /Length2 2706 /Length3 0 /Length 3287 /Filter /FlateDecode >> stream xmRy8mBInd e[$kY JR,!) Hly;Ev"ﺾ:#'"! \ Cv3p IzKNΐ 84 "s 8@`p.9ByPE '8XGHxRhQUɁTw@6NVƀY$d4 0) "XM՟A +̋L"F(k+{P@n;JAA c;e'£D?U2WX x8"L^$@ ]D(z.;B@@ѐDdD &f 8|0w}'z:(( ਻V{ρ ]?vK"Cρjvg9e#";ꮗh2lb~_onq4<`?,-LqP9? 4k^@2$R! p 0Z1%FR]g~"{uY[+ԙX7]F<ړĶȔzW~*2(cžFQj?~3,எ1<ޣFko6P7H8u'pSw{r5 zgENݧ$&ιhWNmC{W?r~ȝaXsptG\f21'Š,TݿUSsu𢈼G쵩m:յtzKUn9W&(}o`_c~[5Ue۝k͏6n+q\xjd|߉*R*ިS o8$U+{Euw/_fjú *N׻I2x3f}˳bN#nW6y*tFQi+X&Y-"X.뀢J E*6&&ӛcicEK!_3d#+yM23̃nJ:e3^ $8NKryИmXgM<ǯ$5Q3L.,6|jqHl1}[G?}MVM,ݲlK9W?&S6S)}VLxzQf'cK9[,2wwAC S7ϷH,lFd^h8*g5jdP/_W UơļW L -:Q.!.V8řqf2NɝL~2@GbËT(=#CtR/ a7~9 *4ZJt$ 5}{#sQ7G4NRݾ:{& 9SsO&WpR/( {U8ۻ1\3MNohSk-2ԬrHDYnD۶0,SA&3ۨ|q l #Yޤ|S' ɧVk=bY* Ƴj/wBYpA -dšU؝y^|W"Iѵ=v'>ZE!Vħӓ#=PB{N,&OF^X CHRWc}@ɜ$h]dW/,e"esboʀ YUt$vϲlww߳?PЎ$3*KM⤐OVH(41{vNiGCKӨ&JMcFL yy̼)k\|Ykz\|"I5 jXu#O]~,Ʀ4PǰC06?S{#[^yCfꁔUswsximUBm1 )|C= .b0`D_sJ;ߔEv*Ȯ;K;파MsSV䧆O Qk{E,$茽O'X'YOq Vkjθ!R_W '/Pz+e4dRdd7C\1WtI_͆fg+2PY>jVxu=l㬏WN tr>2]\V[Nx' ;Nj<%MT;AYpM;pe㹷eB%[N,m@݋Bų2JuS^s/aa3HfW=OW""bK甖LP4vnT)\IkJH>=UI 1)a`Y&`OY%S0ܽˤZu:j1pJY՘6Ex:ngYh̵3l܊jQu~w60xꙁ4\䔹~h^ Z{"ɚ$>fKaQߏ='y_6tD=0s?Vᯣ*h٠$QJXMnVHhЁGl3xJuۗ-ף˫!'^Y;BƂp@B"KU6l8=Kҿ:^#&̼7*1ꄋJ VM]9{]-gVC+ OCfk}jB4OAÅmE$35ܘz=Yت&{ǭh&Nf_ҥ ܔܫs;/&(F`VɉjuK3_8~&}#. J.bQIKU&%% endstream endobj 88 0 obj << /Length1 737 /Length2 27856 /Length3 0 /Length 28449 /Filter /FlateDecode >> stream xlpnͶv;m۶m۶۶[;s^ZU&=k-2"1{;OS_t \e1eF3 )@l`d0100<,-\T6l M,m-j6n7777gW:'W>MM.3KS8R\N njgdhPp54X9R6Qv&LovnN.3sȊ˩DUv&\65vvWuJ6+`bi025ovfM\ ( `bjO)R kobdN(SZx&O?ڙC/N:-,=LM,]?fu0VfI/.!,&F߆[N&5ۭ`hn0pO5tqh3]QBB޿y12s89|_p]L\f}ޘ;*5O|%8* #L6尅+{w8@#޽]bxSJsw·k05l[c9;̍ iZ)2^dqpG;q*] ,o8yТk#u=2l}@Z WVښ ڇ"a;n_q[AW[+u G@DorA,}JWFo?TvFݛs{UWסp pݑ#J &{v+oCzEqS{ssbMx>Q *=*ϵYѻ36.R˦[ئI~ ii{T\;#!иy]"A gW3A*%sVsܐ +`*Y#5d yxHʿՏ)|L Ol򲁂dn5Rޔ!uȩScA=wiAh~ Ek;cc \`g/7VuL^u\ymUKm"(ڋl̐2opȣ9#urF/x)A.XgIs V]>yIMȳ5Ъ?lJ4_}{HM2+9VᴔnKz&!n˟lߵR̋tWXR =JT\@l@]Ƚjn>M6CL)"WA;i>Q<-gU^IeN(<ˤ9.QM1e Ɔ1\Pz[\s3gO=}蝼< On> )5ue r+3hKaShj5.p2f XO{~֒Et UC51vT:&9H/+`5yіU׏y7P\+mOX ?atbQ~ߟ9Z髗"+FʤHb-"%[h 6<1I&%_3.yhR^a!npb/@.ի2ΉY~,hm(9~aQ\IWd XP_&dD ,;ΐ!8G+T$Al=!!UvB^D˹y+lcj2Rs2?<JpY="`7 Cܓ],B)=S_H ))RT3#C˻bKZ`F}3Eoᓃ@9hH͏5= NCS< Ԭq}nċҌzm 9Wn0!Q03!"2r.;г?Nrwrc 7+&k)`v509eE4v9sP^6gKy5r=I糙( Jwup'# Ip/j, Z"R[~HIl`oen\Y/orXMT夵a`+9t!}FraGo$Co)Z3tɠh4B(=Ee,G(^Jqf4U. ] !tVa-lgpuht 7xh ~SM#r=ɚ51ak\]֑mv{d#ZtH3{.h)+y\S"|V*\k%&RgR q*~ͻ/j!m7sa$WʺTl{:mDO^lgbخFܻAU"٢07iVYZN)u?)ܟgf4y%.wDKGomy{$Lܸqx1<$(T/z;$hX{= ػߝlJ.̨ Txc fBXh_-ד?7vF$0xX%:vo&&T|̍~"1ٵV6ನN jg;׀c EZ %T=$XJP 9C]<`tsK|w6 B 8ayh(-N|i2 3\gf6TbiKq6VvqF=6H\Ćg/ދ2m7,;^Sb \Vd͆] Eld ó 3?1 6a{yi%f>H X{᜚hŢ\1m7oLw/E]f)6s4-p`5 ;;[O nFH5)2&_0i9nYFˡ$/٢/syM!p2]I K)<(S\ig΃J$|;*: ;cer]Vazכk΅Ly/괸XB k IAOnNmP e~B,z3p۪2.9WX:/iv]P5ьO;`=@!I]￸v geroF;ICtm,vD,kxU۩L!_kritltz*x3a9o;QqJCgI<5A>VKsD0 ٺEEk-*:.ӣc {pNF<*;߲x}:q}PL#ڥ1a\tް̓`]lkʃ@~>*H;#vGB0kCTk'?/"?TIJ6=@#VH\\>hXbsF3[GXwr ";^ul1WfUwE'&=>Op0=c3@@:5_*-/+yv8[۵x11a3%wάk,wzWȍX#5VJ"e5O-hu*vSDzǩf9P48 άf |avehhFV="fу Q]ij$v.Mw@*8/%SτСFbƆ|@$}#`yO@\aHUXQL! tB_3X973T7^$:` (!Wa-g&(3~*YWܑ!ᕕ&#'1JZ8M:^"B\G6oiNV9c;L!FIS=6S' VܵUg <#VY5O"$yՉUǓNec0ܭ??a;xK`v~IZ|9>\qr"?i9XXN*+c˩uq$f+֛ťrՊɘW7t"o ?-IOjPƅ1pL=5ahG+9%xXgR en]33 K8Q .Leg8~/شܽ[&̒T(0/YA }.oZ7y/taU8ВxFynn#R~~ Qt1`{Ќq:LR0p2 -.t˟q)v[Ԩk$ vev!xA)wh(}7G@_)[77u5<y$zXAcDo3J*`2v˸sGmH}&9AɎRVTd'Q~G]?b[J[=9v{ RgՃh4K3 wߎ'S'hfA.ފz1b ܶ:Xд.n'zԞ$)F*ꌝrE w Y0Sxeוksgk«`FngKӬa G Bż0%Hg8EfvI3WW:כэ.^<0K vxH4aq &uWxSP,/\W6䀥#7كݝpWxWq=}m(Eʏo<$ s a4-UpPzšnf7PK؇QY}h60%6sQrLrBee0\ baLw;g#T|DD3 !}NC* ];mlJ"aro򻮈 #_?ō'M)o^l{ARQ:\L8ytUw'Μcf-ZL!/"^z#뀙wl 'tvJN?CxWp88珱RXOPnѯ|xx:f 8T^$q[T+\]rP+%&*$ʆ,mwm}w]OYt cf" &[`|TBz͉>^mΥps%E Eؑ" 1v*٪ +?jZG+SBrPl/B 2\7d1B^FdCJ4!0[=F׸4=?Vp3De^B21?mîG퉸=r/%cvYWOR2l#odSvr95SP:&jajl*3.&[QT-rAG4~ _hHNXt99g:e f9qّT10:J#12TE1cC,2aDu +3;Kxm7蕧߾\!#ŧ6dq@n-&˿YSJq$m){^6{;3@]`KIb]x|C~̦`ZW#(ZW1+ !y8Dw̸ϟeʒ-Gq[7`>ݵa GgטƲ̞`.jV .esAw;PMY!i1[Xt8F4QZh >_Ѩy}nMK~AKide~ںP^6[w0FC:_PeE!S2.sPDm6講8cfKӠIL)GѷnʖT9t,v!YldƂ7yV'p"2oe\/4Afhr"{;*nb1@HN?X,x0nVXˬ}퇄Zm ކ$*AۃwZLָg` m؏}nפUFm3_T@C/Z /C.ZN\kΊXX`?a^ :b=[:LUW"gW/{H~tl!xe >V]lc"f!2CMsNDӃtL|*cjor!dbHD̫5UZqh7%Mů뗂3po#a/ {6H^ߜ#}j[M j)jٞO*4f:$V2YBh]c}E; %)I`1G֩7S]kOs̾@9dO=~ǪV[d*c|^]Or)L+:vNd?u/1n¨.dVho㝥 _=+#'rVag4Dicr洰$K1Mʥt6FTr#DdaTF#Y;r1df $Oya:9~xwFG@Znu,;[e [_.fTՃ׺K\7"XF 2h++BPxx5?Ee7;^5x퇷o 2ƒ({+/HD&n~.pTYxY}xԊz]ނL-+rjd4)$WIyǤPWSHva~w9thB]R ќ0Z@6!#j-iҼӭr#q ef̗G@$EY_a,_LqT-:om8W0Y0S38^>`>] ,r8-xJrzD];BhR"D].-clwZڭ_}M0Ͽn+ϐ,[|_2LuͱߒPwHOx@pT'9v^yCۚEô ~MZ.og Ll@wXX>a~ h%UG:8/!8iM0KXLLVު, TSRRx%4G_ؙbN_1^HVԲ ViE`7_d{^Ngk˵ۃj9o%PPް҇U_ WJ''0\2#H -\Ä&:j)=8Nqi3ϩڛi+3?CSʿ += %|S+prrQ>YNiE O"A7nm.ٚ+oT|qj|9f(fN i+u'\YTG>;w/tkS;!:%uW*~Iˆ!kD 1lPY/oSch>`-7#^rzkV }5A1k{D~1RzC֐_k æ3(5S ?q0/eºd%]E/bpoNIk,.6M*Fj{r'-p &EPA]P~. j!dVPڅi!u(- .fr2Q1[BR;bR0*ҏ@%:%%A3DЛn9^Jr\(8듋HW RٷjcbЋMs*.Ler =qƧޅ H97E zhsUeݟ;xF=f9-?{n~Z' Y퀈5Oűs aGjJ āVwTOnk&e#,jr aG !Ur%wNπE)i&*5~8}XQ P@Yq!pop" h!zS&.!RGt'ν(j-rC53xA~Cw Pƕt{ovN%Whe~=<з7ts2z@)CzBdbscTpʇS1.)"@U6zd\bahh9l>|z 0!5qpQlֳɉj[ArNK*3RXrO vAө E4 w׉:$/VS.V&1O:SE>0y]Yݕ{S ZW;y2F0+ѮNԃr& ᙅ=3飬`k1ߘ蕭!t_p n%LZ*MH,ZBSU6:ndߒ7k  sQV}B$)R"!Z(ouT8}܌U$_Ju 6oOF hPiDrmn1"ۑh$m>\P .P.4}[J.T@9'HD^6ӊqFXҬ jyCJgF7j.ʜq޼|aOn s4#o Ɵb?is- sC&-=S9b`# U*6jvzOK`ok3;@&Tl7TUl$;c6llIXۺ'(cqԬ-;Ubo:;"Ahm6ߠA_.g]kRPGR Zs/\\w}b!BRbfwBCvTȝ ,]H Ж(x|qu\@ Wݢs>k-x2aln#F4/kNz|.pҳAn`xQ$g |ܹİBtc\[Ŧ.՞Z|}w >!<5&˨}_ɍS],ZWbE jR4]um 㞤$)#Y#Ph1Y${;o3A.wy0:I7=19`jԵ_˝9=ͮPu7~ .uOum[0??'?܂_5# \ki;` tl{z?Ab£Ɋ=]f݄Ԍl;bX0#b)#"E-VolX"m#IC:*2%$+2ԛeO2#-MFDNKno΅߀Z^Yu6nx$UdS7ya+^VNHLt{73 ~p5F(iYъOXnsx5lT:.xKۆ~QhOޅSz ~U2%4fZ^mZ6O扼CӞ ĥde{fnQ1zwv>WsrD0vpTtUbU49H +yLfm2B,Dw@G=sS3FaBy=cK7KeMjY-@zwwU$paI^Yrͣە s! I(,k4Dž1Sp)p$ƌcз07%\zIoȪrP1%+1^Sj oّ[ c7nuXMqdҶz: Y -yzV]v~GMǗ_]}Fnv{V=&{@J3'e9(:[5 U^cTQME %YæP{n Ӈ^u;a A ^t< L_ߥ2|Ge%79 2Z<'ȗyڻZ?u?,JB۫ qdJ @6ax~MN/WƛUHAu }GnXJ-vn3-Qnu%hFwOH)X,hmQNڃYEv錃V fаoLWbgS53%ބgިKY6Y+5&]Mǁjucdsq{E*s~ >Oj6P ?[/ipb.|N='ed )V _btk 5D*Br Xcծ?-j3 Y:VR  *L1iS*Pg Vpfv#Y6g˴\2; v1=QaB ['& yãaZ?gL Ki Wa7m )5$ƮKrԣ2Ϡ97mIϡhɽgUjj';mEVم+6$4L~>_SsR&r>)a-|YB) 5hSխL-s 15,jwD.-K1/_2bTivK`ue;IdS| WFZ-k/H*k~@ف;0D'U ^c@u3}#V<;KlIޥC*m􍊚"m"7 e p~ER}!av(UVUuf#B铬塚_ wLPeC"ޥS)Q@G (/V 1$)"20@x'ο3A wRXGR4ZP1'qHMy"\2[{%Dv͉%/ES\MoY)ٔZf`"h;\]>w!7Gp.qQ_yW.#Y `ҝ-z`3V( /#(hψii\qτ U@]}yjlĮ0yy:E=nrCn;홉v({`9~<~4BNIDQC=%ũd<)}`L 1.v%cy=\kǣ.zf?;oh%2/Qf lwUJ->0T*=0fծ!ZM&#a5fDoJ_拉a/J\jIXV?28A v{f/\R;m|ġJwNIgE?@ Ay3 lwRf/ u/oD=7BnEiJA: pҷ`c?i'1@%Ry*C$<.fbuQ4v[66p귿qĠOvGDeQ:=c^~A;9`?4hT K(T1h n*2VX;thc~dO(ȟ䯚˝G IPŬVJ2bkoUà3n@P "h_iz70.1 5@^z%JSv}5sPqM #Pcxv{V in$h5{9cT˗L>N1<~]yj#O4xV!t s*YO(X])"{!126 İh oerl po{g:.㲶|G.S"vTiI( "V&9ʸf}QCp. 0(xl'W'$/})e0y'dEFѩV֕x9c.k5S`,HJjr>-2E7978m;gVtRk}y\ݰ Y[]g$WjQ/{}Kyձ͑X]j3L6b"c6' uǁ †sƚ7pVfr$'U_ :T$: B^{R2AheIvPLTOfRx.({탠br>LD:;Ne#D6HO='T#l sP'!?k"]Kw9wɺ_ds3v V>Zaw:``]X>w Gn=,[fYQ5';& ٮ87(ڐM}VI!1卬rY8&{ rX[| Cj"*\;e?T"75Piyd*^C܉n%ő]ԡ/S5%$DǟJG :5ELKHK`x&$cN3G1م|;VtE]\ߎN 4]F?kw*jjqŒ85g=p\_pJ?.'O`z.d%q<ւAV(kCɡ g'0 ܜr-DjxSw+2w;hb Xahc@蛟žqο`O, rfs܏=pWpn卬Qy\#&;3tDݮ#鏶4LJ,u|E8$Ԓ ;L.$/9vH0-``,$MF$7LЈl1> x[@ٞ5o@A[1/Xaoyk:ժoi;XMm/46ǟ~:.$ AD57؆H& [Fk| R=0Òi.5+&R=}ǜoI}:#,( tq8H7uVgѻE^dFe]KOA KTR L0Ge ׅ@[YE$c_&нЦT4v_?\<#pf:M:Yyq CWm^h!.(Kh[͉Dws^W)ٺ-n'Kc$WuJ堅(8`5 IyK91\p]NpC). Jl]n Ι H H J( VܳL`gDȲ#Iժڃd7qXC@o۳+w\zW@˨P@ٟ' v#4:ŋFB\BUA[RS LR&ijnFL&4>J˪P YŪù.Oq60{!63JOukdP_wȔ:cz{\MX ԥ2$RG)ڦn+;gnͺ)N]nA_Z^˔ <+%64OͦI+C xLS bwHD%eE"P]2r/0حb HZfMj#Mm̂R>{ ߁9Ǝ_a]~w`ƨ+~$ u3zd vM}6 }|ٓ޼L,)O|y`_|{h}0'KʈT;;IA XT ULZ! Mf /{9,=G"3sJ z|YLazr&g^ƪZ1&{;\ℰ7`eݱHp䤒~voσptm`DT')x@~n7XIf%[k+M?3@QX{?NUXꬒ $袝)>)̢"U+taA'^S?\o Z(IH/@_+pM,x@$gS+MV؏7b~1FΖވk{q;>‹ ̙>9z!sĜ%sՉsދ_8 CUE٣$m"sɚ֛&xzoZyGL+} κ*°y2A)`~>@lZ9K UKD7 -%؊D:V8Szc!5ڸpY|Ȼ*S#.w}D|̓4Y,\ܸE@N)Z2~2*G@h|Et4tq&׽k䏥׉{Qe"ec| M0vx`@XmK` TߣV/I_lj&qlL%!,A)9է ćdg7mgyNf~K?gl3 ؆<4SR 9N.uuC|̭6vW؝;I襢?}߱?xVl6X tJȎȺeSR>֟#e~" j :Mq' ƚl-8'$b^-q륩`:(I\^ے rGҘ}1GqIS׳kn+UA518zJ.o VE!fFkjL92"7 :SݛIR@_x # T-a=AM= %J!_&h]*,)0 JǶU<6M9Q[ x=r?%4mc*J+n9QaqYKUO=]m"q{@ZL^/Yq&qA4T$Ԯ5j;i־Y>+Vry*" a?0{}")xp^VJZ@mr!U@]n:wqyKr׳U]/6:$-wvO&XYf9ctDuE%Sn63 LO)j3uϩM/νW!67[ms1f@T G_D|[*ֲ_Cxqi}ty^^Wd`!E L2 b~NelemG g1#j)]u^$R/0_|A" 'S`:>ECcHrBcΞLoT)雁{==tBѹ˅W9M-q@7uЪ?VpNgxg 8gS[|3UEt?Fh[UO6' i?$RU!.rl ҈$teG6#z^\E\00÷2tYz[kgyf>_4O5$ 4&AS& y1?ў9%u7WҠZ!_~0t_lqP2hPpJOϤmOoY-otťM6T "w]a` %UB{܅9pی|0JA/ VW؝\xm|{0J;,Q3Kxf5)?LVp$Fc,ZsYAedžZRꄏ԰Fl`/d܋"^.v #ymFA1 L&6J1 `-Ԛ ^f=v_ ~,t8& 5]L]Rla!Pb@&bWP"3Gѣ^Jס#_q2~Wo6D"'Rqc`yCh6m苮aLZ% vA'l^EܗZ tfGt`duVvbPzP" 9BSJ3},M-9Y-;bu"1dגroF\/*9giuJnIFs%MKSEm8;ZgXUNy O`?Q8^ cۄCR|qxPBs @ҪZr, R/L"ޣm!oes~9APHv]d(f I,pY/2^7>#̽x䟟:$=A*ɨ-or\L1 _MmZs>(!VX"{{=gܑffFif<64>A.R>z]QȼRNOİJ̠S>e0|4,Y$'}<T7}0d:V'(ݴDTv,}3(* 9|N,j)ۨ⹕3[?GH#S?yMg=ES>7-s$U5`D-DFVyZQ(?3 7րáP:ClU)\ttH_>N o:a@=QW=Uy8P?bby_Fg^'K?71N3am\-%3G/qC[Ѱ.Q)[_V젂0 5TEeğu4N`MA 2/#'[չ5@E%P6YuQ=i?MPYŞ!)G S4A_{?F~k9+,M=yuղ݋ZjN<ܵF+NJD)B+R(@Hn\bFM5!ScIW$,e,֨KkF)vt 3@3 I"q-2&uv\ %B'=ݚ=7c`x-B :Xmnxd/PGc/ǟGmPQSRV^f+Mk.;ŅgKzÝKʱ+1G=>f璈qQ/mW@Dț1K*TJaX94;Y6XAF/Pg2B.{v Dckr^BGªaqQavgjS@C)A4Ӈƭ=%, caApyꘘvI.n3N<`㭺O4jyNS"jpq0b!bXk˝),GQoKPRC8%bhXvM`Ѽ@]sssoyuZRqU:?.:Y>^Qv N+ی뺶l~#QR)t3z%D&%< -QhL*aoma@ 455\謨d2*6qcIf$=4 pmV8> %Sʦ3&`_ʐyZݽv DܑF{\Ѻ7$Y]tr=Mcu]46V DX<\:5) )_̂3ÕU(MCfkP(o/K2 0S=aQ@-o]~n)p%XQCtu ϲ*(?1|[W|RN[>/n(ԻC>" oiΉuo`LQЏZUlGm BQFoYqNHau54^ٺA>~!!K.׈}oDX'G9I̒iUvHu@K_4_1aG nw5WVWc;GM|8ASӂR!GJ(ӵ4|N@$7GcP2.-S~ ׮jF5redR6/d`ru %2ٰzC -c5?Xʺ6v\FDQ 6b}ޅ,WZ=(j~\, endstream endobj 90 0 obj << /Length1 725 /Length2 23308 /Length3 0 /Length 23842 /Filter /FlateDecode >> stream xlcpnݶ-\۶m۶۶Ɋm۶>W_?h^s֨PE ,`c!%v25t1t1ML&FR ˜A@&JGO)`fic WДP˩ML m F6KcS;gSJ?_MbfNYQA1y900 #O3?hScuGp,'`bi025nvfM\?hH 015jc#ghk upu1uڛ:?B m-m<!bv🐥?z8'n55tO?&v6wZz23NۛXڙ]N+Zg`@_#翖C {x21ph,fEߢ1ڲ1wUZKhhl%8촁*2#Tύ6吅 v;L}3a)d4a2k q_ֻb[}5MĝKZ$KVyc/8cAyG?8v£8.9J7>u ҬEHHX~. )EaEaVAcfV(ٶ[WfDS>yBx\ًU%]vhpSpa݃,Uxdzjf_B>ZGY+wp箠,ZJ sFEk0`֙xy-J 5)HO9쪬 ;yxrS%є/sπ(R!}|tsPV\y'Y˓w+-r`hϏ|C} A{Md'U߄=*y7> k۳_ (1-ג=CWWOD~s5դ֗2w|=3+= -A h@6涑<\ ʨWpxmva+WyazRE6m/LT'+/!0r "O@wVEB۞Q~Mȸ2sa<\H_GyJLWơKAt9s zP S;m10$0T cTg;|`N*Sgqh8F 8Cܐq_Zi -0?mkve|vݵ =5 GF̔ܟU)dXRAmu{Tp]-"75 7+ T_}-up%g*T~}E32Q25E7b<=/$B`ZVG1C9C[QssNJrG}} 7@Shl SZ|1A) E h}6|uhs\ ZxR9ƛX_-44N=MI-*sHKK鎝T՛.Rlh>풱L5{*M0aEAaIA+M Ԯ@x>J$F̒{(Y٨]H :ʏ&?nneS2=>Q$YyD{_Fs,?;gڌ#muHlh'MX}_?8g@{y gA4,q޽KH!b9F5$!+v\m =Hmu83;;L.â`@MYK6Av[{ڬK)DlUhk:U<26}Sr p;g vi]?bHa,Fg)}xv6wS>l#@Wo#,]z~'5># 4.qY,_5P]}8+sΕg{Zo9+F]B|_fiUQ}wJQ my >?N}0&e{~HE_&D~!;Y׀iZcW̋(rJ[#m5E&H) @-&=]oVxpp]ex7TWB5UЃsW?gnITFj#aZyL/VԾlEv'%iaQ_w|ϥbɧj0Jڨw."ysOt%uklM,ȌV=y4N,"e,YMSԹPB1 ׭^nH*ɜ*8ט<[o*7wM{R_Vő{ sӶhY@Z.7Bu2Dx}|]lق%V˅R桠\Es{:hEu&uu p^1!cWAAh,b ~6Ax J9rCԙM]r? UE\8MtLء頟S-g*Znj:"ΔZ- |]~mp4UUDdGScppP uk_ x+nD#nڝEu>~BYR/v8<mN8u{;j,cn*k)?=M1pU4x-pa*r퓁üa3ֺaEڜ;u8B+7x gFhFEr)@BfJdȄN0TTs^&4r-M8)0OIrF3Tc9=rT.e܀z;\O(Y[\J5ȐTO<`a n3B%K3tFk-m=+m:e7x刪la54@PފEvrD&)#bq,O Kk:P5k8'8WmD7!;Ѽ[iFMW+u0@>D`4&Y4sLܵv)7,)|?X 4_ܾta>oDڸ>3Z"*v is<`&{A].TTm}IiցDз WCI`_HZ?J{v_u%|Xw39[ ,HYd+;{m >xQe֙͒i5-!,OKDICin'@)Iz&lTwrjUa9PRX?K+\e\*qƎy%u zfK3TS (yݟ6 §k)1r`ҹ_Zs RR rtƊuAHLĠ/Ztwm!Iζkk9՛θN}!ۚG54z*)&f7aQD%o"EǞ3@.fɛW٨=W{c褸e sQ4)Z# EN+lA(LC綽Xb%gB$zK, NO  V6s7wվyŮe58;6}P@KAݐ^a3x.]-I;Zb9`l?&νX: #S|9'5H8)n{bR3r]]\߻ dPe „X/P`GZξւl KJªHy0X'-S >mz7,Ø 4-)yS8h47lGcH-נQ(*<\)M!ɻ]<( &(fw} Ki`k,+D<:ELL]m=[e|I4Ч(#R)8맖0 [9MPh8v"p;} ?]iy9k$8e|P6 $/z=nrٰDKV9a]?gw?F<7TYv!9}5/"Xn /I?pr IGw0m( sa(~=VߖfD`cńUU#Ģilgi Jo]pӼKR^;]OU<@sfd[ɂX>H/vóFyD O˺/9Q2:PTy4S/ fh|0[P E=HQ|XsFw10QVa}7$>nDcK`Ͽ 3\''^չk!1WBoۈH+LHT94c~2Q0Ahd&"7q oyVd+̐D͙؃LPgtjq >]LԿԭo@K[ֈ C?0aWD+L<9D?'tYL{(b$Mk30ٴ9Ы^ͼm.%ʉ_ D=/%t5%h5_fjؙv/]@ml d I,b~18pg*9 TaonDCLG“KU_Z~ᡢRд .#%FJ팂.'E`#sr,O}]wzY-| `q5fMe,7ɴm*WMV<FUA%‰E$PxO~`yg)G#w;oR|k餀f" fo#@n~1ͭ @_@Y|LO-?39t>+w Zg#5m#[P/I|2]pԒ(: `9 D79baQx" 7S] zlif]^|yV)h\v>% 9@9ʌZ"] ۍ@F$opɎ>ɑVW+w˧-lFk- nMhث? ]ǴrIz[gx-??mz1l=Jl| bK;o:⦎}V`P6]˪KӹMـsZe^:',6,:uϝ21F;}+o,Ju`:TE>eL lϢwVgIbͯ(\'jKڡGuyEe[t۶p=NE/U(Da2Xj뀐ZV~FpĩSݐ@U!>cgz")шmCMK]ܻ<bN]fFL e\nC(N5Lf/%RD/46 E}>dRn4M@^ _:9V\M$^;:]9L!dWj Yz4Pugj5 J.qM+ }C+2=3NkWSI0jkΊR%NhsIR)s;~!LөM ucrqɩ%[ܷ?q Hqiف'}wb^W-h;K˒8Z+odGmd,6f/M";݀ /)[tjD>͏6_F|jvk?5jt?}s1~Ș)؎N*foe7(W}KhuF/ WB"mP8@l@>nNFpjEЏZvh_MԆuCϹJO50#+ [CS=PL 7nwc|da$w,cTYT*$W5͕_mQs|9qpXc1'"i{ W\5{LF^1Z')VʵۂԲR[w{-q=8833Ge忘Rs|W-TGJX ;P0N2 N7?S!,GKD+*N7f~?XS="#LT%Ց nr^+y-I\vFVl4B,ǻڠ(N;-XK#LL|Xu%ecDNϋVbe˯dyy9( ݢ'r7lc=\JEOhivmyXk` 5/YK p@?$[JO$qێ9[q)@֜hlG5+ x@r U\B{8A7f]H1rzdL@.rgYg4,XLnҚ?+ƟĢ'V[`\߂B]0N>Cn]jρ?Ԯ p0F8_{A#e~= *Ty6ʼnqJ( VJz̭QyIszɧC5 9, h"X OCٱNڕ򠗂jLe!6'ӄ} $GX-07~^tN=6[<>zw#7?Dcao$,~"9l 鿂Ҡl;V@ZG03N)b Y/Zzh_2Wt9cgh耿=8AO%]\o<5=EqѪu\En Iϔ97QWf`}FʿqJ'-+n0}K=ܠ2b~۞XY~GhĊwB*6S2vnvӬqϰGt3!YH|i<8yd?٣F7:n4>%WYh\HֶU4TOu3ǖtK@!뫢[nĶVj-iSPJ㲟+NlAy`0Sxs* CUj7헵+cDpp6뎊mtq6!vf!ϏZ4V'tY^1;vS* loLH}٦]+%F,Q#/8ڀa8%@J&y[YҠX lѹ%C#^LԦ0t:R${&.{{| tfLꞳqTPo:xdRp+Pdk[h?b^>X83^iWĜyx=\ ,:y 6p!L]Kj6bqIQUGUFA?D 9>y|yp`ɮMMV?<&d@⤔+ρ G%l#[Lyƥ,ޓƓ1@ڱE>0q>RitGK;jQCWsah#8!s 'Vy@#ۘܶ_qgN0׿|3{U./@yJLdF0e|}t.N-L?#7Ƹkv.Blx7a7V 5ZEHD`SDMɱ՟9~d >f=\+zr#ےp"HrW"]%4- YxWMQiLr$SOZǜrgu݃r \>@n46/]%%EpGm΂XJE3h3v>sT*}s&fڈk5",v7Gc5R} )+1V dbI & -,nEf\ AbZ?ԡ!%n kbbsя03w܇ hi;V fX/9 U5D/5(P`y#)řrj,vtAZҽͱs$9#vFv%D/L'uU aYC5-mYL/+Ŧ1ue$UMǽ/hDtQuE3ijr-5j*cULjP ~]c({}?AHrd14brԘ#<+3 B1o/qexqlc֚͟U_ Mv+vjtpe}.ƻZp,7Ѵ-4wn璪zO'8]?i$IHbk'D߃|yR\^ib59i "y-hge#sG1B`;fNL*p5[_=͠ﮝ`Ll%Rǝ2;KM g~z#E@b'l(p?:p?$>h"0Ge¥ҁeRd˟,Nޝf\'B@S2Y0oĤa.*vJێ VyKud39$ 4B&+T[-"v[!{!nͿx(7&·a$=X³A2$ǟ>/tNN KscINH ƿ2Niq >GJ9P g.)0pM;yWo" .-63񶝩-*o=3TH%Y?Jr7`#$Sf< "V}E_$惉:^RN.}GVqKJhy |^Ov Cd3zX˘.I|/}G"\V; +]S2IfbC2L~&y. HQ#YGmTG6YUR~!i8혶zwuwLCFG9%'x6Ϟkp̅@b@pHmsO{dc֕>;='{^J%],FXSc^MId|ci,hdC-$lʠLӊM.rJ|AKmo&~U 0 4f9;.$V=o`n8_(](3řR'^ rOQ.&ju.X$8Qӌ7#gцҷ]owm4.TV|<]<y[>RaJZ Rc~ꗜZacvWV2@) xhXNdv#v1jQF|L] ohz@ϝ mH瓒#8:\G >M2(zRsF25XUߥ"зxG uɶw"?&?mPJuǕiR^ { }pzPE|7UpC~*%V-r)"$d˅j(2.exv1^>_jRy-UABK5b47bwD۠؏wf0.{3lyXTpIHDo,ׅ'}ޙDϨ(g8*(i/%U&|GaԟUC1Aт Mxs G$_2o1a:G3qYtWvGvGCMl+<%n.B˽VׁBƗA: Qkq#J QQX51]|\-ByRUۇ7X&}Z* ^}Y)>w-AXg XxP-ŜLB$@4.%>6i5|pD< Uhuq{Nz&&"ZZDzm&fҍd@O;⫂MgbGk/$鞈:ّr IPl!RJ'"-.pNd nt. $2L3ßRXT4ĨBV{ <r@MbY3ݠ "ⴼk׋XPd^7cgƂdF}PL@ȲZWA&^59_$<<=5渻ë>3 d9c*?)l( }sv#:c-f\9tr+s3_ƾ1DIcF])RmҙBSq):ĺ.sIi[J#~?"?Ў$2(hrm;.╆08Pg:gc\:rWC\6b+ۺۻ+,J2V n`V_߯| 0 (dx2^qq+ ,3q^CGuRQ ]pHQ)(_ý$ሆFӜ&t^yUQDV}ޮ盼;č6N:,67 |*CJ] HHZRF#熲r&iu;}N4m*yr&/!lM=56fՠJނ׆A,7qvL4AX''2Jqt7z#x5t. L[ v #_AR, ak$Oiގ6? =nN44ӿspx#( W}. ?E 7[+$c B$k*+ Z Z?RrT@/|6w.ҵKw|R;$xieMϨO]A q^bpEk(2LgMhGx&{`=8I6FL[G<xGfX-VAVsn昋~ucNd~ p`^S?N\q„/v{u- |L#/9!R_wlVͷ3Z:G@.<#BGϟW욨oJБq>+2pdt`kw2k<6;ؼFb/f/vfu\xK%ZHK1 0. .nʕ_*⣬W4hܥP'8ge g21\P:sل&Hc)(5}tJJ|?ԔYޓ%LF&qr\./ sݺo1kBxyQ<":>w-~.1 AsOZu[j qU\Q-ۈWUtVp ź V,)0Red!DPk,ZѤ<=m,M@5ti@$ۋ.V6!4cau6{i%m/]iȥƸA%sΉp~;%1w !ۗ5uĔu@7N9Xl!zPZtN7TӾ\ie9y^R2pWF%u?*H?PjѦ2maq>'DMOtg_,ɀhq2rN!#"յ ~< ISu]ĮeE}<0%g? O$3/~a-V 0L8)_:,{pɷ跒? 5|ە,p.͈{=Ċd4`:uxj飮q@d7,,{mҏZh Hkȗt _~:նLԠ}SLo֜[zȜ_?-=7Z :S1=o8-?ڱo==*Pfٍe$" +Mp@$d fhqoXQϬ08- e+=Րk96zfa& a@5)XŎu-MNyp4TI8QO\t:7T^I7Al 6dO"q{15gy%1bܐ$njO2qc O|wbCD•lsp9.p?1G{EhE qx;[~9,@VyKsW~yo/y%+QY,@MY$]xxlۗoℏY`wz!BP|&mӜg_.aQ2Kh*i ;Gܖhw (9H(I؋=yȘSt ?A'z<SDa\ ~.XwWGϽG Qk22D7G"SǛ{6*iC]S"WnlK1)=W M\<MIc l Ǽ%=YLF#$nA( vCL :`wv:*"7ySH[VՈ$TMTXS$ia˄2 /g@PLAZvK$"9\iFx o)֝MBwY[\r̓M:ϑ^&'=A? l-6D'H{LvkU2vv廒Fޞ‰DdqLkЩ>r~U3LO|Z_#({kcas7VkN-eH 2{NCBLR* $ގn 4+&9wL(\9y`,R&ȩ_m6<9v<6bgC4'pxOt181f[_l{e$YKZEx2LEĭ`@r1e]F81T'ϲ+\•_D.O2ֺ'G+zdzx0V˪m[%x_)o*Lk9Zޙ:eصi!ڮBbJ,2נL|RN<^j!F㉭?:X1J`1P+biRB:_xLg*m)s#_iˢʩR֓0ڴEPQi(Wd*&7UҤZ94'K<2$}SN]Xsrdn;k1 )Æ2ULrcK(rC{qX9!W8aPB)P1*ŭx =5֛D_3j݆IoXxdƹUVeJRBGN G0Ūv [j< lU;vQ27qtO?O6MW>k!ꨝc$9x73DoLY~O}/GAC!Nj)>Oc, 3>4.A`ۡ s9H@P C7aӷ/UvAu;Lڪ\­|<b<]j8RӦtZ:A(TK|ܾA)WA}Լ)xRIPs|c&Hݟվ|ksʳuf -gGq:n|3a- %ikriVBA?kJaTb{Ɏk,RCҥ [:GÖ{4fi؏X3en^۩o tIR!EF -өeGzC* C8JDBFP-*%m۶6۵qm۶mۮΆu}{Wb?߃YLZ;ŋgO1Y0I㴒2Wp][otm.oT2h #jlQwIIځby5s m{.҉ǪcE1C[u>m=Fk T:#Р)gY/n&r*=iҸ$M_Dcrʰi~3xhUTPAG)j~5aB8hQWYE KbϚw'e|: -N }¬E=| F3BSږb$O^Cv`I9$$]2,7鍈M>1"tga##P鏵N9k "ctK+v;,5oc0flo45kO&&IKk79~2-bayCOPbcf ݺ$ ~x?6°FѴVwG&`/*VA< jPy|ud7''0e̫c-}Ě\5'Ud!E_9kХeD G4rU#uդq£?F_XB4Y#d<jCo>w0fOg8! _xlA ; yCRi>ګӍ-k 'R}6o\S^Qw@`Z@v6g Rb1kNNH0Nշ씕e'Kٜ >9-k\*^XqԜȭ/)!_yGoybUM(9P;ʵ;Qbw5hB 9ؚjh#)[$i[Ϧ,pdDSx% ?䵤aWt3l a!9'b}"VEJL-%pd Ԇtk\4NbIPT|GY$FQJy 9YDsYXL  &h7{붯ڻ/2qWʠz[\ 2|ghTN#JȮ<੏D+Oɝv:::rA}vP{~A2ピ#AU܆r ؒ{onYg {-Ӓ[q04q4_#@' có=dl(MV<=mӄZ\6`;^e&4Sju Nܫb>md\t\iFjѲ -퉕JϮRDڕ*Qʺ162:ۊ "Hi{[ǏBNSڵY}n9Ӯ? 2@ӅP֘8ZºA_]dS>h ^\` ق1ޭ zSEs} tsu h 7ݜe*۔U骜F |x;> dVsd^~ 7פ -ۥ Gapz$@k- &YpZ}EN[3Y+t*+sYǢhd9Ӥ| x#ߣ{lRpxJxؗp]RbX~.ſW561 OjO)2f՚ :g ׹Ź !/1ϔ˱CxH*,5'%Ytgk4g݈/jVЄ`G{=u9L^&,mvD*#._~=8}o-Zu;؝)(v\<$mn[Έi:>\CV(C諍\)sxr o"$^e>ؼ;1P9}q?y<䃀ojP qPwABx$m$l#\WF@a+׺MjGLCΆCJ{eU6+m0|4jU]c( *.GkT{}qI<;έJ8wq|rT0Eq4M%Y{U@x \F3Q^;9"~K|p#ptmb$3#sX=]!ySk&TU {p\)ѠB8^UM u!Cu Pݴ!)-p~c~hWֽe|0A6, ǤPnv$  sZx'est^gӆ?t^}*^]8:D!hp$̎›$(X^Yɶ*&7Ɵ_a_A/“Bh\l t}6]f[glc[Fj+ɓ+Xe#q:ɠP:u_% >M/n=XSOOL-0ϽǒT09#c`'u-g3zpt =ABz霼+_}rI՘ q­LΟ Q PT*J%\)-I&8YF^ꇂf.1;n m0cU׾M`QzJP{c/sB=$"iucl@ e v%9bX_y+\wtx"pE^I1Z֊kGj3c#⻕gU& *lpERф</QH4w_bwP_0[]eYKZBI-ϲ겦s e3br6N߉n:>κFI]I~&'7"3(m !fvF[sLqҭ@25 xTW53B(-C=>MtN4 •{ANldK)UG9C0^^+4TkmmpXbb(_;W?PK-xz9A/F,4~%o9Gm}ۊ@:2B&0M:_̊0΅ <{9Zu;phoc&WgG€6y+Ud)b^Ӌ 95g$u XAV,}"zE3_\l^Dg io㰨W9H ޥw~ej ԇh=؈tD2PU"x-7 ZYB"*PA|Fcg4mg_T~64:J<.-wJwXx6Vس5}FW% &6Њ*C-C 9kٌ'ҭj{ l9,(ݭwK\7a`DgQ8& "_iNKJL]VpcLޡWbu@gǙ!PW,=0Q0]w*#:ᶙNkZHaC˽ƕ04ZruIMU$ c%FFqS. D\P]q@rXH3ecu sugM`xվi 31n?8CY7GZ24=nͷ5EBhIY#,_̼-w ԉAK|1BgNqr:s,%kX]d ؁,tf2^F5v(K2Rezwi  twSbJ&wɇp},Ȫ|e`/o Fš̯ozllPB|Gp)T= ~<0̈|FoG=Uvޑ]F2? t2ky<2 }s>L=_NAKA)L2o{۱~2G1) bVV}p rllLgXë`sY3Հ&rX-ۗ_PIK5N/BQ ؈CqO4K&row=)qJYEvsE: wEٱ*u}2Çe,J;zO1!d/DERpǻ'Ɖy>(a.n/|&㋵@z,yOl%#5oT,8*Yd ]tK+Ͱ[%Ɯ,:Dn?&OV+S-TIHC嗢1@'qeoE!쌁IohTC7OE ] zq e'Wf,s13JpcZXRp&Yq7rMwZIO\d zTXLڂ-#;ڑ3m˺Bp[Iq}Y8'mJמvi'=hv"Q[[*"w[-CKG7-W$\y =\oէPڢS1It*Z^p9}[ϭ[2s5\(FP6qI4^pnO 8nZ\ O]R206M9~y""O2sU)̓@}Flo'{ 7L8[LC#ݝ#l2?&B{A^ڎbȑZu텫 eKyV0Q)9=.ƶ]ڍ,k k( T M#9c& K,f p&22T"Zn1[ڸ:̄R[1N̓)U%bg} .9U;)S`^_eН7AnpYo{5&M[΍<`< t뫂~1,((puEG$9UԐD=AJeл8; Ӏ!oտXU,vo| SAQ zij·)!{ ܹmm6RBE@j@'sRt͝`=:  !.$2\f鳟l`Y1w]^qU"ӱ!I`OCێb\D[  ShOqwj` r ~7eu?q@,4蠊zeRzf#ȉD"kйc˙c4Ј)#n҃&=y5?9~+$—r)G&iv endstream endobj 92 0 obj << /Length 867 /Filter /FlateDecode >> stream x}UMk0WhFCۖ,{Mlh$73nw҃ͳ,]}{\Olo$ɝиI}s \wwu8{SC߬Y]j7KF½ Q5&z& h<ϯK)ٔ?pݝ2ZkXvm)85];B7gѻ9x~;a`>W'?y:o&> ݋L'/㫃Bnz_7_t|~;:ذƦoiܰ^\0zu\7g"NFsu_E07H6!L@@B@q\s *Tg ]8 i/nTvc-+>c_ZZ~Z83z3[:ޭ ߬Lg3t3-g B|B|\3gg|2?z)BXIAup*^+&#sU-'H8qɼe5A78{Y-7^=!U endstream endobj 93 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rj.RI73WfvnjNelܬ=WW\?pu4{S<.7զ7K&½tgkqgֳ0;]nL#;z,gS t;enhEOr]ߎP70j,#z7Ngw!X.O cƮQן F`RޗۃS/~g> ilXc3t6n/.XjR˺^o3wPG*X$D F @F@k} 89@FJuFF#`R0JRq eF)kjBS` F5(Z#.9Bkx>w{;E^ kCXq pD zAet 8alSM3?rN%NbQDa 8>#h0\?I`\~KWc?qc.\X7ьO*ezl,d mY50ymȋ,aYʘ8 xAf_14g%cxU>ob쉬f 9돱ncsO{(g1?\֟g Yg 9LsQ.(ug^/u ?L[ V|FV|oV|3[: 3 ~!>CO!>S 33>Y^ ?a!SMW,:?8ÇqG湪N$ոd2}]/pD=tM-Fu endstream endobj 94 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rj.RI73WfvnjNelܬ=WW\?pu4{S<.7զ7K&½tgkqgBgav8;Fsw~/XOϦS7wj}`ݷp@c`.|vj U5gѻ9xv:ær~tHM0[7vL'<]W1Jj;THcuqqRZ*p}ߜ8ekյ:W ل0%1 " 0Z{q́0R0r0Qbkx,+0*NXSk0j9F)u\c?/Q,PXL#L X,cW c rn q9pZ.qJ{&\ k(AIcL_S_S/w": f~R (#c^g!ch"ƨ-kC^d cRɸh Z0 9+ãbLcOd5cYus~C9돡'g ?%>O:ShYgoΈrYgDЏ>[bghX|&}igkgig݊og3z3|3ߊYX/g z rg^@X"R jb&'x>T#<8d0UPt"%~4qDtz~Y#[nh1?R endstream endobj 95 0 obj << /Length 867 /Filter /FlateDecode >> stream x}Un0CƆ"Rjn"73iwWU񛇱=8䧷Wvs5} Fzoq׿pxtXoCˏޫ]3^46:<[?͵^y,"w͙S6 w X'"$B E @F@C6!SeQQ \#h^QsJ ƒXѠh) 6Hi* Kw{=EA kCqWpB zFet8cś-lj_pn8ux \רiEܰpNM}M 4ex0>1Yſpc.ŴX7ӌO.Yk6ᵍCM1^׆cԷ9cXxAf_lmٚ1էM=aY?` ֟BO3ez/XN|֟u\߸` ΄rY}vʼnщ)Lk9҉X׉Ӊѻ߉ggg/>Cn)>_33/>@X"RKj&'%y>O<8d0ՍPt"%~q Dt: dC辉WD7 endstream endobj 96 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rj.RI73W3njNelܬ;WW\?pu4{SlY]jwOusR^u5sx0ZYs.G7fԝ_= S)E~ 2~}[4v "N'oGQ70j,#z7o;l,j'Ouc׿zr<:Q:XTߙOoGB ;ww ZԲWL)\]W|, MHS"#p #>y| #:##0)%V 55)FњSjR@J]!5w+>7+>S} u B|)W|FL| ,B/^ &+jRP׊C8ƒI\U E'j\2wAsGMMD>Nwq8"妋:9 endstream endobj 97 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rj.RI73W3njNelܬ;WW\?pu4{SlY]jwOusR^u5sx0ֳ0;]nL#;z,gS t;en>r8S0qj>w};B U5gѻ9x};a`TG?y:o&ߏE]&AjZu/?v_t|z;:ذfhkܸ_\zu \7g"NyOܵڿB`ilB =@ )U 9yI(J5<T` M55֜RhR 1ڟS(yq( buX& &q,1+N978Nsk`q8 ^8% FMq.5Sh@kO ׏p$q1/]}/ĩ»p^`D3F?x[a 1ec!/1g)cd?4dK^| МQV1Կ'1t?ƺ9Y?ГrYs֟'g)437YgD3\ib-z3zs ,>G|ZV|ƾ3ֵ33qgng3tZ[Yog,g[3 =L3z/gd ,gz)R؇O5_TTV *M2GZN(:pTy 8kn":qw{Y-7]%# endstream endobj 98 0 obj << /Length 867 /Filter /FlateDecode >> stream x}Un0CƆ"Rjn"73iwWU񛇱='$I}s=}}N=C'u]U;o_ϝ>'eP~&&O''3Hyڝ^ S)E~;en!jأc4qjz( 3F&Vݮ=Ɉ>8~;D>i|#7~_ga}>^=(-P7cjȨW1 kl֏Gsj4s&텻 \݄Wb MLS!"q #u!`Nȩ(( LFUjp49cIMh ,hPE4pbvŢ !\΀Ѹ 8!\=#2:x 1v9/8vӺuSqk4 "nXCI8'ľ&p 2<Wcǘ,_8Ϳ1bxb Ài',ymƌ&Q/kC^،1ۜ1q, Vu 3/d Ͷb l͘S&Ş c,Xu ֟_~CO` ?'>ψ:sh.Xgo\΄rYgBЏ>;gX|&}ggg݉gt3zw3|s3߉YX/gKzJrg^od ,gz)R؇O5_qTԼV j M2GFN(:pTy 8kn":qz~Y[rbtDn endstream endobj 99 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rjn" W3nj<4nV~ߝoGM?k]{7[7rSmtɛy=TCA:fzgdf)OS`)?>RTC)s}`ݵeDcc0qj~?t 3&TdDBmq`TG?9N CC? F`RޗS/~g> ilXcӷn<7,^e]׵͙Ssu_U4H6!L@@B@q\s *Cn!>_33/>?㓁EK!c?RMO #SZ1|8Gxp4aj9DQK.h ljeuOȢnE}MA endstream endobj 100 0 obj << /Length 866 /Filter /FlateDecode >> stream x}UMo0+J! ᫊"Rjn"B73W3njehܬ;WWU\8׺v=ߩonTtƓ7]ziTCA:fzg 4R㫧~R~J}6O7}w̭uזSIе(TPfw۷莛n˥?8ޛ`~?n8t/3NbV+պ};:5wɩƆ56}Χ]]₥+U9q~=W(_KdR$| 4hd52HHNsL FU*q8cMMh QEk%RWp gn~ȋCam `42W0A/c9^'-pʹ)pq[[i])9^W5js7 Gb_#xb~ ' ˏ1}cLu'No ޅ0&1Ie76Z cx-~`& y%Q?K'!/h],KV0d 1էM=Ռ3g1Y ~i?'?!>L9g)q:#eNC?lыѣc`83ֲ3#>w+>Cӊ݊͊T_|~+>Cg!>cB|/g)g{!>_|&~'a9K!B>,TGbPq> endobj 2 0 obj << /Type /ObjStm /N 77 /First 618 /Length 3212 /Filter /FlateDecode >> stream xZYs7~[Wʛ*Ybm|JJcr$MLp850xHcʦJ1Fo40#`i SJ0tT1,RȤ :4*$@)&=.Z&Ȕ0$2uXi qD39f0M`S&E@ZZ ,HaY4ѓ*0Bb:x4# RB`"2g<kF[Ik@ٳ`)Ao+ڲL:hNj(C"H*ǼIyL b^I!7 {>2cA ^eY@zVa)K=]` %Y R4:L? D6&aoP4!HK HJ$Y@@h,hF㇌?>3ˎ5<=a~?}R1?8ow'/w忆ej ~R9T X0m/Y$B 3Ŋ0pim!_* ev~;}ӬQE~Of%|R_EO hQS…ׅߺlK+]ͻL &G(UpDmg*RL WSl8F ][Wh>Ƅ[8d _H,+I '&`k3D<Ȩk%Y`W/ =epxr5DH(- } T+*[* puOi2]SqT39S¼o/qQ1~T}hklh:~V&3;ҭX;MU/m~nS(xpQ1royݟv2kȃYjh[ZcmNvY`^^И3*َ?+AߍA=:s |gl; ltV6a9kl<~IH _ɊV^aEx2a )qS̀DŽ{XpYUn%9xAV_YlFzZFUH^A > pDסv+w%~zdIhXXY5]ĩ+cZ Wi[}!bQ~1*#88Mܝu ZmcLmOz[zB tZy*{0 :vp%3J$h7w ?i rq8ñ8yPkU~*uyA723Zǜp@ )I׵H~4)ZxX$LZZJvut L63<$E5$W&m |q(dxq4w$j]8&MӜ|?Heu}|co+ )} %M.gZPyI up!GwNx{p}ɏ [q /.$)?y'J".R'8pOkh%>zǂq!44mYxERi 3Jucl^(8jH9&# ;\&8D8tQFFnB\{>_B䦈:]zL;՜>Y%YgA_L79t;[>fơ_087s?ÍZpx{sYЭr9f'p*[PsHb\rH9jΡC :ܨt8܈*at/97sfaM".9T7sfFH 7sNa܈)VQ^hodklH/KtF:{z0SԽͯ<env+E/C} @sZz }ukuQV?Wb F|Udзxxa-vJ>^6s>O4 䯧ՋY;Gdj-ŷ$ endstream endobj 107 0 obj << /Type /XRef /Index [0 108] /Size 108 /W [1 3 1] /Root 105 0 R /Info 106 0 R /ID [<90D350F15B513281FF188FF20C04C637> <90D350F15B513281FF188FF20C04C637>] /Length 299 /Filter /FlateDecode >> stream x%9/Qscc26ւBB%45+DB(&BPI|AB! hWDDm!)x4H ?dGm Ubvȅ<(RIiq HB!A-X%v@ BD> TBHe]T6w@ԫl] 4@#4ANnEmO%c_Ҁj0liP5fiHR\qRBzK#ꝼo<=t%s總svlb``Y{%1$+ endstream endobj startxref 181855 %%EOF lattice/inst/doc/grid.R0000644000176200001440000001020614773141535014502 0ustar liggesusers### R code from vignette source 'grid.Rnw' ################################################### ### code chunk number 1: grid.Rnw:33-34 ################################################### library(grid) ################################################### ### code chunk number 2: grid.Rnw:43-44 ################################################### library(lattice) ################################################### ### code chunk number 3: trellisdata (eval = FALSE) ################################################### ## x <- rnorm(100) ## y <- rnorm(100) ## g <- sample(1:8, 100, replace = TRUE) ################################################### ### code chunk number 4: trellispanelplot (eval = FALSE) ################################################### ## xyplot(y ~ x | g, panel = function(x, y) { ## panel.xyplot(x, y); ## grid.lines(unit(c(0, 1), "npc"), unit(0, "native"), ## gp = gpar(col = "grey")) ## }) ################################################### ### code chunk number 5: trellispanel ################################################### x <- rnorm(100) y <- rnorm(100) g <- sample(1:8, 100, replace = TRUE) xyplot(y ~ x | g, panel = function(x, y) { panel.xyplot(x, y); grid.lines(unit(c(0, 1), "npc"), unit(0, "native"), gp = gpar(col = "grey")) }) ################################################### ### code chunk number 6: trellisstripplot (eval = FALSE) ################################################### ## xyplot(y ~ x | g, strip = function(which.given, which.panel, ...) { ## grid.rect() ## grid.text(paste("Variable ", which.given, ": Level ", ## which.panel[which.given], sep = ""), ## unit(1, "mm"), .5, just = "left") ## }) ################################################### ### code chunk number 7: trellisstrip ################################################### x <- rnorm(100) y <- rnorm(100) g <- sample(1:8, 100, replace = TRUE) xyplot(y ~ x | g, strip = function(which.given, which.panel, ...) { grid.rect() grid.text(paste("Variable ", which.given, ": Level ", which.panel[which.given], sep = ""), unit(1, "mm"), .5, just = "left") }) ################################################### ### code chunk number 8: trellisgridplot (eval = FALSE) ################################################### ## someText <- paste("A panel of text", "produced using", "raw grid code", ## "that could be used", "to describe", ## "the plot", "to the right.", sep = "\n") ## latticePlot <- xyplot(y ~ x | g, layout = c(2, 4)) ## grid.rect(gp = gpar(lty = "dashed")) ## pushViewport(viewport(layout = grid.layout(1, 2, ## widths = unit.c(unit(1, "strwidth", someText) + ## unit(2, "cm"), ## unit(1, "null"))))) ## pushViewport(viewport(layout.pos.col = 1)) ## grid.rect(gp = gpar(fill = "light grey")) ## grid.text(someText, ## x = unit(1, "cm"), y = unit(1, "npc") - unit(1, "inches"), ## just = c("left", "top")) ## popViewport() ## pushViewport(viewport(layout.pos.col = 2)) ## print(latticePlot, newpage = FALSE) ## popViewport(2) ################################################### ### code chunk number 9: trellisgrid ################################################### x <- rnorm(100) y <- rnorm(100) g <- sample(1:8, 100, replace = TRUE) someText <- paste("A panel of text", "produced using", "raw grid code", "that could be used", "to describe", "the plot", "to the right.", sep = "\n") latticePlot <- xyplot(y ~ x | g, layout = c(2, 4)) grid.rect(gp = gpar(lty = "dashed")) pushViewport(viewport(layout = grid.layout(1, 2, widths = unit.c(unit(1, "strwidth", someText) + unit(2, "cm"), unit(1, "null"))))) pushViewport(viewport(layout.pos.col = 1)) grid.rect(gp = gpar(fill = "light grey")) grid.text(someText, x = unit(1, "cm"), y = unit(1, "npc") - unit(1, "inches"), just = c("left", "top")) popViewport() pushViewport(viewport(layout.pos.col = 2)) print(latticePlot, newpage = FALSE) popViewport(2) lattice/inst/doc/grid.Rnw0000644000176200001440000001026314145160206015037 0ustar liggesusers\documentclass[a4paper]{article} \usepackage{Rd} % \VignetteIndexEntry{Integation with grid} % \VignettePackage{lattice} % \VignetteDepends{grid} % Definitions \newcommand{\slan}{{\sffamily S}} \newcommand{\rlan}{{\sffamily R}} \newcommand{\grid}{\pkg{grid}} \newcommand{\lattice}{\CRANpkg{lattice}} \setlength{\parindent}{0in} \setlength{\parskip}{.1in} \setlength{\textwidth}{140mm} \setlength{\oddsidemargin}{10mm} \title{\lattice{} and \grid{}} \author{Paul Murrell} \begin{document} \maketitle The \lattice{} package is built on top of \grid{} and provides a quite sophisticated example of writing high-level plotting functions using \grid{}. Because \lattice{} consists of \grid{} calls, it is possible to both add \grid{} output to \lattice{} output, and \lattice{} output to \grid{} output. <<>>= library(grid) @ \subsection*{Adding \grid{} to \lattice{}} Panel functions in \lattice{} can include \grid{} calls. The following example adds a horizontal line at 0 to a standard \code{xyplot} (see Figure \ref{figure:trellispanel}): <>= library(lattice) <>= x <- rnorm(100) y <- rnorm(100) g <- sample(1:8, 100, replace = TRUE) @ % This is the code the reader sees % This WILL get run by checking code, but by then lattice will be % installed so it will be ok <>= xyplot(y ~ x | g, panel = function(x, y) { panel.xyplot(x, y); grid.lines(unit(c(0, 1), "npc"), unit(0, "native"), gp = gpar(col = "grey")) }) @ % This generates the actual plot <>= <> <> @ \begin{figure}[p] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellispanel} } \end{center} \caption{\label{figure:trellispanel} A \lattice{} panel function using \grid{}.} \end{figure} @ The following example writes a left-justified label in each strip (see Figure \ref{figure:trellisstrip}): <>= xyplot(y ~ x | g, strip = function(which.given, which.panel, ...) { grid.rect() grid.text(paste("Variable ", which.given, ": Level ", which.panel[which.given], sep = ""), unit(1, "mm"), .5, just = "left") }) <>= <> <> @ \begin{figure}[p] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellisstrip} } \end{center} \caption{\label{figure:trellisstrip} A \lattice{} strip function using \grid{}.} \end{figure} \subsection*{Adding \lattice{} to \grid{}} It is also possible to use a \lattice{} plot as an element of a \grid{} image. The following example splits up the page so that there is an \code{xyplot} beside a panel of text (see Figure \ref{figure:trellisgrid}). First of all, the lattice plot is created, but not drawn. \grid{} is used to create some regions and the lattice plot is drawn into one of those regions. <>= someText <- paste("A panel of text", "produced using", "raw grid code", "that could be used", "to describe", "the plot", "to the right.", sep = "\n") latticePlot <- xyplot(y ~ x | g, layout = c(2, 4)) grid.rect(gp = gpar(lty = "dashed")) pushViewport(viewport(layout = grid.layout(1, 2, widths = unit.c(unit(1, "strwidth", someText) + unit(2, "cm"), unit(1, "null"))))) pushViewport(viewport(layout.pos.col = 1)) grid.rect(gp = gpar(fill = "light grey")) grid.text(someText, x = unit(1, "cm"), y = unit(1, "npc") - unit(1, "inches"), just = c("left", "top")) popViewport() pushViewport(viewport(layout.pos.col = 2)) print(latticePlot, newpage = FALSE) popViewport(2) <>= <> <> @ \begin{figure}[tbp] \begin{center} { \includegraphics[width=3.5in, height=3.5in]{grid-trellisgrid} } \end{center} \caption{\label{figure:trellisgrid} A \lattice{} plot used as a component of a larger \grid{} image.} \end{figure} \end{document} lattice/README.md0000644000176200001440000000056313366525137013175 0ustar liggesusers# Lattice Lattice is a powerful and elegant high-level data visualization system for R, inspired by Trellis graphics. It is designed with an emphasis on multivariate data, and in particular allows easy conditioning to produce "small multiple" plots. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. lattice/build/0000755000176200001440000000000014773141535013010 5ustar liggesuserslattice/build/vignette.rds0000644000176200001440000000031714773141535015350 0ustar liggesusersb```b`a@&0rHse啣x敤'd)gd(a[&1h0XUb k^bnj1BvԂԼ?4 ;<E ~̜T!%ps QY_/( @hrNb1GRKҊA˸lattice/man/0000755000176200001440000000000014773141535012464 5ustar liggesuserslattice/man/print.trellis.Rd0000644000176200001440000002200013070415115015541 0ustar liggesusers\name{C_05_print.trellis} \alias{print.trellis} \alias{plot.trellis} \alias{summary.trellis} \alias{dim.trellis} \alias{dimnames.trellis} \alias{panel.error} \title{Plot and Summarize Trellis Objects} \usage{ \method{plot}{trellis}(x, position, split, more = FALSE, newpage = TRUE, packet.panel = packet.panel.default, draw.in = NULL, panel.height = lattice.getOption("layout.heights")$panel, panel.width = lattice.getOption("layout.widths")$panel, save.object = lattice.getOption("save.object"), panel.error = lattice.getOption("panel.error"), prefix, \dots) \method{print}{trellis}(x, \dots) \method{summary}{trellis}(object, \dots) \method{dim}{trellis}(x) \method{dimnames}{trellis}(x) panel.error(e) } \description{ The \code{print} and \code{plot} methods produce a graph from a \code{"trellis"} object. The \code{print} method is necessary for automatic plotting. \code{plot} method is essentially an alias, provided for convenience. The \code{summary} method gives a textual summary of the object. \code{dim} and \code{dimnames} describe the cross-tabulation induced by conditioning. \code{panel.error} is the default handler used when an error occurs while executing the panel function. } \arguments{ \item{x, object}{ an object of class \code{"trellis"}} \item{position}{ a vector of 4 numbers, typically c(xmin, ymin, xmax, ymax) that give the lower-left and upper-right corners of a rectangle in which the Trellis plot of x is to be positioned. The coordinate system for this rectangle is [0-1] in both the x and y directions. } \item{split}{ a vector of 4 integers, c(x,y,nx,ny) , that says to position the current plot at the x,y position in a regular array of nx by ny plots. (Note: this has origin at top left) } \item{more}{ A logical specifying whether more plots will follow on this page. } \item{newpage}{ A logical specifying whether the plot should be on a new page. This option is specific to lattice, and is useful for including lattice plots in an arbitrary grid viewport (see the details section). } \item{packet.panel}{ a function that determines which packet (data subset) is plotted in which panel. Panels are always drawn in an order such that columns vary the fastest, then rows and then pages. This function determines, given the column, row and page and other relevant information, the packet (if any) which should be used in that panel. By default, the association is determnined by matching panel order with packet order, which is determined by varying the first conditioning variable the fastest, then the second, and so on. This association rule is encoded in the default, namely the function \code{\link{packet.panel.default}}, whose help page details the arguments supplied to whichever function is specified as the \code{packet.panel} argument. } \item{draw.in}{ An optional (grid) viewport (used as the \code{name} argument in \code{downViewport}) in which the plot is to be drawn. If specified, the \code{newpage} argument is ignored. This feature is not well-tested. } \item{panel.width, panel.height}{ lists with 2 components, that should be valid \code{x} and \code{units} arguments to \code{unit()} (the \code{data} argument cannot be specified currently, but can be considered for addition if needed). The resulting \code{unit} object will be the width/height of each panel in the Lattice plot. These arguments can be used to explicitly control the dimensions of the panel, rather than letting them expand to maximize available space. Vector widths are allowed, and can specify unequal lengths across rows or columns. Note that this option should not be used in conjunction with non-default values of the \code{aspect} argument in the original high level call (no error will be produced, but the resulting behaviour is undefined). } \item{save.object}{ logical, specifying whether the object being printed is to be saved. The last object thus saved can be subsequently retrieved. This is an experimental feature that should allow access to a panel's data after the plot is done, making it possible to enhance the plot after the fact. This also allows the user to invoke the \code{update} method on the current plot, even if it was not assigned to a variable explicitly. For more details, see \code{\link{trellis.focus}}. } \item{panel.error}{ a function, or a character string naming a function, that is to be executed when an error occurs during the execution of the panel function. The error is caught (using \code{\link{tryCatch}}) and supplied as the only argument to \code{panel.error}. The default behaviour (implemented as the \code{panel.error} function) is to print the corresponding error message in the panel and continue. To stop execution on error, use \code{panel.error = stop}. Normal error recovery and debugging tools are unhelpful when \code{tryCatch} is used. \code{tryCatch} can be completely bypassed by setting \code{panel.error} to NULL. } \item{prefix}{ A character string acting as a prefix identifying the plot of a \code{"trellis"} object, primarily used in constructing viewport and grob names, to distinguish similar viewports if a page contains multiple plots. The default is based on the serial number of the current plot on the current page (specifically, \code{"plot_01"}, \code{"plot_02"}, etc.). If supplied explicitly, this must be a valid \R symbol name (briefly, it must start with a letter or a period followed by a letter) and must not contain the grid path separator (currently \code{"::"}). } \item{e}{ an error condition caught by \code{\link{tryCatch}}} \item{\dots}{ extra arguments, ignored by the \code{print} method. All arguments to the \code{plot} method are passed on to the \code{print} method. } } \details{ This is the default print method for objects of class \code{"trellis"}, produced by calls to functions like \code{xyplot}, \code{bwplot} etc. It is usually called automatically when a trellis object is produced. It can also be called explicitly to control plot positioning by means of the arguments \code{split} and \code{position}. When \code{newpage = FALSE}, the current grid viewport is treated as the plotting area, making it possible to embed a Lattice plot inside an arbitrary grid viewport. The \code{draw.in} argument provides an alternative mechanism that may be simpler to use. The print method uses the information in \code{x} (the object to be printed) to produce a display using the Grid graphics engine. At the heart of the plot is a grid layout, of which the entries of most interest to the user are the ones containing the display panels. Unlike in older versions of Lattice (and Grid), the grid display tree is retained after the plot is produced, making it possible to access individual viewport locations and make additions to the plot. For more details and a lattice level interface to these viewports, see \code{\link{trellis.focus}}. } \note{ Unlike S-PLUS, trying to position a multipage display (using \code{position} and/or \code{split}) will mess things up. } \seealso{ \code{\link{Lattice}}, \code{\link[grid:unit]{unit}}, \code{\link{update.trellis}}, \code{\link{trellis.focus}}, \code{\link{packet.panel.default}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ p11 <- histogram( ~ height | voice.part, data = singer, xlab="Height") p12 <- densityplot( ~ height | voice.part, data = singer, xlab = "Height") p2 <- histogram( ~ height, data = singer, xlab = "Height") ## simple positioning by split print(p11, split=c(1,1,1,2), more=TRUE) print(p2, split=c(1,2,1,2)) ## Combining split and position: print(p11, position = c(0,0,.75,.75), split=c(1,1,1,2), more=TRUE) print(p12, position = c(0,0,.75,.75), split=c(1,2,1,2), more=TRUE) print(p2, position = c(.5,.75,1,1), more=FALSE) ## Using seekViewport ## repeat same plot, with different polynomial fits in each panel xyplot(Armed.Forces ~ Year, longley, index.cond = list(rep(1, 6)), layout = c(3, 2), panel = function(x, y, ...) { panel.xyplot(x, y, ...) fm <- lm(y ~ poly(x, panel.number())) llines(x, predict(fm)) }) \dontrun{ grid::seekViewport(trellis.vpname("panel", 1, 1)) cat("Click somewhere inside the first panel:\n") ltext(grid::grid.locator(), lab = "linear") } grid::seekViewport(trellis.vpname("panel", 1, 1)) grid::grid.text("linear") grid::seekViewport(trellis.vpname("panel", 2, 1)) grid::grid.text("quadratic") grid::seekViewport(trellis.vpname("panel", 3, 1)) grid::grid.text("cubic") grid::seekViewport(trellis.vpname("panel", 1, 2)) grid::grid.text("degree 4") grid::seekViewport(trellis.vpname("panel", 2, 2)) grid::grid.text("degree 5") grid::seekViewport(trellis.vpname("panel", 3, 2)) grid::grid.text("degree 6") } \keyword{hplot} lattice/man/panel.bwplot.Rd0000644000176200001440000001025313070415115015344 0ustar liggesusers\name{F_1_panel.bwplot} \alias{panel.bwplot} \title{ Default Panel Function for bwplot } \description{ This is the default panel function for \code{bwplot}. } \usage{ panel.bwplot(x, y, box.ratio = 1, box.width = box.ratio / (1 + box.ratio), horizontal = TRUE, pch, col, alpha, cex, font, fontfamily, fontface, fill, varwidth = FALSE, notch = FALSE, notch.frac = 0.5, \dots, levels.fos, stats = boxplot.stats, coef = 1.5, do.out = TRUE, identifier = "bwplot") } \arguments{ \item{x, y}{ numeric vector or factor. Boxplots drawn for each unique value of \code{y} (\code{x}) if \code{horizontal} is \code{TRUE} (\code{FALSE})} \item{box.ratio}{ ratio of box thickness to inter box space} \item{box.width}{ thickness of box in absolute units; overrides \code{box.ratio}. Useful for specifying thickness when the categorical variable is not a factor, as use of \code{box.ratio} alone cannot achieve a thickness greater than 1. } \item{horizontal}{ logical. If FALSE, the plot is \sQuote{transposed} in the sense that the behaviours of x and y are switched. x is now the \sQuote{factor}. Interpretation of other arguments change accordingly. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{pch, col, alpha, cex, font, fontfamily, fontface}{ graphical parameters controlling the dot. \code{pch="|"} is treated specially, by replacing the dot with a line (similar to \code{\link{boxplot}}) } \item{fill}{ color to fill the boxplot} \item{varwidth}{ logical. If TRUE, widths of boxplots are proportional to the number of points used in creating it.} \item{notch}{ if \code{notch} is \code{TRUE}, a notch is drawn in each side of the boxes. If the notches of two plots do not overlap this is \sQuote{strong evidence} that the two medians differ (Chambers et al., 1983, p. 62). See \code{\link{boxplot.stats}} for the calculations used. } \item{notch.frac}{ numeric in (0,1). When \code{notch=TRUE}, the fraction of the box width that the notches should use. } \item{stats}{ a function, defaulting to \code{\link{boxplot.stats}}, that accepts a numeric vector and returns a list similar to the return value of \code{boxplot.stats}. The function must accept arguments \code{coef} and \code{do.out} even if they do not use them (a \code{\dots} argument is good enough). This function is used to determine the box and whisker plot. } \item{coef, do.out}{ passed to \code{stats}} \item{levels.fos}{ numeric values corresponding to positions of the factor or shingle variable. For internal use. } \item{\dots}{ further arguments, ignored. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates Box and Whisker plot of \code{x} for every level of \code{y} (or the other way round if \code{horizontal=FALSE}). By default, the actual boxplot statistics are calculated using \code{boxplot.stats}. Note that most arguments controlling the display can be supplied to the high-level \code{bwplot} call directly. % Unlike the traditional % analog \code{\link{boxplot}}, notches are not implemented. Although the graphical parameters for the dot representing the median can be controlled by optional arguments, many others can not. These parameters are obtained from the relevant settings parameters (\code{"box.rectangle"} for the box, \code{"box.umbrella"} for the whiskers and \code{"plot.symbol"} for the outliers). } \examples{ bwplot(voice.part ~ height, data = singer, xlab = "Height (inches)", panel = function(...) { panel.grid(v = -1, h = 0) panel.bwplot(...) }, par.settings = list(plot.symbol = list(pch = 4))) bwplot(voice.part ~ height, data = singer, xlab = "Height (inches)", notch = TRUE, pch = "|") } \seealso{ \code{\link{bwplot}}, \code{\link{boxplot.stats}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/lset.Rd0000644000176200001440000000141213070415115013703 0ustar liggesusers\name{I_lset} \alias{lset} \title{Interface to modify Trellis Settings - Defunct} \description{ A (hopefully) simpler alternative to \code{trellis.par.get/set}. This is deprecated, and the same functionality is now available with \code{trellis.par.set} } \usage{ lset(theme = col.whitebg()) } \arguments{ \item{theme}{ a list decribing how to change the settings of the current active device. Valid components are those in the list returned by \code{trellis.par.get()}. Each component must itself be a list, with one or more of the appropriate components (need not have all components). Changes are made to the settings for the currently active device only. } } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{utilities} lattice/man/panel.superpose.Rd0000644000176200001440000001616214413020055016064 0ustar liggesusers\name{F_2_panel.superpose} \alias{panel.superpose} \alias{panel.superpose.2} \alias{panel.superpose.plain} \title{ Panel Function for Display Marked by groups } \description{ These are panel functions for Trellis displays useful when a grouping variable is specified for use within panels. The \code{x} (and \code{y} where appropriate) variables are plotted with different graphical parameters for each distinct value of the grouping variable. } \usage{ panel.superpose(x, y = NULL, subscripts, groups, panel.groups = "panel.xyplot", \dots, col, col.line, col.symbol, pch, cex, fill, font, fontface, fontfamily, lty, lwd, alpha, type = "p", grid = lattice.getOption("default.args")$grid, distribute.type = FALSE) panel.superpose.2(\dots, distribute.type = TRUE) panel.superpose.plain(\dots, col, col.line, col.symbol, pch, cex, fill, font, fontface, fontfamily, lty, lwd, alpha) } \arguments{ \item{x,y}{ Coordinates of the points to be displayed. Usually numeric. } \item{panel.groups}{ The panel function to be used for each subgroup of points. Defaults to \code{panel.xyplot}. To be able to distinguish between different levels of the originating group inside \code{panel.groups}, it will be supplied two special arguments called \code{group.number} and \code{group.value} which will hold the numeric code and factor level corresponding to the current level of \code{groups}. No special care needs to be taken when writing a \code{panel.groups} function if this feature is not used. } \item{subscripts}{ An integer vector of subscripts giving indices of the \code{x} and \code{y} values in the original data source. See the corresponding entry in \code{\link{xyplot}} for details. } \item{groups}{ A grouping variable. Different graphical parameters will be used to plot the subsets of observations given by each distinct value of \code{groups}. The default graphical parameters are obtained from the \code{"superpose.symbol"} and \code{"superpose.line"} settings using \code{\link{trellis.par.get}} wherever appropriate. } \item{type}{ Usually a character vector specifying how each group should be drawn. Formally, it is passed on to the \code{panel.groups} function, which must know what to do with it. By default, \code{panel.groups} is \code{\link{panel.xyplot}}, whose help page describes the admissible values. The functions \code{panel.superpose} and \code{panel.superpose.2} differ only in the default value of \code{distribute.type}, which controls the way the \code{type} argument is interpreted. If \code{distribute.type = FALSE}, then the interpretation is the same as for \code{panel.xyplot} for each of the unique groups. In other words, if \code{type} is a vector, all the individual components are honoured concurrently. If \code{distribute.type = TRUE}, \code{type} is replicated to be as long as the number of unique values in \code{groups}, and one component used for the points corresponding to the each different group. Even in this case, it is possible to request multiple types per group, specifying \code{type} as a list, each component being the desired \code{type} vector for the corresponding group. If \code{distribute.type = FALSE}, any occurrence of \code{"g"} in \code{type} causes a grid to be drawn, and all such occurrences are removed before \code{type} is passed on to \code{panel.groups}. } \item{grid}{ Logical flag specifying whether a background reference grid should be drawn. See \code{\link{panel.xyplot}} for details. } \item{col}{ A vector color specification. See Details. } \item{col.line}{ A vector color specification. See Details. } \item{col.symbol}{ A vector color specification. See Details. } \item{pch}{ A vector plotting character specification. See Details. } \item{cex}{ A vector size factor specification. See Details. } \item{fill}{ A vector fill color specification. See Details. } \item{font, fontface, fontfamily}{ A vector color specification. See Details. } \item{lty}{ A vector color specification. See Details. } \item{lwd}{ A vector color specification. See Details. } \item{alpha}{ A vector alpha-transparency specification. See Details. } \item{\dots}{ Extra arguments. Passed down to \code{panel.superpose} from \code{panel.superpose.2}, and to \code{panel.groups} from \code{panel.superpose}. } \item{distribute.type}{logical controlling interpretation of the \code{type} argument. } } \details{ \code{panel.superpose} divides up the \code{x} (and optionally \code{y}) variable(s) by the unique values of \code{groups[subscripts]}, and plots each subset with different graphical parameters. The graphical parameters (\code{col.symbol}, \code{pch}, etc.) are usually supplied as suitable atomic vectors, but can also be lists. When \code{panel.groups} is called for the \code{i}-th level of \code{groups}, the corresponding element of each graphical parameter is passed to it. In the list form, the individual components can themselves be vectors. The actual plot for each subgroup is created by the \code{panel.groups} function. With the default \code{panel.groups}, the \code{col} argument is overridden by \code{col.line} and \code{col.symbol} for lines and points respectively, which default to the \code{"superpose.line"} and \code{"superpose.symbol"} settings. However, \code{col} will still be supplied as an argument to \code{panel.groups} functions that make use of it, with a default of \code{"black"}. The defaults of other graphical parameters are also taken from the \code{"superpose.line"} and \code{"superpose.symbol"} settings as appropriate. The \code{alpha} parameter takes it default from the \code{"superpose.line"} setting. \code{panel.superpose} and \code{panel.superpose.2} differ essentially in how \code{type} is interpreted by default. The default behaviour in \code{panel.superpose} is the opposite of that in S, which is the same as that of \code{panel.superpose.2}. \code{panel.superpose.plain} is the same as \code{panel.superpose}, except that the default settings for the style arguments are the same for all groups and are taken from the default plot style. It is used in \code{\link{xyplot.ts}}. } \seealso{ Different functions when used as \code{panel.groups} gives different types of plots, for example \code{\link{panel.xyplot}}, \code{\link{panel.dotplot}} and \code{\link{panel.average}} (This can be used to produce interaction plots). See \code{\link{Lattice}} for an overview of the package, and \code{\link{xyplot}} for common arguments (in particular, the discussion of the extended formula interface and the \code{groups} argument). } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org} (\code{panel.superpose.2} originally contributed by Neil Klepeis) } \keyword{dplot} lattice/man/panel.functions.Rd0000644000176200001440000002332214413020055016043 0ustar liggesusers\name{F_2_panel.functions} \alias{panel.functions} %% Not data-dependent \alias{panel.abline} \alias{panel.refline} \alias{panel.curve} \alias{panel.fill} \alias{panel.grid} \alias{panel.mathdensity} %% Data-dependent \alias{panel.rug} \alias{panel.lmline} \alias{panel.average} \alias{panel.linejoin} \title{Useful Panel Function Components} \description{ These are predefined panel functions available in lattice for use in constructing new panel functions (often on-the-fly). } \usage{ panel.abline(a = NULL, b = 0, h = NULL, v = NULL, reg = NULL, coef = NULL, col, col.line, lty, lwd, alpha, type, \dots, reference = FALSE, identifier = "abline") panel.refline(\dots) panel.curve(expr, from, to, n = 101, curve.type = "l", col, lty, lwd, type, \dots, identifier = "curve") panel.rug(x = NULL, y = NULL, regular = TRUE, start = if (regular) 0 else 0.97, end = if (regular) 0.03 else 1, x.units = rep("npc", 2), y.units = rep("npc", 2), col, col.line, lty, lwd, alpha, \dots, identifier = "rug") panel.average(x, y, fun = mean, horizontal = TRUE, lwd, lty, col, col.line, type, \dots, identifier = "linejoin") panel.linejoin(x, y, fun = mean, horizontal = TRUE, lwd, lty, col, col.line, type, \dots, identifier = "linejoin") % panel.abline(a, b, \dots) % panel.abline(coef, \dots) % panel.abline(reg, \dots) % panel.abline(h= ,v= , \dots) panel.fill(col, border, \dots, identifier = "fill") panel.grid(h=3, v=3, col, col.line, lty, lwd, x, y, \dots, identifier = "grid") panel.lmline(x, y, \dots, identifier = "lmline") panel.mathdensity(dmath = dnorm, args = list(mean=0, sd=1), n = 50, col, col.line, lwd, lty, type, \dots, identifier = "mathdensity") } \arguments{ \item{x, y}{ Variables defining the contents of the panel. In \code{panel.grid} these are optional and are used only to choose an appropriate method of \code{\link{pretty}}. } \item{a, b}{ Coefficients of the line to be added by \code{panel.abline}. \code{a} can be a vector of length 2, representing the coefficients of the line to be added, in which case \code{b} should be missing. \code{a} can also be an appropriate \sQuote{regression} object, i.e., an object which has a \code{\link{coef}} method that returns a length 2 numeric vector. The corresponding line will be plotted. The \code{reg} argument overrides \code{a} if specified. } \item{coef}{ Coefficients of the line to be added as a vector of length 2. } \item{reg}{ A (linear) regression object, with a \code{\link{coef}} method that gives the coefficints of the corresponding regression line. } \item{h, v}{ For \code{panel.abline}, these are numeric vectors giving locations respectively of horizontal and vertical lines to be added to the plot, in native coordinates. For \code{panel.grid}, these usually specify the number of horizontal and vertical reference lines to be added to the plot. Alternatively, they can be negative numbers. \code{h=-1} and \code{v=-1} are intended to make the grids aligned with the axis labels. This doesn't always work; all that actually happens is that the locations are chosen using \code{pretty}, which is also how the label positions are chosen in the most common cases (but not for factor variables, for instance). \code{h} and \code{v} can be negative numbers other than \code{-1}, in which case \code{-h} and \code{-v} (as appropriate) is supplied as the \code{n} argument to \code{\link{pretty}}. If \code{x} and/or \code{y} are specified in \code{panel.grid}, they will be used to select an appropriate method for \code{\link{pretty}}. This is particularly useful while plotting date-time objects. } \item{reference}{ A logical flag determining whether the default graphical parameters for \code{panel.abline} should be taken from the \dQuote{reference.line} parameter settings. The default is to take them from the \dQuote{add.line} settings. The \code{panel.refline} function is a wrapper around \code{panel.abline} that calls it with \code{reference = TRUE}. } \item{expr}{ An expression considered as a function of \code{x}, or a function, to be plotted as a curve. } \item{n}{ The number of points to use for drawing the curve. } \item{from, to}{ optional lower and upper x-limits of curve. If missing, limits of current panel are used } \item{curve.type}{ Type of curve (\code{"p"} for points, etc), passed to \code{\link{llines}} } \item{regular}{ A logical flag indicating whether the \sQuote{rug} is to be drawn on the \sQuote{regular} side (left / bottom) or not (right / top). } \item{start, end}{ endpoints of rug segments, in normalized parent coordinates (between 0 and 1). Defaults depend on value of \code{regular}, and cover 3\% of the panel width and height. } \item{x.units, y.units}{ Character vectors, replicated to be of length two. Specifies the (grid) units associated with \code{start} and \code{end} above. \code{x.units} and \code{y.units} are for the rug on the x-axis and y-axis respectively (and thus are associated with \code{start} and \code{end} values on the y and x scales respectively). } \item{col, col.line, lty, lwd, alpha, border}{ Graphical parameters. } \item{type}{ Usually ignored by the panel functions documented here; the argument is present only to make sure an explicitly specified \code{type} argument (perhaps meant for another function) does not affect the display. } \item{fun}{ The function that will be applied to the subset of \code{x} values (or \code{y} if \code{horizontal} is \code{FALSE}) determined by the unique values of \code{y} (\code{x}). } \item{horizontal}{ A logical flag. If \code{FALSE}, the plot is \sQuote{transposed} in the sense that the roles of \code{x} and \code{y} are switched; \code{x} is now the \sQuote{factor}. Interpretation of other arguments change accordingly. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{dmath}{ A vectorized function that produces density values given a numeric vector named \code{x}, e.g., \code{\link{dnorm}}. } \item{args}{ A list giving additional arguments to be passed to \code{dmath}. } \item{\dots}{ Further arguments, typically graphical parameters, passed on to other low-level functions as appropriate. Color can usually be specified by \code{col}, \code{col.line}, and \code{col.symbol}, the last two overriding the first for lines and points respectively. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ \code{panel.abline} adds a line of the form \code{y = a + b * x}, or vertical and/or horizontal lines. Graphical parameters are obtained from the \dQuote{add.line} settings by default. \code{panel.refline} is similar, but uses the \dQuote{reference.line} settings for the defaults. \code{panel.grid} draws a reference grid. \code{panel.curve} adds a curve, similar to what \code{\link{curve}} does with \code{add = TRUE}. Graphical parameters for the curve are obtained from the \dQuote{add.line} setting. \code{panel.average} treats one of \code{x} and \code{y} as a factor (according to the value of \code{horizontal}), calculates \code{fun} applied to the subsets of the other variable determined by each unique value of the factor, and joins them by a line. Can be used in conjunction with \code{panel.xyplot}, and more commonly with \code{\link{panel.superpose}} to produce interaction plots. \code{panel.linejoin} is an alias for \code{panel.average}. It is retained for back-compatibility, and may go away in future. \code{panel.mathdensity} plots a (usually theoretical) probability density function. This can be useful in conjunction with \code{histogram} and \code{densityplot} to visually assess goodness of fit (note, however, that \code{qqmath} is more suitable for this). \code{panel.rug} adds a \emph{rug} representation of the (marginal) data to the panel, much like \code{\link{rug}}. \code{panel.lmline(x, y)} is equivalent to \code{panel.abline(lm(y ~ x))}. } \seealso{ \link{Lattice}, \code{\link{panel.axis}}, \code{\link{panel.identify}} \code{\link{identify}}, \code{\link{trellis.par.set}}. } \examples{ ## Interaction Plot bwplot(yield ~ site, barley, groups = year, panel = function(x, y, groups, subscripts, ...) { panel.grid(h = -1, v = 0) panel.stripplot(x, y, ..., jitter.data = TRUE, grid = FALSE, groups = groups, subscripts = subscripts) panel.superpose(x, y, ..., panel.groups = panel.average, grid = FALSE, groups = groups, subscripts = subscripts) }, auto.key = list(points = FALSE, lines = TRUE, columns = 2)) ## Superposing a fitted normal density on a Histogram histogram( ~ height | voice.part, data = singer, layout = c(2, 4), type = "density", border = "transparent", col.line = "grey60", xlab = "Height (inches)", ylab = "Density Histogram\n with Normal Fit", panel = function(x, ...) { panel.histogram(x, ...) panel.mathdensity(dmath = dnorm, args = list(mean = mean(x), sd = sd(x)), ...) } ) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/standard.theme.Rd0000644000176200001440000001345114576262623015663 0ustar liggesusers\name{C_02a_standard.theme} \alias{standard.theme} \alias{classic.theme} \alias{canonical.theme} \alias{custom_theme} \alias{col.whitebg} \title{ Built-in Graphical Themes } \description{ Built-in graphical parameter settings. These mainly differ in their choice of colors. } \usage{ standard.theme(name, color = TRUE, symbol = palette.colors(palette = "Okabe-Ito")[c(6, 2, 4, 7, 3, 5, 8)], fill = NULL, region = hcl.colors(14, palette = "YlGnBu", rev = TRUE), reference = "gray90", bg = "transparent", fg = "black", ...) canonical.theme(...) custom_theme(symbol, fill, region, reference = "gray90", bg = "transparent", fg = "black", strip.bg = rep("gray95", 7), strip.fg = rep("gray70", 7), ...) classic.theme(name, color) col.whitebg() } \arguments{ \item{name}{ character string giving the name of the device for which the setting is required, as returned by \code{.Device}. This is only used by \code{classic.theme} to allow device-specific setting. It is retained in \code{standard.theme} for back-compatibilty, but its use is not recommended. } \item{color}{ logical, whether the initial settings should be color or black and white. } \item{symbol}{vector of colors to be used for symbols and lines.} \item{fill}{vector of colors to be used as fill colors, e.g., in bar charts and histograms. The default of \code{NULL} in \code{standard.theme} results in lightened versions of the symbol colors to be used. } \item{region}{vector of colors to be used to create a color ramp, typically used by \code{\link{levelplot}} } \item{reference}{ color, to be used for reference lines. } \item{fg}{ color, to be used for foreground elements such as axes and labels. } \item{bg}{ color, to be used as background. } \item{strip.bg}{ color, to be used as strip background. } \item{strip.fg}{ color, to be used as strip foreground. } \item{\dots}{ additional arguments, passed on to other functions as appropriate. In particular, additional arguments provided to \code{standard.theme} will be passed on to \code{custom_theme}, and these may include non-color parameters that will be used to modify the resulting theme via \code{\link{simpleTheme}}. } } \details{ Trellis Graphics functions obtain the default values of various graphical parameters (colors, line types, fonts, etc.) from a customizable \dQuote{settings} list (see \code{\link{trellis.par.set}} for details). This functionality is analogous to \code{\link{par}} for standard \R graphics and, together with \code{\link{lattice.options}}, mostly supplants it (\code{\link{par}} settings are mostly ignored by Lattice). Unlike \code{\link{par}}, Trellis settings can be controlled separately for each different device type (but not concurrently for different instances of the same device). The functions documented in this page produce such graphical settings (a.k.a. themes), usually to be used with \code{\link{trellis.device}} or \code{\link{trellis.par.set}}. \code{classic.theme} and \code{col.whitebg} produce predefined themes that are not recommended for routine use but are retained for compatibility. The \code{classic.theme} function was intended to provide device specific settings (e.g. light colors on a grey background for screen devices, dark colors or black and white for print devices) and was used to obtain defaults prior to \R 2.3.0. However, these settings are not always appropriate, due to the variety of platforms and hardware settings on which \R is used, as well as the fact that a plot created on a particular device may be subsequently used in many different ways. For this reason, common device-agnostic defaults were used for all devices from \R 2.3.0 onwards. Since \R 4.3.0, a new set of defaults given by \code{standard.theme} is used. The defaults are based on HCL palettes, but customization of the palettes is allowed. Earlier behaviour can be reinstated by setting \code{classic.theme} as the default \code{theme} argument, e.g., by putting \code{lattice.options(default.theme = classic.theme("pdf"))} in a startup script (see the entry for \code{theme} in \code{\link{trellis.device}} for details). \code{custom_theme} is the workhorse function called by \code{standard.theme}. \code{canonical.theme} is an alias for \code{standard.theme}. } \value{ A list of components defining graphical parameter settings for Lattice displays. It is used internally in \code{trellis.device}, and can also be used as the \code{theme} argument to \code{trellis.par.set} \code{col.whitebg} returns a similar (but smaller) list that is suitable as the \code{theme} argument to \code{trellis.device} and \code{\link{trellis.par.set}}. It contains settings values which provide colors suitable for plotting on a white background. Note that the name \code{col.whitebg} is somewhat of a misnomer, since it actually sets the background to transparent rather than white. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{Lattice}} for an overview of the \code{lattice} package. \code{\link{Devices}} for valid choices of \code{device} on your platform. \code{\link{trellis.par.get}} and \code{\link{trellis.par.set}} can be used to query and modify the settings \emph{after} a device has been initialized. The \code{par.settings} argument to high level functions, described in \code{\link{xyplot}}, can be used to attach transient settings to a \code{"trellis"} object. } \keyword{dplot} lattice/man/singer.Rd0000644000176200001440000000336314413020055014227 0ustar liggesusers\name{H_singer} \alias{singer} \docType{data} \title{ Heights of New York Choral Society singers } \description{ Heights in inches of the singers in the New York Choral Society in 1979. The data are grouped according to voice part. The vocal range for each voice part increases in pitch according to the following order: Bass 2, Bass 1, Tenor 2, Tenor 1, Alto 2, Alto 1, Soprano 2, Soprano 1. } \usage{singer} \format{ A data frame with 235 observations on the following 2 variables. \describe{ \item{height}{Height in inches of the singers.} \item{voice.part}{(Unordered) factor with levels "\code{Bass 2}", "\code{Bass 1}", "\code{Tenor 2}", "\code{Tenor 1}", "\code{Alto 2}", "\code{Alto 1}", "\code{Soprano 2}", "\code{Soprano 1}".} } } \source{ Chambers, J.M., W. S. Cleveland, B. Kleiner, and P. A. Tukey. (1983). \emph{Graphical Methods for Data Analysis}. Chapman and Hall, New York. } \author{ Documentation contributed by Kevin Wright. } \references{ Cleveland, William S. (1993) \emph{Visualizing Data}. Hobart Press, Summit, New Jersey. } \examples{ # Separate histogram for each voice part (Figure 1.2 from Cleveland) histogram(~ height | voice.part, data = singer, aspect = 1, layout = c(2, 4), nint = 15, xlab = "Height (inches)") # Quantile-Quantile plot (Figure 2.11 from Cleveland) qqmath(~ height | voice.part, data = singer, aspect = 1, layout = c(2,4), prepanel = prepanel.qqmathline, panel = function(x, ...) { panel.grid() panel.qqmathline(x, ...) panel.qqmath(x, ..., grid = FALSE) }, xlab = "Unit Normal Quantile", ylab="Height (inches)") } \keyword{datasets} lattice/man/draw.key.Rd0000644000176200001440000000132213070415115014460 0ustar liggesusers\name{D_draw.key} \alias{draw.key} \title{Produce a Legend or Key} \description{ Produces (and possibly draws) a Grid frame grob which is a legend (aka key) that can be placed in other Grid plots. } \usage{ draw.key(key, draw=FALSE, vp=NULL, \dots) } \arguments{ \item{key}{ A list determining the key. See documentation for \code{xyplot}, in particular the section describing the \code{key} argument, for details. } \item{draw}{ logical, whether the grob is to be drawn. } \item{vp}{ viewport } \item{\dots}{ignored} } \value{ A Grid frame object (that inherits from \sQuote{grob}). } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{xyplot}}} \keyword{dplot} lattice/man/latticeParseFormula.Rd0000644000176200001440000000410514145160206016706 0ustar liggesusers\name{G_latticeParseFormula} \alias{latticeParseFormula} \title{Parse Trellis formula} \usage{ latticeParseFormula(model, data, dimension = 2, subset = TRUE, groups = NULL, multiple, outer, subscripts, drop) } \description{ this function is used by high level Lattice functions like \code{xyplot} to parse the formula argument and evaluate various components of the data. } \arguments{ \item{model}{ the model/formula to be parsed. This can be in either of two possible forms, one for 2d and one for 3d formulas, determined by the \code{dimension} argument. The 2d formulas are of the form \code{y ~ x| g1 * \dots *gn}, and the 3d formulas are of the form \code{z ~ x * y | g1 * \dots* gn}. In the first form, \code{y} may be omitted. The conditioning variables \code{g1, \dots,gn} can be omitted in either case. } \item{data}{ the environment/dataset where the variables in the formula are evaluated. } \item{dimension}{ dimension of the model, see above} \item{subset}{ index for choosing a subset of the data frame } \item{groups}{ the grouping variable, if present} \item{multiple, outer}{ logicals, determining how a \sQuote{+} in the y and x components of the formula are processed. See \code{\link{xyplot}} for details } \item{subscripts}{ logical, whether subscripts are to be calculated } \item{drop}{ logical or list, similar to the \code{drop.unused.levels} argument in \code{\link{xyplot}}, indicating whether unused levels of conditioning factors and data variables that are factors are to be dropped. } } \value{ returns a list with several components, including \code{left, right, left.name, right.name, condition} for 2-D, and \code{left, right.x, right.y, left.name, right.x.name, right.y.name, condition} for 3-D. Other possible components are groups, subscr } \seealso{ \code{\link{xyplot}}, \code{\link{Lattice}} } \author{Saikat DebRoy, Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{utilities} lattice/man/panel.smoothScatter.Rd0000644000176200001440000000756114413020055016701 0ustar liggesusers\name{F_2_panel.smoothScatter} \alias{panel.smoothScatter} \title{Lattice panel function analogous to smoothScatter} \description{ This function allows the user to place \code{smoothScatter} plots in lattice graphics. } \usage{ panel.smoothScatter(x, y = NULL, nbin = 64, cuts = 255, bandwidth, col.regions, colramp, nrpoints = 100, transformation = function(x) x^0.25, pch = ".", cex = 1, col="black", range.x, ..., raster = FALSE, subscripts, identifier = "smoothScatter") } \arguments{ \item{x}{Numeric vector containing x-values or n by 2 matrix containing x and y values.} \item{y}{Numeric vector containing y-values (optional). The length of \code{x} must be the same as that of \code{y}.} \item{nbin}{Numeric vector of length 1 (for both directions) or 2 (for x and y separately) containing the number of equally spaced grid points for the density estimation.} \item{cuts}{ number of cuts defining the color gradient } \item{bandwidth}{Numeric vector: the smoothing bandwidth. If missing, these functions come up with a more or less useful guess. This parameter then gets passed on to the function \code{\link[KernSmooth:bkde2D]{bkde2D}}.} \item{col.regions}{ character vector of colors, or a function producing such a vector. Defaults to the \code{col} component of the \code{regions} setting of the current theme. } \item{colramp}{ Function accepting an integer \code{n} as an argument and returning \code{n} colors. If missing, the default is derived from \code{col.regions} with the following modification: if \code{col.regions} is a vector of colors, it is prepended by \code{"white"} before being converted into a function using \code{\link{colorRampPalette}}. } \item{nrpoints}{Numeric vector of length 1 giving number of points to be superimposed on the density image. The first \code{nrpoints} points from those areas of lowest regional densities will be plotted. Adding points to the plot allows for the identification of outliers. If all points are to be plotted, choose \code{nrpoints = Inf}.} \item{transformation}{Function that maps the density scale to the color scale.} \item{pch, cex}{ graphical parameters for the \code{nrpoints} \dQuote{outlying} points shown in the display } \item{range.x}{see \code{\link[KernSmooth:bkde2D]{bkde2D}} for details.} \item{col}{\code{\link{points}} color parameter} \item{\dots}{Further arguments that are passed on to \code{\link{panel.levelplot}}.} \item{raster}{ logical; if \code{TRUE}, \code{\link{panel.levelplot.raster}} is used, making potentially smaller output files. } \item{subscripts}{ ignored, but necessary for handling of \dots in certain situations. Likely to be removed in future. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ This replicates the display part of the \code{smoothScatter} function by replacing standard graphics calls by grid-compatible ones. } \value{ The function is called for its side effects, namely the production of the appropriate plots on a graphics device. } \author{ Deepayan Sarkar \email{deepayan.sarkar@r-project.org} } \examples{ ddf <- as.data.frame(matrix(rnorm(40000), ncol = 4) + 1.5 * rnorm(10000)) ddf[, c(2,4)] <- (-ddf[, c(2,4)]) xyplot(V1 ~ V2 + V3, ddf, outer = TRUE, panel = panel.smoothScatter, aspect = "iso") ## argument to panel.levelplot xyplot(V1 ~ V2, ddf, panel = panel.smoothScatter, cuts = 10, region.type = "contour") splom(ddf, panel = panel.smoothScatter, nbin = 64, raster = TRUE) } \keyword{ hplot } lattice/man/simpleKey.Rd0000644000176200001440000000541513070415115014705 0ustar liggesusers\name{D_simpleKey} \alias{simpleKey} \title{ Function to generate a simple key } \description{ Simple interface to generate a list appropriate for \code{draw.key} } \usage{ simpleKey(text, points = TRUE, rectangles = FALSE, lines = FALSE, col, cex, alpha, font, fontface, fontfamily, lineheight, \dots) } \arguments{ \item{text}{ character or expression vector, to be used as labels for levels of the grouping variable } \item{points}{ logical } \item{rectangles}{ logical } \item{lines}{ logical } \item{col, cex, alpha, font, fontface, fontfamily, lineheight}{ Used as top-level components of the list produced, to be used for the text labels. Defaults to the values in \code{trellis.par.get("add.text")} } \item{\dots}{ further arguments added to the list, eventually passed to \code{draw.key} } } \details{ A lattice plot can include a legend (key) if an appropriate list is specified as the \code{key} argument to a high level Lattice function such as \code{xyplot}. This key can be very flexible, but that flexibility comes at a cost: this list needs to be fairly complicated even in simple situations. \code{simpleKey} is designed as a useful shortcut in the common case of a key drawn in conjunction with a grouping variable, using the default graphical settings. The \code{simpleKey} function produces a suitable \code{key} argument using a simpler interface. The resulting list will use the \code{text} argument as a text component, along with at most one set each of points, rectangles, and lines. The number of entries (rows) in the key will be the length of the \code{text} component. The graphical parameters for the additional components will be derived from the default graphical settings (wherein lies the simplification, as otherwise these would have to be provided explicitly). Calling \code{simpleKey} directly is usually unnecessary. It is most commonly invoked (during the plotting of the \code{"trellis"} object) when the \code{auto.key} argument is supplied in a high-level plot with a \code{groups} argument. In that case, the \code{text} argument of \code{simpleKey} defaults to \code{levels(groups)}, and the defaults for the other arguments depend on the relevant high-level function. Note that these defaults can be overridden by supplying \code{auto.key} as a list containing the replacement values. } \value{ A list that would work as the \code{key} argument to \code{\link{xyplot}}, etc. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{Lattice}}, \code{\link{draw.key}}, \code{\link{trellis.par.get}}, and \code{\link{xyplot}}, specifically the entry for \code{auto.key}. } \keyword{dplot} lattice/man/panel.stripplot.Rd0000644000176200001440000000453114413020055016074 0ustar liggesusers\name{F_1_panel.stripplot} \alias{panel.stripplot} \title{ Default Panel Function for stripplot } \description{ This is the default panel function for \code{stripplot}. Also see \code{panel.superpose} } \usage{ panel.stripplot(x, y, jitter.data = FALSE, factor = 0.5, amount = NULL, horizontal = TRUE, groups = NULL, \dots, grid = lattice.getOption("default.args")$grid, identifier = "stripplot") } \arguments{ \item{x,y}{ coordinates of points to be plotted} \item{jitter.data}{ whether points should be jittered to avoid overplotting. The actual jittering is performed inside \code{\link{panel.xyplot}}, using its \code{jitter.x} or \code{jitter.y} argument (depending on the value of \code{horizontal}). } \item{factor, amount}{amount of jittering, see \code{\link{jitter}}} \item{horizontal}{ logical. If FALSE, the plot is \sQuote{transposed} in the sense that the behaviours of x and y are switched. x is now the \sQuote{factor}. Interpretation of other arguments change accordingly. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{groups}{ optional grouping variable } \item{\dots}{ additional arguments, passed on to \code{\link{panel.xyplot}} } \item{grid}{ A logical flag, character string, or list specifying whether and how a background grid should be drawn. In its general form, \code{grid} can be a list of arguments to be supplied to \code{\link{panel.grid}}, which is called with those arguments. Three shortcuts are available: \describe{ \item{\code{TRUE}:}{ roughly equivalent to \code{list(h = -1, v = -1)} } \item{\code{"h"}:}{ roughly equivalent to \code{list(h = -1, v = 0)} } \item{\code{"v"}:}{ roughly equivalent to \code{list(h = 0, v = -1)} } } No grid is drawn if \code{grid = FALSE}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates stripplot (one dimensional scatterplot) of \code{x} for each level of \code{y} (or vice versa, depending on the value of \code{horizontal}) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{stripplot}}, \code{\link{jitter}}} \keyword{dplot} lattice/man/cloud.Rd0000644000176200001440000004047614576262623014077 0ustar liggesusers\name{B_07_cloud} \title{3d Scatter Plot and Wireframe Surface Plot} \alias{cloud} \alias{wireframe} \alias{cloud.formula} \alias{cloud.data.frame} \alias{cloud.matrix} \alias{cloud.table} \alias{wireframe.formula} \alias{wireframe.data.frame} \alias{wireframe.matrix} \usage{ cloud(x, data, \dots) wireframe(x, data, \dots) \method{cloud}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = FALSE, auto.key = lattice.getOption("default.args")$auto.key, aspect = c(1,1), panel.aspect = 1, panel = lattice.getOption("panel.cloud"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, ylab, zlab, xlim = if (is.factor(x)) levels(x) else range(x, finite = TRUE), ylim = if (is.factor(y)) levels(y) else range(y, finite = TRUE), zlim = if (is.factor(z)) levels(z) else range(z, finite = TRUE), at, drape = FALSE, pretty = FALSE, drop.unused.levels, \dots, lattice.options = NULL, default.scales = list(distance = c(1, 1, 1), arrows = TRUE, axs = axs.default), default.prepanel = lattice.getOption("prepanel.default.cloud"), colorkey, col.regions, alpha.regions, cuts = 70, subset = TRUE, axs.default = "r") \method{cloud}{data.frame}(x, data = NULL, formula = data, ...) \method{wireframe}{formula}(x, data, panel = lattice.getOption("panel.wireframe"), default.prepanel = lattice.getOption("prepanel.default.wireframe"), \dots) \method{wireframe}{data.frame}(x, data = NULL, formula = data, ...) \method{cloud}{matrix}(x, data = NULL, type = "h", zlab = deparse(substitute(x)), aspect, \dots, xlim, ylim, row.values, column.values) \method{cloud}{table}(x, data = NULL, groups = FALSE, zlab = deparse(substitute(x)), type = "h", \dots) \method{wireframe}{matrix}(x, data = NULL, zlab = deparse(substitute(x)), aspect, \dots, xlim, ylim, row.values, column.values) } \description{ Generic functions to draw 3d scatter plots and surfaces. The \code{"formula"} methods do most of the actual work. } \arguments{ \item{x}{ The object on which method dispatch is carried out. For the \code{"formula"} methods, a formula of the form \code{z ~ x * y | g1 * g2 * \dots}, where \code{z} is a numeric response, and \code{x}, \code{y} are numeric values. \code{g1, g2, \dots}, if present, are conditioning variables used for conditioning, and must be either factors or shingles. In the case of \code{wireframe}, calculations are based on the assumption that the \code{x} and \code{y} values are evaluated on a rectangular grid defined by their unique values. The grid points need not be equally spaced. For \code{wireframe}, \code{x}, \code{y} and \code{z} may also be matrices (of the same dimension), in which case they are taken to represent a 3-D surface parametrized on a 2-D grid (e.g., a sphere). Conditioning is not possible with this feature. See details below. Missing values are allowed, either as \code{NA} values in the \code{z} vector, or missing rows in the data frame (note however that in that case the X and Y grids will be determined only by the available values). For a grouped display (producing multiple surfaces), missing rows are not allowed, but \code{NA}-s in \code{z} are. Both \code{wireframe} and \code{cloud} have methods for \code{matrix} objects, in which case \code{x} provides the \code{z} vector described above, while its rows and columns are interpreted as the \code{x} and \code{y} vectors respectively. This is similar to the form used in \code{persp}. } \item{data}{ For the \code{"formula"} methods, an optional data frame in which variables in the formula (as well as \code{groups} and \code{subset}, if any) are to be evaluated. \code{data} should not be specified except when using the \code{"formula"} method. } \item{formula}{ The formula to be used for the \code{"data.frame"} methods. See documentation for argument \code{x} for details. } \item{row.values, column.values}{ Optional vectors of values that define the grid when \code{x} is a matrix. \code{row.values} and \code{column.values} must have the same lengths as \code{nrow(x)} and \code{ncol(x)} respectively. By default, row and column numbers. } \item{allow.multiple, outer, auto.key, prepanel, strip, groups, xlab, xlim, ylab, ylim, drop.unused.levels, lattice.options, default.scales, subset}{ These arguments are documented in the help page for \code{\link{xyplot}}. For the \code{cloud.table} method, \code{groups} must be a logical indicating whether the last dimension should be used as a grouping variable as opposed to a conditioning variable. This is only relevant if the table has more than 2 dimensions. } \item{type}{ type of display in \code{cloud} (see \code{\link{panel.3dscatter}} for details). Defaults to \code{"h"} for the \code{matrix} method. } \item{aspect, panel.aspect}{ Unlike other high level functions, \code{aspect} is taken to be a numeric vector of length 2, giving the relative aspects of the y-size/x-size and z-size/x-size of the enclosing cube. The usual role of the \code{aspect} argument in determining the aspect ratio of the panel (see \code{\link{xyplot}} for details) is played by \code{panel.aspect}, except that it can only be a numeric value. For the \code{matrix} methods, the default y/x aspect is \code{ncol(x) / nrow(x)} and the z/x aspect is the smaller of the y/x aspect and 1. } \item{panel}{ panel function used to create the display. See \code{\link{panel.cloud}} for (non-trivial) details. } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{scales}{ a list describing the scales. As with other high level functions (see \code{\link{xyplot}} for details), this list can contain parameters in name=value form. It can also contain components with the special names \code{x}, \code{y} and \code{z}, which can be similar lists with axis-specific values overriding the ones specified in \code{scales}. The most common use for this argument is to set \code{arrows=FALSE}, which causes tick marks and labels to be used instead of arrows being drawn (the default). Both can be suppressed by \code{draw=FALSE}. Another special component is \code{distance}, which specifies the relative distance of the axis label from the bounding box. If specified as a component of \code{scales} (as opposed to one of \code{scales$z} etc), this can be (and is recycled if not) a vector of length 3, specifying distances for the x, y and z labels respectively. Other components that work in the \code{scales} argument of \code{xyplot} etc. should also work here (as long as they make sense), including explicit specification of tick mark locations and labels. (Not everything is implemented yet, but if you find something that should work but does not, feel free to bug the maintainer.) Note, however, that for these functions \code{scales} cannot contain information that is specific to particular panels. If you really need that, consider using the \code{scales.3d} argument of \code{panel.cloud}. } \item{axs.default}{ Unlike 2-D display functions, \code{cloud} does not expand the bounding box to slightly beyound the range of the data, even though it should. This is primarily because this is the natural behaviour in \code{wireframe}, which uses the same code. \code{axs.default} is intended to provide a different default for \code{cloud}. However, this feature has not yet been implemented. } \item{zlab}{ Specifies a label describing the z variable in ways similar to \code{xlab} and \code{ylab} (i.e. \dQuote{grob}, character string, expression or list) in other high level functions. Additionally, if \code{zlab} (and \code{xlab} and \code{ylab}) is a list, it can contain a component called \code{rot}, controlling the rotation for the label } \item{zlim}{ limits for the z-axis. Similar to \code{xlim} and \code{ylim} in other high level functions } \item{drape}{ logical, whether the wireframe is to be draped in color. If \code{TRUE}, the height of a facet is used to determine its color in a manner similar to the coloring scheme used in \code{\link{levelplot}}. Otherwise, the background color is used to color the facets. This argument is ignored if \code{shade = TRUE} (see \code{\link{panel.3dwire}}). } \item{at, col.regions, alpha.regions}{ these arguments are analogous to those in \code{\link{levelplot}}. if \code{drape=TRUE}, \code{at} gives the vector of cutpoints where the colors change, and \code{col.regions} the vector of colors to be used in that case. \code{alpha.regions} determines the alpha-transparency on supporting devices. These are passed down to the panel function, and also used in the colorkey if appropriate. The default for \code{col.regions} and \code{alpha.regions} is derived from the Trellis setting \code{"regions"} } \item{cuts}{ if \code{at} is unspecified, the approximate number of cutpoints if \code{drape=TRUE} } \item{pretty}{ whether automatic choice of cutpoints should be prettfied } \item{colorkey}{ logical indicating whether a color key should be drawn alongside, or a list describing such a key. See \code{\link{levelplot}} for details. } \item{\dots}{ Any number of other arguments can be specified, and are passed to the panel function. In particular, the arguments \code{distance}, \code{perspective}, \code{screen} and \code{R.mat} are very important in determining the 3-D display. The argument \code{shade} can be useful for \code{wireframe} calls, and controls shading of the rendered surface. These arguments are described in detail in the help page for \code{\link{panel.cloud}}. Additionally, an argument called \code{zoom} may be specified, which should be a numeric scalar to be interpreted as a scale factor by which the projection is magnified. This can be useful to get the variable names into the plot. This argument is actually only used by the default prepanel function. } } \details{ These functions produce three dimensional plots in each panel (as long as the default panel functions are used). The orientation is obtained as follows: the data are scaled to fall within a bounding box that is contained in the [-0.5, 0.5] cube (even smaller for non-default values of \code{aspect}). The viewing direction is given by a sequence of rotations specified by the \code{screen} argument, starting from the positive Z-axis. The viewing point (camera) is located at a distance of \code{1/distance} from the origin. If \code{perspective=FALSE}, \code{distance} is set to 0 (i.e., the viewing point is at an infinite distance). \code{cloud} draws a 3-D Scatter Plot, while \code{wireframe} draws a 3-D surface (usually evaluated on a grid). Multiple surfaces can be drawn by \code{wireframe} using the \code{groups} argument (although this is of limited use because the display is incorrect when the surfaces intersect). Specifying \code{groups} with \code{cloud} results in a \code{panel.superpose}-like effect (via \code{\link{panel.3dscatter}}). \code{wireframe} can optionally render the surface as being illuminated by a light source (no shadows though). Details can be found in the help page for \code{\link{panel.3dwire}}. Note that although arguments controlling these are actually arguments for the panel function, they can be supplied to \code{cloud} and \code{wireframe} directly. For single panel plots, \code{wireframe} can also plot parametrized 3-D surfaces (i.e., functions of the form f(u,v) = (x(u,v), y(u,v), z(u,v)), where values of (u,v) lie on a rectangle. The simplest example of this sort of surface is a sphere parametrized by latitude and longitude. This can be achieved by calling \code{wireframe} with a formula \code{x} of the form \code{z~x*y}, where \code{x}, \code{y} and \code{z} are all matrices of the same dimension, representing the values of x(u,v), y(u,v) and z(u,v) evaluated on a discrete rectangular grid (the actual values of (u,v) are irrelevant). When this feature is used, the heights used to calculate \code{drape} colors or shading colors are no longer the \code{z} values, but the distances of \code{(x,y,z)} from the origin. Note that this feature does not work with \code{groups}, \code{subscripts}, \code{subset}, etc. Conditioning variables are also not supported in this case. The algorithm for identifying which edges of the bounding box are \sQuote{behind} the points doesn't work in some extreme situations. Also, \code{\link{panel.cloud}} tries to figure out the optimal location of the arrows and axis labels automatically, but can fail on occasion (especially when the view is from \sQuote{below} the data). This can be manually controlled by the \code{scpos} argument in \code{\link{panel.cloud}}. These and all other high level Trellis functions have several other arguments in common. These are extensively documented only in the help page for \code{\link{xyplot}}, which should be consulted to learn more detailed usage. } \note{ There is a known problem with grouped \code{wireframe} displays when the (x, y) coordinates represented in the data do not represent the full evaluation grid. The problem occurs whether the grouping is specified through the \code{groups} argument or through the formula interface, and currently causes memory access violations. Depending on the circumstances, this is manifested either as a meaningless plot or a crash. To work around the problem, it should be enough to have a row in the data frame for each grid point, with an \code{NA} response (\code{z}) in rows that were previously missing. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \seealso{ \code{\link{Lattice}} for an overview of the package, as well as \code{\link{xyplot}}, \code{\link{levelplot}}, \code{\link{panel.cloud}}. For interaction, see \code{\link{panel.identify.cloud}}. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ ## volcano ## 87 x 61 matrix wireframe(volcano, shade = TRUE, aspect = c(61/87, 0.4), light.source = c(10,0,10)) g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <- log((g$x^g$gr + g$y^2) * g$gr) wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE, screen = list(z = 30, x = -60)) cloud(Sepal.Length ~ Petal.Length * Petal.Width | Species, data = iris, screen = list(x = -90, y = 70), distance = .4, zoom = .6) ## cloud.table cloud(prop.table(Titanic, margin = 1:3), type = c("p", "h"), strip = strip.custom(strip.names = TRUE), scales = list(arrows = FALSE, distance = 2), panel.aspect = 0.7, zlab = "Proportion")[, 1] ## transparent axes par.set <- list(axis.line = list(col = "transparent"), clip = list(panel = "off")) print(cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = .8, groups = Species, main = "Stereo", screen = list(z = 20, x = -70, y = 3), par.settings = par.set, scales = list(col = "black")), split = c(1,1,2,1), more = TRUE) print(cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = .8, groups = Species, main = "Stereo", screen = list(z = 20, x = -70, y = 0), par.settings = par.set, scales = list(col = "black")), split = c(2,1,2,1)) } \keyword{hplot} lattice/man/levelplot.Rd0000644000176200001440000003512414576262623014771 0ustar liggesusers\name{B_06_levelplot} \title{Level plots and contour plots} \alias{levelplot} \alias{contourplot} \alias{levelplot.formula} \alias{levelplot.data.frame} \alias{contourplot.formula} \alias{contourplot.data.frame} \alias{levelplot.table} \alias{contourplot.table} \alias{levelplot.array} \alias{contourplot.array} \alias{levelplot.matrix} \alias{contourplot.matrix} \usage{ levelplot(x, data, \dots) contourplot(x, data, \dots) \method{levelplot}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = TRUE, aspect = "fill", panel = if (useRaster) lattice.getOption("panel.levelplot.raster") else lattice.getOption("panel.levelplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, at, cuts = 15, pretty = FALSE, region = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), \dots, useRaster = FALSE, lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.levelplot"), colorkey = region, col.regions, alpha.regions, subset = TRUE) \method{contourplot}{formula}(x, data, panel = lattice.getOption("panel.contourplot"), default.prepanel = lattice.getOption("prepanel.default.contourplot"), cuts = 7, labels = TRUE, contour = TRUE, pretty = TRUE, region = FALSE, \dots) \method{levelplot}{data.frame}(x, data = NULL, formula = data, ...) \method{contourplot}{data.frame}(x, data = NULL, formula = data, ...) \method{levelplot}{table}(x, data = NULL, aspect = "iso", \dots, xlim, ylim) \method{contourplot}{table}(x, data = NULL, aspect = "iso", \dots, xlim, ylim) \method{levelplot}{matrix}(x, data = NULL, aspect = "iso", \dots, xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) \method{contourplot}{matrix}(x, data = NULL, aspect = "iso", \dots, xlim, ylim, row.values = seq_len(nrow(x)), column.values = seq_len(ncol(x))) \method{levelplot}{array}(x, data = NULL, \dots) \method{contourplot}{array}(x, data = NULL, \dots) } \description{ Draws false color level plots and contour plots. } \arguments{ \item{x}{ for the \code{formula} method, a formula of the form \code{z ~ x * y | g1 * g2 * \dots}, where \code{z} is a numeric response, and \code{x}, \code{y} are numeric values evaluated on a rectangular grid. \code{g1, g2, \dots} are optional conditional variables, and must be either factors or shingles if present. Calculations are based on the assumption that all x and y values are evaluated on a grid (defined by their unique values). The function will not return an error if this is not true, but the display might not be meaningful. However, the x and y values need not be equally spaced. Both \code{levelplot} and \code{wireframe} have methods for \code{matrix}, \code{array}, and \code{table} objects, in which case \code{x} provides the \code{z} vector described above, while its rows and columns are interpreted as the \code{x} and \code{y} vectors respectively. This is similar to the form used in \code{filled.contour} and \code{image}. For higher-dimensional arrays and tables, further dimensions are used as conditioning variables. Note that the dimnames may be duplicated; this is handled by calling \code{\link{make.unique}} to make the names unique (although the original labels are used for the x- and y-axes). } \item{data}{ For the \code{formula} methods, an optional data frame in which variables in the formula (as well as \code{groups} and \code{subset}, if any) are to be evaluated. Usually ignored with a warning in other cases. } \item{formula}{ The formula to be used for the \code{"data.frame"} methods. See documentation for argument \code{x} for details. } \item{row.values, column.values}{ Optional vectors of values that define the grid when \code{x} is a matrix. \code{row.values} and \code{column.values} must have the same lengths as \code{nrow(x)} and \code{ncol(x)} respectively. By default, row and column numbers. } \item{panel}{ panel function used to create the display, as described in \code{\link{xyplot}} } \item{aspect}{ For the \code{matrix} methods, the default aspect ratio is chosen to make each cell square. The usual default is \code{aspect="fill"}, as described in \code{\link{xyplot}}. } \item{at}{ A numeric vector giving breakpoints along the range of \code{z}. Contours (if any) will be drawn at these heights, and the regions in between would be colored using \code{col.regions}. In the latter case, values outside the range of \code{at} will not be drawn at all. This serves as a way to limit the range of the data shown, similar to what a \code{zlim} argument might have been used for. However, this also means that when supplying \code{at} explicitly, one has to be careful to include values outside the range of \code{z} to ensure that all the data are shown. \code{at} can have length one only if \code{region=FALSE}. } \item{col.regions}{ color vector to be used if regions is TRUE. The general idea is that this should be a color vector of moderately large length (longer than the number of regions. By default this is 100). It is expected that this vector would be gradually varying in color (so that nearby colors would be similar). When the colors are actually chosen, they are chosen to be equally spaced along this vector. When there are more regions than colors in \code{col.regions}, the colors are recycled. The actual color assignment is performed by \code{\link{level.colors}}, which is documented separately. } \item{alpha.regions}{ Numeric, specifying alpha transparency (works only on some devices) } \item{colorkey}{ A logical flag specifying whether a colorkey is to be drawn alongside the plot, or a list describing the colorkey. The list may contain the following components: \describe{ \item{\code{space}:}{ location of the colorkey, can be one of \code{"left"}, \code{"right"}, \code{"top"} and \code{"bottom"}. Defaults to \code{"right"}. } \item{\code{x}, \code{y}:}{ location, currently unused } \item{\code{col}:}{ A color ramp specification, as in the \code{col.regions} argument in \code{\link{level.colors}} } \item{\code{at}:}{ A numeric vector specifying where the colors change. must be of length 1 more than the col vector. } \item{\code{tri.lower}, \code{tri.upper}:}{ Logical or numeric controlling whether the first and last intervals should be triangular instead of rectangular. With the default value (\code{NA}), this happens only if the corresponding extreme \code{at} values are \code{-Inf} or \code{Inf} respectively, and the triangles occupy 5\% of the total length of the color key. If numeric and between 0 and 0.25, these give the corresponding fraction, which is again 5\% when specified as \code{TRUE}. } \item{\code{labels}:}{ A character vector for labelling the \code{at} values, or more commonly, a list describing characteristics of the labels. This list may include components \code{labels}, \code{at}, \code{cex}, \code{col}, \code{rot}, \code{font}, \code{fontface} and \code{fontfamily}. } \item{\code{title}:}{ Usually a character vector or expression providing a title for the colorkey, or a list controlling the title in further detail, or an arbitrary \code{"grob"}. For details of how the list form is interpreted, see the entry for \code{main} in \code{\link{xyplot}}; generally speaking, the actual label should be specified as the \code{label} component (which may be unnamed if it is the first component), and the remaining arguments are used as appropriate in a call to \code{\link[grid:grid.text]{textGrob}}. Further control of the placement of the title is possible through the component \code{title.control}. In particular, if a \code{rot} component is not specified, its default depends on the value of \code{title.control$side} (0 for top or bottom, and 90 for left or right). \code{title} defaults to \code{NULL}, which means no title is drawn. } \item{\code{title.control}:}{ A list providing control over the placement of a title, if specified. Currently two components are honoured: \code{side} can take values \code{"top"}, \code{"bottom"}, \code{"left"}, and \code{"right"}, and specifies the side of the colorkey on which the title is to be placed. Defaults to the value of the \code{"space"} component. \code{padding} is a multiplier for the default amount of padding between the title and the colorkey. } \item{\code{tick.number}:}{ The approximate number of ticks desired. } \item{\code{tck}:}{ A (scalar) multipler for tick lengths. } \item{\code{corner}:}{ Interacts with x, y; currently unimplemented } \item{\code{width}:}{ The width of the key } \item{\code{height}:}{ The length of key as a fraction of the appropriate side of plot. } \item{\code{raster}:}{ A logical flag indicating whether the colorkey should be rendered as a raster image using \code{\link{grid.raster}}. See also \code{\link{panel.levelplot.raster}}. } \item{\code{interpolate}:}{ Logical flag, passed to \code{\link{rasterGrob}} when \code{raster=TRUE}. } \item{\code{axis.line}:}{ A list giving graphical parameters for the color key boundary and tick marks. Defaults to \code{trellis.par.get("axis.line")}. } \item{\code{axis.text}:}{ A list giving graphical parameters for the tick mark labels on the color key. Defaults to \code{trellis.par.get("axis.text")}. } } } \item{contour}{ A logical flag, indicating whether to draw contour lines. } \item{cuts}{ The number of levels the range of \code{z} would be divided into. } \item{labels}{ Typically a logical indicating whether contour lines should be labelled, but other possibilities for more sophisticated control exists. Details are documented in the help page for \code{\link{panel.levelplot}}, to which this argument is passed on unchanged. That help page also documents the \code{label.style} argument, which affects how the labels are rendered. } \item{pretty}{ A logical flag, indicating whether to use pretty cut locations and labels. } \item{region}{ A logical flag, indicating whether regions between contour lines should be filled as in a level plot. } \item{allow.multiple, outer, prepanel, scales, strip, groups, xlab, xlim, ylab, ylim, drop.unused.levels, lattice.options, default.scales, subset}{ These arguments are described in the help page for \code{\link{xyplot}}. } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{\dots}{ Further arguments may be supplied. Some are processed by \code{levelplot} or \code{contourplot}, and those that are unrecognized are passed on to the panel function. } \item{useRaster}{ A logical flag indicating whether raster representations should be used, both for the false color image and the color key (if present). Effectively, setting this to \code{TRUE} changes the default panel function from \code{\link{panel.levelplot}} to \code{\link{panel.levelplot.raster}}, and sets the default value of \code{colorkey$raster} to \code{TRUE}. Note that \code{\link{panel.levelplot.raster}} provides only a subset of the features of \code{\link{panel.levelplot}}, but setting \code{useRaster=TRUE} will not check whether any of the additional features have been requested. Not all devices support raster images. For devices that appear to lack support, \code{useRaster=TRUE} will be ignored with a warning. } } \details{ These and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for \code{xyplot}, which should be consulted to learn more detailed usage. Other useful arguments are mentioned in the help page for the default panel function \code{\link{panel.levelplot}} (these are formally arguments to the panel function, but can be specified in the high level calls directly). } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \seealso{ \code{\link{xyplot}}, \code{\link{Lattice}}, \code{\link{panel.levelplot}} } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ x <- seq(pi/4, 5 * pi, length.out = 100) y <- seq(pi/4, 5 * pi, length.out = 100) r <- as.vector(sqrt(outer(x^2, y^2, "+"))) grid <- expand.grid(x=x, y=y) grid$z <- cos(r^2) * exp(-r/(pi^3)) levelplot(z ~ x * y, grid, cuts = 50, scales=list(log="e"), xlab="", ylab="", main="Weird Function", sub="with log scales", colorkey = FALSE, region = TRUE) ## triangular end-points in color key, with a title levelplot(z ~ x * y, grid, col.regions = hcl.colors(10), at = c(-Inf, seq(-0.8, 0.8, by = 0.2), Inf)) #S-PLUS example require(stats) attach(environmental) ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation, parametric = c("radiation", "wind"), span = 1, degree = 2) w.marginal <- seq(min(wind), max(wind), length.out = 50) t.marginal <- seq(min(temperature), max(temperature), length.out = 50) r.marginal <- seq(min(radiation), max(radiation), length.out = 4) wtr.marginal <- list(wind = w.marginal, temperature = t.marginal, radiation = r.marginal) grid <- expand.grid(wtr.marginal) grid[, "fit"] <- c(predict(ozo.m, grid)) contourplot(fit ~ wind * temperature | radiation, data = grid, cuts = 10, region = TRUE, xlab = "Wind Speed (mph)", ylab = "Temperature (F)", main = "Cube Root Ozone (cube root ppb)") detach() } \keyword{hplot} lattice/man/strip.default.Rd0000644000176200001440000001603313070415115015525 0ustar liggesusers\name{D_strip.default} \alias{strip.default} \alias{strip.custom} \title{Default Trellis Strip Function} \usage{ strip.default(which.given, which.panel, var.name, factor.levels, shingle.intervals, strip.names = c(FALSE, TRUE), strip.levels = c(TRUE, FALSE), sep = " : ", style = 1, horizontal = TRUE, bg = trellis.par.get("strip.background")$col[which.given], fg = trellis.par.get("strip.shingle")$col[which.given], par.strip.text = trellis.par.get("add.text")) strip.custom(\dots) } \description{ \code{strip.default} is the function that draws the strips by default in Trellis plots. Users can write their own strip functions, but most commonly this involves calling \code{strip.default} with a slightly different arguments. \code{strip.custom} provides a convenient way to obtain new strip functions that differ from \code{strip.default} only in the default values of certain arguments. } \arguments{ \item{which.given}{ integer index specifying which of the conditioning variables this strip corresponds to. } \item{which.panel}{ vector of integers as long as the number of conditioning variables. The contents are indices specifying the current levels of each of the conditioning variables (thus, this would be unique for each distinct packet). This is identical to the return value of \code{\link{which.packet}}, which is a more accurate name. } % \item{panel.number, packet.number}{ integer indices specifying which % panel and packet is being drawn (see the entry for \code{panel} in % \code{\link{xyplot}} for details). These arguments are ignored by % the \code{strip.default}, but may be used by user supplied % replacements. % } \item{var.name}{ vector of character strings or expressions as long as the number of conditioning variables. The contents are interpreted as names for the conditioning variables. Whether they are shown on the strip depends on the values of \code{strip.names} and \code{style} (see below). By default, the names are shown for shingles, but not for factors. } \item{factor.levels}{ vector of character strings or expressions giving the levels of the conditioning variable currently being drawn. For more than one conditioning variable, this will vary with \code{which.given}. Whether these levels are shown on the strip depends on the values of \code{strip.levels} and \code{style} (see below). \code{factor.levels} may be specified for both factors and shingles (despite the name), but by default they are shown only for factors. If shown, the labels may optionally be abbreviated by specifying suitable components in \code{par.strip.text} (see \code{\link{xyplot}}) } \item{shingle.intervals}{if the current strip corresponds to a shingle, this should be a 2-column matrix giving the levels of the shingle. (of the form that would be produced by \bold{printing} \code{levels(shingle)}). Otherwise, it should be \code{NULL} } \item{strip.names}{ a logical vector of length 2, indicating whether or not the name of the conditioning variable that corresponds to the strip being drawn is to be written on the strip. The two components give the values for factors and shingles respectively. This argument is ignored for a factor when \code{style} is not one of 1 and 3. } \item{strip.levels}{ a logical vector of length 2, indicating whether or not the level of the conditioning variable that corresponds to the strip being drawn is to be written on the strip. The two components give the values for factors and shingles respectively. } \item{sep}{ character or expression, serving as a separator if the name and level are both to be shown. } \item{style}{ integer, with values 1, 2, 3, 4 and 5 currently supported, controlling how the current level of a factor is encoded. Ignored for shingles (actually, when \code{shingle.intervals} is non-null. The best way to find out what effect the value of \code{style} has is to try them out. Here is a short description: for a style value of 1, the strip is colored in the background color with the strip text (as determined by other arguments) centered on it. A value of 3 is the same, except that a part of the strip is colored in the foreground color, indicating the current level of the factor. For styles 2 and 4, the part corresponding to the current level remains colored in the foreground color, however, for style = 2, the remaining part is not colored at all, whereas for 4, it is colored with the background color. For both these, the names of all the levels of the factor are placed on the strip from left to right. Styles 5 and 6 produce the same effect (they are subtly different in S, this implementation corresponds to 5), they are similar to style 1, except that the strip text is not centered, it is instead positioned according to the current level. Note that unlike S-PLUS, the default value of \code{style} is 1. \code{strip.names} and \code{strip.levels} have no effect if \code{style} is not 1 or 3. } \item{horizontal}{ logical, specifying whether the labels etc should be horizontal. \code{horizontal=FALSE} is useful for strips on the left of panels using \code{strip.left=TRUE} } \item{par.strip.text}{ list with parameters controlling the text on each strip, with components \code{col}, \code{cex}, \code{font}, etc. } \item{bg}{ strip background color. } \item{fg}{ strip foreground color. } \item{\dots}{ arguments to be passed on to \code{strip.default}, overriding whatever value it would have normally assumed } } \value{ \code{strip.default} is called for its side-effect, which is to draw a strip appropriate for multi-panel Trellis conditioning plots. \code{strip.custom} returns a function that is similar to \code{strip.default}, but with different defaults for the arguments specified in the call. } \details{ default strip function for trellis functions. Useful mostly because of the \code{style} argument --- non-default styles are often more informative, especially when the names of the levels of the factor \code{x} are small. Traditional use is as \code{strip = function(\dots) strip.default(style=2,\dots)}, though this can be simplified by the use of \code{strip.custom}. } \seealso{ \code{\link{xyplot}}, \code{\link{Lattice}} } \examples{ ## Traditional use xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = function(..., style) strip.default(..., style = 4)) ## equivalent call using strip.custom xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = strip.custom(style = 4)) xyplot(Petal.Length ~ Petal.Width | Species, iris, strip = FALSE, strip.left = strip.custom(style = 4, horizontal = FALSE)) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/panel.qqmath.Rd0000644000176200001440000000460413070415115015333 0ustar liggesusers\name{F_1_panel.qqmath} \alias{panel.qqmath} \title{ Default Panel Function for qqmath } \description{ This is the default panel function for \code{qqmath}. } \usage{ panel.qqmath(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, \dots, tails.n = 0, identifier = "qqmath") } \arguments{ \item{x}{ vector (typically numeric, coerced if not) of data values to be used in the panel. } \item{f.value, distribution}{ Defines how quantiles are calculated. See \code{\link{qqmath}} for details. } \item{qtype}{ The \code{type} argument to be used in \code{\link{quantile}} } \item{groups}{ An optional grouping variable. Within each panel, one Q-Q plot is produced for every level of this grouping variable, differentiated by different graphical parameters. } \item{\dots}{ Further arguments, often graphical parameters, eventually passed on to \code{\link{panel.xyplot}}. Arguments \code{grid} and \code{abline} of \code{panel.xyplot} may be particularly useful. } \item{tails.n}{ number of data points to represent exactly on each tail of the distribution. This reproduces the effect of \code{f.value = NULL} for the extreme data values, while approximating the remaining data. It has no effect if \code{f.value = NULL}. If \code{tails.n} is given, \code{qtype} is forced to be 1. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates a Q-Q plot of the data and the theoretical distribution given by \code{distribution}. Note that most of the arguments controlling the display can be supplied directly to the high-level \code{qqmath} call. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{qqmath}} } \examples{ set.seed(0) xx <- rt(10000, df = 10) qqmath(~ xx, pch = "+", distribution = qnorm, grid = TRUE, abline = c(0, 1), xlab.top = c("raw", "ppoints(100)", "tails.n = 50"), panel = function(..., f.value) { switch(panel.number(), panel.qqmath(..., f.value = NULL), panel.qqmath(..., f.value = ppoints(100)), panel.qqmath(..., f.value = ppoints(100), tails.n = 50)) }, layout = c(3, 1))[c(1,1,1)] } \keyword{dplot} lattice/man/Rows.Rd0000644000176200001440000000106413070415115013671 0ustar liggesusers\name{G_Rows} \alias{Rows} \title{Extract rows from a list} \description{ Convenience function to extract subset of a list. Usually used in creating keys. } \usage{ Rows(x, which) } \arguments{ \item{x}{ list with each member a vector of the same length } \item{which}{ index for members of \code{x}} } \value{ A list similar to \code{x}, with each \code{x[[i]]} replaced by \code{x[[i]][which]} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{xyplot}}, \code{\link{Lattice}}} \keyword{utilities} lattice/man/barchart.table.Rd0000644000176200001440000000532413070415115015616 0ustar liggesusers\name{B_02_barchart.table} \title{table methods for barchart and dotplot} \alias{barchart.table} \alias{barchart.array} \alias{barchart.matrix} \alias{dotplot.table} \alias{dotplot.array} \alias{dotplot.matrix} \usage{ \method{barchart}{table}(x, data, groups = TRUE, origin = 0, stack = TRUE, \dots, horizontal = TRUE) \method{barchart}{array}(x, data, \dots) \method{barchart}{matrix}(x, data, \dots) \method{dotplot}{table}(x, data, groups = TRUE, \dots, horizontal = TRUE) \method{dotplot}{array}(x, data, \dots) \method{dotplot}{matrix}(x, data, \dots) } \description{ Contingency tables are often displayed using bar charts and dot plots. These methods operate directly on tables, bypassing the need to convert them to data frames for use with the formula interface. Matrices and arrays are also supported, by coercing them to tables. } \arguments{ \item{x}{ A \code{table}, \code{array} or \code{matrix} object. } \item{data}{ Should not be specified. If specified, will be ignored with a warning. } \item{groups}{ A logical flag, indicating whether to use the last dimension as a grouping variable in the display. } \item{origin, stack}{ Arguments to \code{\link{panel.barchart}}. The defaults for the \code{table} method are different. } \item{horizontal}{ Logical flag, indicating whether the plot should be horizontal (with the categorical variable on the y-axis) or vertical. } \item{\dots}{ Other arguments, passed to the underlying \code{formula} method. } } \details{ The first dimension is used as the variable on the categorical axis. The last dimension is optionally used as a grouping variable (to produce stacked barcharts by default). All other dimensions are used as conditioning variables. The order of these variables cannot be altered (except by permuting the original argument beforehand using \code{\link{t}} or \code{\link{aperm}}). For more flexibility, use the formula method after converting the table to a data frame using the relevant \code{\link[base:table]{as.data.frame}} method. } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \seealso{ \code{\link{barchart}}, \code{\link{t}}, \code{\link{aperm}}, \code{\link{table}}, \code{\link{panel.barchart}}, \code{\link{Lattice}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ barchart(Titanic, scales = list(x = "free"), auto.key = list(title = "Survived")) } \keyword{hplot} lattice/man/oneway.Rd0000644000176200001440000000250214131537416014247 0ustar liggesusers\name{B_11_oneway} \alias{oneway} \title{ Fit One-way Model} \description{ Fits a One-way model to univariate data grouped by a factor, the result often being displayed using \code{rfs} } \usage{ oneway(formula, data, location=mean, spread=function(x) sqrt(var(x))) } \arguments{ \item{formula}{ formula of the form \code{y ~ x} where \code{y} is the numeric response and \code{x} is the grouping factor } \item{data}{ data frame in which the model is to be evaluated } \item{location}{ function or numeric giving the location statistic to be used for centering the observations, e.g. \code{median}, 0 (to avoid centering). } \item{spread}{ function or numeric giving the spread statistic to be used for scaling the observations, e.g. \code{sd}, 1 (to avoid scaling). } } \value{ A list with components \describe{ \item{\code{location}}{ vector of locations for each group.} \item{\code{spread}}{ vector of spreads for each group.} \item{\code{fitted.values}}{ vector of locations for each observation.} \item{\code{residuals}}{ residuals (\code{y - fitted.values}).} \item{\code{scaled.residuals}}{residuals scaled by \code{spread} for their group} } } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{rfs}}, \code{\link{Lattice}} } \keyword{dplot} lattice/man/splom.Rd0000644000176200001440000001667214413020055014101 0ustar liggesusers\name{B_08_splom} \title{Scatter Plot Matrices} \alias{splom} \alias{parallel} \alias{parallelplot} \alias{splom.matrix} \alias{splom.data.frame} \alias{parallelplot.matrix} \alias{parallelplot.data.frame} \alias{splom.formula} \alias{parallelplot.formula} \usage{ splom(x, data, \dots) parallelplot(x, data, \dots) \method{splom}{formula}(x, data, auto.key = lattice.getOption("default.args")$auto.key, aspect = 1, between = list(x = 0.5, y = 0.5), panel = lattice.getOption("panel.splom"), prepanel, scales, strip, groups, xlab, xlim, ylab = NULL, ylim, superpanel = lattice.getOption("panel.pairs"), pscales = 5, varnames = NULL, drop.unused.levels, \dots, lattice.options = NULL, default.scales, default.prepanel = lattice.getOption("prepanel.default.splom"), subset = TRUE) \method{parallelplot}{formula}(x, data, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", between = list(x = 0.5, y = 0.5), panel = lattice.getOption("panel.parallel"), prepanel, scales, strip, groups, xlab = NULL, xlim, ylab = NULL, ylim, varnames = NULL, horizontal.axis = TRUE, drop.unused.levels, \dots, lattice.options = NULL, default.scales, default.prepanel = lattice.getOption("prepanel.default.parallel"), subset = TRUE) \method{splom}{data.frame}(x, data = NULL, \dots, groups = NULL, subset = TRUE) \method{splom}{matrix}(x, data = NULL, \dots, groups = NULL, subset = TRUE) \method{parallelplot}{matrix}(x, data = NULL, \dots, groups = NULL, subset = TRUE) \method{parallelplot}{data.frame}(x, data = NULL, \dots, groups = NULL, subset = TRUE) } \description{ Draw Conditional Scatter Plot Matrices and Parallel Coordinate Plots } \arguments{ \item{x}{ The object on which method dispatch is carried out. For the \code{"formula"} method, a formula describing the structure of the plot, which should be of the form \code{~ x | g1 * g2 * \dots}, where \code{x} is a data frame or matrix. Each of \code{g1,g2,\dots} must be either factors or shingles. The conditioning variables \code{g1, g2, \dots} may be omitted. For the \code{data.frame} methods, a data frame. } \item{data}{ For the \code{formula} methods, an optional data frame in which variables in the formula (as well as \code{groups} and \code{subset}, if any) are to be evaluated. } \item{aspect}{ aspect ratio of each panel (and subpanel), square by default for \code{splom}. } \item{between}{ to avoid confusion between panels and subpanels, the default is to show the panels of a splom plot with space between them. } \item{panel}{ For \code{parallelplot}, this has the usual interpretation, i.e., a function that creates the display within each panel. For \code{splom}, the terminology is slightly complicated. The role played by the panel function in most other high-level functions is played here by the \code{superpanel} function, which is responsible for the display for each conditional data subset. \code{panel} is simply an argument to the default \code{superpanel} function \code{panel.pairs}, and is passed on to it unchanged. It is used there to create each pairwise display. See \code{\link{panel.pairs}} for more useful options. } \item{superpanel}{ function that sets up the splom display, by default as a scatterplot matrix. } \item{pscales}{ a numeric value or a list, meant to be a less functional substitute for the \code{scales} argument in \code{xyplot} etc. This argument is passed to the \code{superpanel} function, and is handled by the default superpanel function \code{panel.pairs}. The help page for the latter documents this argument in more detail. } \item{varnames}{ A character or expression vector or giving names to be used for the variables in \code{x}. By default, the column names of \code{x}. } \item{horizontal.axis}{logical indicating whether the parallel axes should be laid out horizontally (\code{TRUE}) or vertically (\code{FALSE}). } \item{auto.key, prepanel, scales, strip, groups, xlab, xlim, ylab, ylim, drop.unused.levels, lattice.options, default.scales, subset}{ See \code{\link{xyplot}} } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{\dots}{ Further arguments. See corresponding entry in \code{\link{xyplot}} for non-trivial details. } } \details{ \code{splom} produces Scatter Plot Matrices. The role usually played by \code{panel} is taken over by \code{superpanel}, which takes a data frame subset and is responsible for plotting it. It is called with the coordinate system set up to have both x- and y-limits from \code{0.5} to \code{ncol(z) + 0.5}. The only built-in option currently available is \code{\link{panel.pairs}}, which calls a further panel function for each pair \code{(i, j)} of variables in \code{z} inside a rectangle of unit width and height centered at \code{c(i, j)} (see \code{\link{panel.pairs}} for details). Many of the finer customizations usually done via arguments to high level function like \code{xyplot} are instead done by \code{panel.pairs} for \code{splom}. These include control of axis limits, tick locations and prepanel calcultions. If you are trying to fine-tune your \code{splom} plot, definitely look at the \code{\link{panel.pairs}} help page. The \code{scales} argument is usually not very useful in \code{splom}, and trying to change it may have undesired effects. \code{\link{parallelplot}} draws Parallel Coordinate Plots. (Difficult to describe, see example.) These and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for \code{xyplot}, which should be consulted to learn more detailed usage. } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \seealso{ \code{\link{xyplot}}, \code{\link{Lattice}}, \code{\link{panel.pairs}}, \code{\link{panel.parallel}}. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ super.sym <- trellis.par.get("superpose.symbol") splom(~iris[1:4], groups = Species, data = iris, panel = panel.superpose, key = list(title = "Three Varieties of Iris", columns = 3, points = list(pch = super.sym$pch[1:3], col = super.sym$col[1:3]), text = list(c("Setosa", "Versicolor", "Virginica")))) splom(~iris[1:3]|Species, data = iris, layout=c(2,2), pscales = 0, varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"), page = function(...) { ltext(x = seq(.6, .8, length.out = 4), y = seq(.9, .6, length.out = 4), labels = c("Three", "Varieties", "of", "Iris"), cex = 2) }) parallelplot(~iris[1:4] | Species, iris) parallelplot(~iris[1:4], iris, groups = Species, horizontal.axis = FALSE, scales = list(x = list(rot = 90))) } \keyword{hplot} lattice/man/draw.colorkey.Rd0000644000176200001440000000161513657202215015532 0ustar liggesusers\name{D_draw.colorkey} \alias{draw.colorkey} \title{Produce a colorkey typically for levelplot} \description{ Creates (and optionally draws) a grid frame grob representing a color key that can be placed in other grid-based plots. Primarily used by \code{levelplot} when a color key is requested. } \usage{ draw.colorkey(key, draw = FALSE, vp = NULL) } \arguments{ \item{key}{ A list determining the key. See documentation for \code{\link{levelplot}}, in particular the section describing the \code{colorkey} argument, for details. } \item{draw}{ A scalar logical, indicating whether the grob is to be drawn. } \item{vp}{ The viewport in which to draw the grob, if applicable. } } \value{ A grid frame object (that inherits from \code{"grob"}) } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{xyplot}}, \code{\link{levelplot}}} \keyword{dplot} lattice/man/llines.Rd0000644000176200001440000002052414576262623014247 0ustar liggesusers\name{F_2_llines} \alias{larrows} \alias{llines} \alias{lpoints} \alias{lpolygon} \alias{lpolypath} \alias{lrect} \alias{lsegments} \alias{ltext} \alias{larrows.default} \alias{llines.default} \alias{lpoints.default} \alias{lpolygon.default} \alias{lpolypath.default} \alias{lrect.default} \alias{lsegments.default} \alias{ltext.default} \alias{lplot.xy} \alias{panel.arrows} \alias{panel.lines} \alias{panel.points} \alias{panel.polygon} \alias{panel.polypath} \alias{panel.rect} \alias{panel.segments} \alias{panel.text} \title{Replacements of traditional graphics functions} \description{ These functions are intended to replace common low level traditional graphics functions, primarily for use in panel functions. The originals can not be used (at least not easily) because lattice panel functions need to use grid graphics. Low level drawing functions in grid can be used directly as well, and is often more flexible. These functions are provided for convenience and portability. } \usage{ lplot.xy(xy, type, pch, lty, col, cex, lwd, font, fontfamily, fontface, col.line, col.symbol, alpha, fill, origin = 0, ..., identifier, name.type) larrows(...) llines(x, ...) lpoints(x, ...) lpolygon(x, ...) lpolypath(x, ...) lrect(...) lsegments(...) ltext(x, ...) \method{larrows}{default}(x0 = NULL, y0 = NULL, x1, y1, x2 = NULL, y2 = NULL, angle = 30, code = 2, length = 0.25, unit = "inches", ends = switch(code, "first", "last", "both"), type = "open", col = add.line$col, alpha = add.line$alpha, lty = add.line$lty, lwd = add.line$lwd, fill = NULL, font, fontface, ..., identifier, name.type) \method{llines}{default}(x, y = NULL, type = "l", col, alpha, lty, lwd, ..., identifier, name.type) \method{lpoints}{default}(x, y = NULL, type = "p", col, pch, alpha, fill, font, fontfamily, fontface, cex, ..., identifier, name.type) \method{lpolygon}{default}(x, y = NULL, border = "black", col = "transparent", fill = NULL, font, fontface, ..., rule = c("none", "winding", "evenodd"), identifier, name.type) \method{lpolypath}{default}(x, y = NULL, border = "black", col = "transparent", fill = NULL, font, fontface, ..., rule = c("winding", "evenodd"), identifier, name.type) \method{ltext}{default}(x, y = NULL, labels = seq_along(x), col, alpha, cex, srt = 0, lineheight, font, fontfamily, fontface, adj = c(0.5, 0.5), pos = NULL, offset = 0.5, ..., identifier, name.type) \method{lrect}{default}(xleft, ybottom, xright, ytop, x = (xleft + xright) / 2, y = (ybottom + ytop) / 2, width = xright - xleft, height = ytop - ybottom, col = "transparent", border = "black", lty = 1, lwd = 1, alpha = 1, just = "center", hjust = NULL, vjust = NULL, font, fontface, ..., identifier, name.type) \method{lsegments}{default}(x0, y0, x1, y1, x2, y2, col, alpha, lty, lwd, font, fontface, ..., identifier, name.type) panel.arrows(...) panel.lines(...) panel.points(...) panel.polygon(...) panel.rect(...) panel.segments(...) panel.text(...) } \arguments{ \item{ x, y, x0, y0, x1, y1, x2, y2, xy}{ locations. \code{x2} and \code{y2} are available for for S compatibility. } \item{length, unit}{ determines extent of arrow head. \code{length} specifies the length in terms of \code{unit}, which can be any valid grid unit as long as it doesn't need a \code{data} argument. \code{unit} defaults to inches, which is the only option in the base version of the function, \code{\link{arrows}}. } \item{angle, code, type, labels, srt, adj, pos, offset}{ arguments controlling behaviour. See respective base functions for details. For \code{larrows} and \code{panel.larrows}, \code{type} is either \code{"open"} or \code{"closed"}, indicating the type of arrowhead. } \item{ends}{ serves the same function as \code{code}, using descriptive names rather than integer codes. If specified, this overrides \code{code}} \item{col, alpha, lty, lwd, fill, pch, cex, lineheight, font, fontfamily, fontface, col.line, col.symbol, border}{ graphical parameters. \code{fill} applies to points when \code{pch} is in \code{21:25} and specifies the fill color, similar to the \code{bg} argument in the base graphics function \code{\link{points}}. For devices that support alpha-transparency, a numeric argument \code{alpha} between 0 and 1 can controls transparency. Be careful with this, since for devices that do not support alpha-transparency, nothing will be drawn at all if this is set to anything other than 0. \code{fill}, \code{font} and \code{fontface} are included in \code{lrect}, \code{larrows}, \code{lpolygon}, and \code{lsegments} only to ensure that they are not passed down (as \code{\link{gpar}} does not like them). } \item{origin}{ for \code{type="h"} or \code{type="H"}, the value to which lines drop down. } \item{xleft, ybottom, xright, ytop}{ see \code{\link{rect}}} \item{width, height, just, hjust, vjust}{ finer control over rectangles, see \code{\link[grid:grid.rect]{grid.rect}} } \item{...}{ extra arguments, passed on to lower level functions as appropriate. } \item{rule}{ character string specifying how \code{NA} values are interpreted for polygons and paths. This is mainly intended for paths (via \code{\link{grid.path}}), but can also be specified for polygons for convenience. For polygons, the default rule is \code{"none"}, which treats \code{NA}-separated segments as separate polygons. This value is only valid for polygons. For the other rules (\code{"winding"} or \code{"evenodd"}) these segments are interpreted as subpaths, possibly representing holes, of a single path, and are rendered using \code{\link{grid.path}}. Support and rendering speed may depend on the device being used. } \item{identifier}{ A character string that is prepended to the name of the grob that is created. } \item{name.type}{ A character value indicating whether the name of the grob should have panel or strip information added to it. Typically either \code{"panel"}, \code{"strip"}, \code{"strip.left"}, or \code{""} (for no extra information). } } \details{ These functions are meant to be grid replacements of the corresponding base R graphics functions, to allow existing Trellis code to be used with minimal modification. The functions \code{panel.*} are essentally identical to the \code{l*} versions, are recommended for use in new code (as opposed to ported code) as they have more readable names. See the documentation of the base functions for usage. Not all arguments are always supported. All these correspond to the default methods only. % For \code{ltext}, only values 0, .5 and 1 for \code{adj} % have any effect. } \note{ There is a new \code{type="H"} option wherever appropriate, which is similar to \code{type="h"}, but with horizontal lines. } \seealso{\code{\link{points}}, \code{\link{lines}}, \code{\link{rect}}, \code{\link{text}}, \code{\link{segments}}, \code{\link{arrows}}, \code{\link{Lattice}} } \examples{ SD <- 0.1 t <- seq(0, 2*pi, length.out = 50) + rnorm(50, sd = SD) d <- list(x = c(cos(t), NA, rev(0.5 * cos(t))) + rnorm(101, sd = SD), y = c(sin(t), NA, rev(0.5 * sin(t))) + rnorm(101, sd = SD)) ## rectangles xyplot(y ~ x, d, panel = panel.rect, col = 4, alpha = 0.5, width = 0.1, height = 0.1) ## points and lines xyplot(y ~ x, d, panel = panel.lines, col = 4, alpha = 0.5, type = "o", pch = 16) ## polygons and paths (with holes) xyplot(y ~ x, d, panel = panel.polygon, col = 4, alpha = 0.5, rule = "evenodd") ## Example adapted from https://journal.r-project.org/articles/RJ-2012-017/ x <- c(.1, .5, .9, NA, .4, .5, .6, NA, .4, .6, .5) y <- c(.1, .8, .1, NA, .5, .4, .5, NA, .3, .3, .2) d <- data.frame(x = x, y = y) xyplot(y ~ x, data = d, panel = panel.polygon, rule = "none", col = "grey") xyplot(y ~ x, data = d, panel = panel.polypath, rule = "winding", col = "grey") xyplot(y ~ x, data = d, panel = panel.polypath, rule = "evenodd", col = "grey") } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/trellis.device.Rd0000644000176200001440000001104014411535356015660 0ustar liggesusers\name{C_01_trellis.device} \alias{trellis.device} \title{ Initializing Trellis Displays } \description{ Initialization of a display device with appropriate graphical parameters. } \usage{ trellis.device(device = getOption("device"), color = !(dev.name == "postscript"), theme = lattice.getOption("default.theme"), new = TRUE, retain = FALSE, \dots) } \arguments{ \item{device}{ function (or the name of one as a character string) that starts a device. Admissible values depend on the platform and how \R was compiled (see \code{\link{Devices}}), but usually \code{"pdf"}, \code{"postscript"}, \code{"png"}, \code{"jpeg"} and at least one of \code{"X11"}, \code{"windows"} and \code{"quartz"} will be available. } \item{color}{ logical, whether the initial settings should be color or black and white. Defaults to \code{FALSE} for postscript devices, \code{TRUE} otherwise. Note that this only applies to the initial choice of colors, which can be overridden using \code{theme} or subsequent calls to \code{\link{trellis.par.set}} (and by arguments supplied directly in high level calls for some settings). } \item{theme}{ list of components that changes the settings of the device opened, or, a function that when called produces such a list. The function name can be supplied as a quoted string. These settings are only used to modify the default settings (determined by other arguments), and need not contain all possible parameters. A possible use of this argument is to change the default settings by specifying \code{lattice.options(default.theme = "col.whitebg")}. For back-compatibility, this is initially (when lattice is loaded) set to \code{getOption(lattice.theme)}. If \code{theme} is a function, it will not be supplied any arguments, however, it is guaranteed that a device will already be open when it is called, so one may use \code{.Device} inside the function to ascertain what device has been opened. } \item{new}{ logical flag indicating whether a new device should be started. If \code{FALSE}, the options for the current device are changed to the defaults determined by the other arguments. } \item{retain}{ logical. If \code{TRUE} and a setting for this device already exists, then that is used instead of the defaults for this device. By default, pre-existing settings are overwritten (and lost). } \item{name}{ name of the device for which the setting is required, as returned by \code{.Device} } \item{\dots}{ additional parameters to be passed to the \code{device} function, most commonly \code{file} for non-screen devices, as well as \code{height}, \code{width}, etc. See the help file for individual devices for admissible arguments. } } \details{ The \code{trellis.device} function sets up an R graphics device for use with lattice graphics, by opening the device if necessary, and defining a set of associated graphical parameters (colors, line types, fonts, etc.). Even if a device is opened without calling \code{trellis.device}, for example, by calling a device function directly, \code{trellis.device} is still called automatically when a \code{"trellis"} object is plotted. The default graphical settings used in this case can be customized using \code{\link{lattice.options}}. It is therefore rarely necessary for the user to call \code{trellis.device} explicitly. } \value{ None; \code{trellis.device} is called for the side effect of opening a device and / or setting associated graphical parameters. } \note{ Earlier versions of \code{trellis.device} had a \code{bg} argument to set the background color, but this is no longer supported. If supplied, the \code{bg} argument will be passed on to the device function; however, this will have no effect on the Trellis settings. It is rarely meaningful to change the background alone; if you feel the need to change the background, consider using the \code{theme} argument instead. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{Lattice}} for an overview of the \code{lattice} package. \code{\link{Devices}} for valid choices of \code{device} on your platform. \code{\link{standard.theme}} for the default theme and alternatives. } \keyword{dplot} lattice/man/make.groups.Rd0000644000176200001440000000260414131537416015203 0ustar liggesusers\name{D_make.groups} \alias{make.groups} \title{ Grouped data from multiple vectors } \description{ Combines two or more vectors, possibly of different lengths, producing a data frame with a second column indicating which of these vectors that row came from. This is mostly useful for getting data into a form suitable for use in high level Lattice functions. } \usage{ make.groups(\dots) } \arguments{ \item{\dots}{ one or more vectors of the same type (coercion is attempted if not), or one or more data frames with similar columns, with possibly differing number of rows. } } \value{ When all the input arguments are vectors, a data frame with two columns \describe{ \item{\code{data}}{ all the vectors supplied, concatenated } \item{\code{which}}{ factor indicating which vector the corresponding \code{data} value came from } } When all the input arguments are data frames, the result of \code{\link{rbind}} applied to them, along with an additional \code{which} column as described above. } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{Lattice}}} \examples{ sim.dat <- make.groups(uniform = runif(200), exponential = rexp(175), lognormal = rlnorm(150), normal = rnorm(125)) qqmath( ~ data | which, sim.dat, scales = list(y = "free")) } \keyword{dplot} lattice/man/panel.axis.Rd0000644000176200001440000001105314024327120014776 0ustar liggesusers\name{G_panel.axis} \alias{panel.axis} \alias{current.panel.limits} \title{Panel Function for Drawing Axis Ticks and Labels} \description{ \code{panel.axis} is the function used by lattice to draw axes. It is typically not used by users, except those wishing to create advanced annotation. Keep in mind issues of clipping when trying to use it as part of the panel function. \code{current.panel.limits} can be used to retrieve a panel's x and y limits. } \usage{ panel.axis(side = c("bottom", "left", "top", "right"), at, labels = TRUE, draw.labels = TRUE, check.overlap = FALSE, outside = FALSE, ticks = TRUE, half = !outside, which.half, tck = as.numeric(ticks), rot = if (is.logical(labels)) 0 else c(90, 0), text.col, text.alpha, text.cex, text.font, text.fontfamily, text.fontface, text.lineheight, line.col, line.lty, line.lwd, line.alpha) current.panel.limits(unit = "native") } \arguments{ \item{side}{ A character string indicating which side axes are to be drawn on. Partial specification is allowed. } \item{at}{ Numeric vector giving location of labels. Can be missing, in which case they are computed from the native coordinates of the active viewport. } \item{labels}{ The labels to go along with \code{at}, as a character vector or a vector of expressions. This only makes sense provided \code{at} is explicitly specified, as otherwise the provided labels may not match the computed \code{at} values. Alternatively, \code{labels} can be a logical flag: If \code{TRUE}, the labels are derived from \code{at}, otherwise, labels are empty. } \item{draw.labels}{ A logical indicating whether labels are to be drawn. } \item{check.overlap}{ A logical, whether to check for overlapping of labels. This also has the effect of removing \code{at} values that are \sQuote{too close} to the limits. } \item{outside}{ A logical flag, indicating whether to draw the labels outside the panel or inside. Note that \code{outside=TRUE} will only have a visible effect if clipping is disabled for the viewport (panel). } \item{ticks}{ Logical flag, whether to draw the tickmarks. } \item{half}{ Logical flag, indicating whether only around half the scales will be drawn for each side. This is primarily used for axis labeling in \code{\link{splom}}. } \item{which.half}{ Character string, either \code{"lower"} or \code{"upper"}, indicating which half is to be used for tick locations if \code{half = TRUE}. Defaults to whichever is suitable for \code{\link{splom}}. } \item{tck}{ A numeric scalar multiplier for tick length. Can be negative, in which case the ticks point inwards. } \item{rot}{ Rotation angle(s) for labels in degrees. Can be a vector of length 2 for x- and y-axes. } \item{text.col}{ Color for the axis label text. See \code{\link[grid]{gpar}} for more details on this and the other graphical parameters listed below. } \item{text.alpha}{ Alpha-transparency value for the axis label text. } \item{text.cex}{ Size multiplier for the axis label text. } \item{text.font, text.fontfamily, text.fontface}{ Font for the axis label text. } \item{text.lineheight}{ Line height for the axis label text. } \item{line.col}{ Color for the axis label text. } \item{line.lty}{ Color for the axis. } \item{line.lwd}{ Color for the axis. } \item{line.alpha}{ Alpha-transparency value for the axis. } \item{unit}{ Which grid \code{\link[grid:unit]{unit}} the values should be in. } } \details{ \code{panel.axis} can draw axis tick marks inside or outside a panel (more precisely, a grid viewport). It honours the (native) axis scales. Used in \code{\link{panel.pairs}} for \code{\link{splom}}, as well as for all the usual axis drawing by the print method for \code{"trellis"} objects. It can also be used to enhance plots \sQuote{after the fact} by adding axes. } \value{ \code{current.panel.limits} returns a list with components \code{xlim} and \code{ylim}, which are both numeric vectors of length 2, giving the scales of the current panel (viewport). The values correspond to the unit system specified by \code{\link[grid:unit]{unit}}, by default \code{"native"}. } \seealso{ \code{\link{Lattice}}, \code{\link{xyplot}}, \code{\link{trellis.focus}}, \code{\link[grid:unit]{unit}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/xyplot.ts.Rd0000644000176200001440000001627213070415115014732 0ustar liggesusers\name{B_01_xyplot.ts} \title{Time series plotting methods} \alias{xyplot.ts} \usage{ \method{xyplot}{ts}(x, data = NULL, screens = if (superpose) 1 else colnames(x), \dots, superpose = FALSE, cut = FALSE, type = "l", col = NULL, lty = NULL, lwd = NULL, pch = NULL, cex = NULL, fill = NULL, auto.key = superpose, panel = if (superpose) "panel.superpose" else "panel.superpose.plain", par.settings = list(), layout = NULL, as.table = TRUE, xlab = "Time", ylab = NULL, default.scales = list(y = list(relation = if (missing(cut)) "free" else "same"))) } \description{ This function handles time series plotting, including cut-and-stack plots. Examples are given of superposing, juxtaposing and styling different time series. } \arguments{ \item{x}{ an object of class \code{\link{ts}}, which may be multi-variate, i.e. have a matrix structure with multiple columns. } \item{data}{ not used, and must be left as \code{NULL}. } \item{\dots}{ additional arguments passed to \code{\link{xyplot}}, which may pass them on to \code{\link{panel.xyplot}}. } \item{screens}{ factor (or coerced to factor) whose levels specify which panel each series is to be plotted in. \code{screens = c(1, 2, 1)} would plot series 1, 2 and 3 in panels 1, 2 and 1. May also be a named list, see Details below. } \item{superpose}{ overlays all series in one panel (via \code{screens = 1}) and uses grouped style settings (from \code{trellis.par.get("superpose.line")}, etc). Note that this is just a convenience argument: its only action is to change the default values of other arguments. } \item{cut}{ defines a cut-and-stack plot. \code{cut} can be a \code{list} of arguments to the function \code{\link{equal.count}}, i.e. \code{number} (number of intervals to divide into) and \code{overlap} (the fraction of overlap between cuts, default 0.5). If \code{cut} is numeric this is passed as the \code{number} argument. \code{cut = TRUE} tries to choose an appropriate number of cuts (up to a maximum of 6), using \code{\link{banking}}, and assuming a square plot region. This should have the effect of minimising wasted space when \code{aspect = "xy"}. } \item{type, col, lty, lwd, pch, cex, fill}{ graphical arguments, which are processed and eventually passed to \code{\link{panel.xyplot}}. These arguments can also be vectors or (named) lists, see Details for more information. } \item{auto.key}{ a logical, or a list describing how to draw a key. See the \code{auto.key} entry in \code{\link{xyplot}}. The default here is to draw lines, not points, and any specified style arguments should show up automatically. } \item{panel}{ the panel function. It is recommended to leave this alone, but one can pass a \code{panel.groups} argument which is handled by \code{\link{panel.superpose}} for each series. } \item{par.settings}{ style settings beyond the standard \code{col}, \code{lty}, \code{lwd}, etc; see \code{\link{trellis.par.set}} and \code{\link{simpleTheme}}. } \item{layout}{ numeric vector of length 2 specifying number of columns and rows in the plot. The default is to fill columns with up to 6 rows. } \item{as.table}{ to draw panels from top to bottom. The order is determined by the order of columns in \code{x}. } \item{xlab, ylab}{ X axis and Y axis labels; see \code{\link{xyplot}}. Note in particular that \code{ylab} may be a character vector, in which case the labels are spaced out equally, to correspond to the panels; but \emph{NOTE} in this case the vector should be reversed OR the argument \code{as.table} set to \code{FALSE}. } \item{default.scales}{ \code{scales} specification. The default is set to have \code{"free"} Y axis scales unless \code{cut} is given. Note, users should pass the \code{scales} argument rather than \code{default.scales}. } } \details{ The handling of several graphical parameters is more flexible for multivariate series. These parameters can be vectors of the same length as the number of series plotted or are recycled if shorter. They can also be (partially) named list, e.g., \code{list(A = c(1,2), c(3,4))} in which \code{c(3, 4)} is the default value and \code{c(1, 2)} the value only for series \code{A}. The \code{screens} argument can be specified in a similar way. %% TODO: explain details of style settings, groups, etc? Some examples are given below. } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \author{ Gabor Grothendieck, Achim Zeileis, Deepayan Sarkar and Felix Andrews \email{felix@nfrac.org}. The first two authors developed \code{xyplot.ts} in their \pkg{zoo} package, including the \code{screens} approach. The third author developed a different \code{xyplot.ts} for cut-and-stack plots in the \pkg{latticeExtra} package. The final author fused these together. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} (cut-and-stack plots) } \seealso{ \code{\link{xyplot}}, \code{\link{panel.xyplot}}, \code{\link{plot.ts}}, \code{\link{ts}}, \code{\link[zoo]{xyplot.zoo}} in the \pkg{zoo} package. } \examples{ xyplot(ts(c(1:10,10:1))) ### Figure 14.1 from Sarkar (2008) xyplot(sunspot.year, aspect = "xy", strip = FALSE, strip.left = TRUE, cut = list(number = 4, overlap = 0.05)) ### A multivariate example; first juxtaposed, then superposed xyplot(EuStockMarkets, scales = list(y = "same")) xyplot(EuStockMarkets, superpose = TRUE, aspect = "xy", lwd = 2, type = c("l","g"), ylim = c(0, max(EuStockMarkets))) ### Examples using screens (these two are identical) xyplot(EuStockMarkets, screens = c(rep("Continental", 3), "UK")) xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental")) ### Automatic group styles xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"), superpose = TRUE) xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"), superpose = TRUE, xlim = extendrange(1996:1998), par.settings = standard.theme(color = FALSE)) ### Specifying styles for series by name xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"), col = list(DAX = "red", FTSE = "blue", "black"), auto.key = TRUE) xyplot(EuStockMarkets, screens = list(FTSE = "UK", "Continental"), col = list(DAX = "red"), lty = list(SMI = 2), lwd = 1:2, auto.key = TRUE) ### Example with simpler data, few data points set.seed(1) z <- ts(cbind(a = 1:5, b = 11:15, c = 21:25) + rnorm(5)) xyplot(z, screens = 1) xyplot(z, screens = list(a = "primary (a)", "other (b & c)"), type = list(a = c("p", "h"), b = c("p", "s"), "o"), pch = list(a = 2, c = 3), auto.key = list(type = "o")) } \keyword{hplot} \keyword{ ts } lattice/man/panel.dotplot.Rd0000644000176200001440000000426214413020055015522 0ustar liggesusers\name{F_1_panel.dotplot} \alias{panel.dotplot} \title{ Default Panel Function for dotplot} \description{ Default panel function for \code{dotplot}. } \usage{ panel.dotplot(x, y, horizontal = TRUE, pch, col, lty, lwd, col.line, levels.fos, groups = NULL, \dots, grid = lattice.getOption("default.args")$grid, identifier = "dotplot") } \arguments{ \item{x,y}{ variables to be plotted in the panel. Typically y is the \sQuote{factor} } \item{horizontal}{ logical. If FALSE, the plot is \sQuote{transposed} in the sense that the behaviours of x and y are switched. x is now the \sQuote{factor}. Interpretation of other arguments change accordingly. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{pch, col, lty, lwd, col.line}{ graphical parameters} \item{levels.fos}{ locations where reference lines will be drawn } \item{groups}{ grouping variable (affects graphical parameters)} \item{\dots}{ extra parameters, passed to \code{panel.xyplot} which is responsible for drawing the foreground points (\code{panel.dotplot} only draws the background reference lines). } \item{grid}{ A logical flag, or list specifying whether and how a background grid should be drawn. In its general form \code{grid} can be a list of arguments to be supplied to \code{\link{panel.grid}}, which is called with those arguments. If \code{FALSE}, no grid lines are drawn. \code{grid = TRUE} is roughly equivalent to \code{list(h = 0, v = -1)} if \code{horizontal = TRUE} and \code{list(h = -1, v = 0)} if \code{horizontal = FALSE}. In other words, grid lines are drawn only for the numeric axis, as reference lines for the categorical axis are drawn regardless of the value of \code{grid}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates (possibly grouped) Dotplot of \code{x} against \code{y} or vice versa } \seealso{\code{\link{dotplot}}} \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/panel.pairs.Rd0000644000176200001440000001651414411502706015164 0ustar liggesusers\name{F_1_panel.pairs} \alias{panel.pairs} \alias{diag.panel.splom} \title{ Default Superpanel Function for splom} \description{ This is the default superpanel function for \code{splom}. } \usage{ panel.pairs(z, panel = lattice.getOption("panel.splom"), lower.panel = panel, upper.panel = panel, diag.panel = "diag.panel.splom", as.matrix = FALSE, groups = NULL, panel.subscripts, subscripts, pscales = 5, prepanel.limits = scale_limits, varnames = colnames(z), varname.col, varname.cex, varname.font, varname.fontfamily, varname.fontface, axis.text.col, axis.text.cex, axis.text.font, axis.text.fontfamily, axis.text.fontface, axis.text.lineheight, axis.line.col, axis.line.lty, axis.line.lwd, axis.line.alpha, axis.line.tck, \dots) diag.panel.splom(x = NULL, varname = NULL, limits, at = NULL, labels = NULL, draw = TRUE, tick.number = 5, varname.col, varname.cex, varname.lineheight, varname.font, varname.fontfamily, varname.fontface, axis.text.col, axis.text.alpha, axis.text.cex, axis.text.font, axis.text.fontfamily, axis.text.fontface, axis.text.lineheight, axis.line.col, axis.line.alpha, axis.line.lty, axis.line.lwd, axis.line.tck, \dots) } \arguments{ \item{z}{ The data frame used for the plot.} \item{panel, lower.panel, upper.panel}{ The panel function used to display each pair of variables. If specified, \code{lower.panel} and \code{upper.panel} are used for panels below and above the diagonal respectively. In addition to extra arguments not recognized by \code{panel.pairs}, the list of arguments passed to the panel function also includes arguments named \code{i} and \code{j}, with values indicating the row and column of the scatterplot matrix being plotted. } \item{diag.panel}{ The panel function used for the diagonals. See arguments to \code{diag.panel.splom} to know what arguments this function is passed when called. Use \code{diag.panel=NULL} to suppress plotting on the diagonal panels. } \item{as.matrix}{ logical. If \code{TRUE}, the layout of the panels will have origin on the top left instead of bottom left (similar to \code{pairs}). This is in essence the same functionality as provided by \code{as.table} for the panel layout } \item{groups}{ Grouping variable, if any } \item{panel.subscripts}{ logical specifying whether the panel function accepts an argument named \code{subscripts}. } \item{subscripts}{ The indices of the rows of \code{z} that are to be displayed in this (super)panel. } \item{pscales}{ Controls axis labels, passed down from \code{splom}. If \code{pscales} is a single number, it indicates the approximate number of equally-spaced ticks that should appear on each axis. If \code{pscales} is a list, it should have one component for each column in \code{z}, each of which itself a list with the following valid components: \code{at}: a numeric vector specifying tick locations \code{labels}: character vector labels to go with at \code{limits}: numeric 2-vector specifying axis limits (should be made more flexible at some point to handle factors) These are specifications on a per-variable basis, and used on all four sides in the diagonal cells used for labelling. Factor variables are labelled with the factor names. Use \code{pscales=0} to supress the axes entirely. } \item{prepanel.limits}{ A function to calculate suitable axis limits given a single argument \code{x} containing a data vector. The return value of the function should be similar to the \code{xlim} or \code{ylim} argument documented in \code{\link{xyplot}}; that is, it should be a numeric or DateTime vector of length 2 defining a range, or a character vector representing levels of a factor. Most high-level lattice plots (such as \code{xyplot}) use the \code{prepanel} function for deciding on axis limits from data. This function serves a similar function by calculating the per-variable limits. These limits can be overridden by the corresponding \code{limits} component in the \code{pscales} list. } \item{x}{ data vector corresponding to that row / column (which will be the same for diagonal \sQuote{panels}). } \item{varname}{ (scalar) character string or expression that is to be written centred within the panel } \item{limits}{ numeric of length 2, or, vector of characters, specifying the scale for that panel (used to calculate tick locations when missing) } \item{at}{ locations of tick marks} \item{labels}{ optional labels for tick marks} \item{draw}{ A logical flag specifying whether to draw the tick marks and labels. If \code{FALSE}, variable names are shown but axis annotation is omitted. } \item{tick.number}{ A Numeric scalar giving the suggested number of tick marks. } \item{varnames}{ A character or expression vector or giving names to be used for the variables in \code{x}. By default, the column names of \code{x}. } \item{varname.col}{ Color for the variable name in each diagonal panel. See \code{\link[grid]{gpar}} for details on this and the other graphical parameters listed below. } \item{varname.cex}{ Size multiplier for the variable name in each diagonal panel. } \item{varname.lineheight}{ Line height for the variable name in each diagonal panel. } \item{varname.font, varname.fontfamily, varname.fontface}{ Font specification for the variable name in each diagonal panel. } \item{axis.text.col}{ Color for axis label text. } \item{axis.text.cex}{ Size multiplier for axis label text. } \item{axis.text.font, axis.text.fontfamily, axis.text.fontface}{ Font specification for axis label text. } \item{axis.text.lineheight}{ Line height for axis label text. } \item{axis.text.alpha}{ Alpha-transparency for axis label text. } \item{axis.line.col}{ Color for the axes. } \item{axis.line.lty}{ Line type for the axes. } \item{axis.line.lwd}{ Line width for the axes. } \item{axis.line.alpha}{ Alpha-transparency for the axes. } \item{axis.line.tck}{ A numeric multiplier for the length of tick marks in diagonal panels. } \item{\dots}{ Further arguments, passed on to \code{panel}, \code{lower.panel}, \code{upper.panel}, and \code{diag.panel} from \code{panel.pairs}. Currently ignored by \code{diag.panel.splom}. } } \details{ \code{panel.pairs} is the function that is actually used as the panel function in a \code{"trellis"} object produced by \code{splom}. } \examples{ Cmat <- outer(1:6,1:6, function(i,j) hcl.colors(11)[i+j-1]) ## rainbow(11, start=.12, end=.5)[i+j-1]) splom(~diag(6), as.matrix = TRUE, panel = function(x, y, i, j, ...) { panel.fill(Cmat[i,j]) panel.text(.5,.5, paste("(",i,",",j,")",sep="")) }) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{splom}}} \keyword{dplot} lattice/man/Lattice.Rd0000644000176200001440000002141114410476306014332 0ustar liggesusers\name{A_01_Lattice} \alias{Lattice} \alias{lattice} \alias{lattice-package} \title{Lattice Graphics} \description{ The \pkg{lattice} add-on package is an implementation of Trellis graphics for \R. It is a powerful and elegant high-level data visualization system with an emphasis on multivariate data. It is designed to meet most typical graphics needs with minimal tuning, but can also be easily extended to handle most nonstandard requirements. } \details{ Trellis Graphics, originally developed for S and S-PLUS at the Bell Labs, is a framework for data visualization developed by R. A. Becker, W. S. Cleveland, et al, extending ideas presented in Cleveland's 1993 book \emph{Visualizing Data}. The Lattice API is based on the original design in S, but extends it in many ways. The Lattice user interface primarily consists of several \sQuote{high-level} generic functions (listed below in the \dQuote{See Also} section), each designed to create a particular type of display by default. Although the functions produce different output, they share many common features, reflected in several common arguments that affect the resulting displays in similar ways. These arguments are extensively (sometimes only) documented in the help page for \code{\link{xyplot}}, which also includes a discussion of the important topics of \emph{conditioning} and control of the Trellis layout. Features specific to other high-level functions are documented in their respective help pages. Lattice employs an extensive system of user-controllable settings to determine the look and feel of the displays it produces. To learn how to use and customize the graphical parameters used by lattice, see \code{\link{trellis.par.set}}. For other settings, see \code{\link{lattice.options}}. The default graphical settings are (potentially) different for different graphical devices. To learn how to initialize new devices with the desired settings or change the settings of the current device, see \code{\link{trellis.device}}. It is usually unnecessary, but sometimes important to be able to plot multiple lattice plots on a single page. Such capabilities are described in the \code{\link{print.trellis}} help page. See \code{\link{update.trellis}} to learn about manipulating a \code{"trellis"} object. Tools to augment lattice plots after they are drawn (including \code{\link{locator}}-like functionality) are described in the \code{\link{trellis.focus}} help page. The online documentation accompanying the package is complete, and effort has been made to present the help pages in a logical sequence, so that one can learn how to use lattice by reading the PDF reference manual available at \url{https://cran.r-project.org/package=lattice}. However, the format in which the online documentation is written and the breadth of topics covered necessarily makes it somewhat terse and less than ideal as a first introduction. For a more gentle introduction, a book on lattice is available as part of Springer's \sQuote{Use R} series; see the \dQuote{References} section below. % Furthermore, short vignettes focusing on particular topics are % available from the Lattice website at % \url{http://lattice.r-forge.r-project.org/} } \note{ High-level \pkg{lattice} functions like \code{\link{xyplot}} are different from traditional \R graphics functions in that they do not perform any plotting themselves. Instead, they return an object, of class \code{"trellis"}, which has to be then \code{\link[lattice:print.trellis]{print}}-ed or \code{\link[lattice:print.trellis]{plot}}-ted to create the actual plot. Due to \R's automatic printing rule, it is usually not necessary to explicitly carry out the second step, and \pkg{lattice} functions appear to behave like their traditional counterparts. However, the automatic plotting is suppressed when the high-level functions are called inside another function (most often \code{source}) or in other contexts where automatic printing is suppressed (e.g., \code{\link{for}} or \code{\link{while}} loops). In such situations, an explicit call to \code{print} or \code{plot} is required. The \pkg{lattice} package is based on the Grid graphics engine and requires the \pkg{grid} add-on package. One consquence of this is that it is not (readily) compatible with traditional \R graphics tools. In particular, changing \code{par()} settings usually has no effect on Lattice plots; \pkg{lattice} provides its own interface for querying and modifying an extensive set of graphical and non-graphical settings. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. ISBN: 978-0-387-75968-5 \url{http://lmdvr.r-forge.r-project.org/} Cleveland, William .S. (1993) \emph{Visualizing Data}, Hobart Press, Summit, New Jersey. Becker, R. A. and Cleveland, W. S. and Shyu, M. J. (1996). \dQuote{The Visual Design and Control of Trellis Display}, \emph{Journal of Computational and Graphical Statistics}, \bold{5(2)}, 123--155. Bell Lab's Trellis Page contains several documents outlining the use of Trellis graphics; these provide a holistic introduction to the Trellis paradigm: \url{http://web.archive.org/web/20081020164041/http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/display.writing.html} } \seealso{ The following is a list of high-level functions in the \pkg{lattice} package and their default displays. In all cases, the actual display is produced by the so-called \dQuote{panel} function, which has a suitable default, but can be substituted by an user defined function to create customized displays. In many cases, the default panel function will itself have many optional arguments to customize its output. The default panel functions are named as \dQuote{\code{panel.}} followed by the name of the corresponding high-level function; i.e., the default panel function for \code{\link{xyplot}} is \code{\link{panel.xyplot}}, the one for \code{\link{histogram}} is \code{\link{panel.histogram}}, etc. Each default panel function has a separate help page, linked from the help pages of the corresponding high-level function. Although documented separately, arguments to these panel functions can be supplied directly to the high-level functions, which will pass on the arguments appropriately. \bold{Univariate:} \describe{ \item{\code{\link{barchart}}:}{ Bar plots. } \item{\code{\link{bwplot}}:}{ Box-and-whisker plots. } \item{\code{\link{densityplot}}:}{ Kernel density estimates. } \item{\code{\link{dotplot}}:}{ Cleveland dot plots. } \item{\code{\link{histogram}}:}{ Histograms. } \item{\code{\link{qqmath}}:}{ Theretical quantile plots. } \item{\code{\link{stripplot}}:}{ One-dimensional scatterplots. } } \bold{Bivariate:} \describe{ \item{\code{\link{qq}}:}{ Quantile plots for comparing two distributions. } \item{\code{\link{xyplot}}:}{ Scatterplots and time-series plots (and potentially a lot more). } } \bold{Trivariate:} \describe{ \item{\code{\link{levelplot}}:}{ Level plots (similar to \code{\link{image}} plots). } \item{\code{\link{contourplot}}:}{ Contour plots. } \item{\code{\link{cloud}}:}{ Three-dimensional scatter plots. } \item{\code{\link{wireframe}}:}{ Three-dimensional surface plots (similar to \code{\link{persp}} plots). } } \bold{Hypervariate:} \describe{ \item{\code{\link{splom}}:}{ Scatterplot matrices. } \item{\code{\link{parallel}}:}{ Parallel coordinate plots. } } \bold{Miscellaneous:} \describe{ \item{\code{\link{rfs}}:}{ Residual and fitted value plots (also see \code{\link{oneway}}). } \item{\code{\link{tmd}}:}{ Tukey Mean-Difference plots. } } In addition, there are several panel functions that do little by themselves, but can be useful components of custom panel functions. These are documented in \code{\link{panel.functions}}. Lattice also provides a collection of convenience functions that correspond to the traditional graphics primitives \code{\link{lines}}, \code{\link{points}}, etc. These are implemented using Grid graphics, but try to be as close to the traditional versions as possible in terms of their argument list. These functions have names like \code{\link{llines}} or \code{\link{panel.lines}} and are often useful when writing (or porting from S-PLUS code) nontrivial panel functions. Finally, many useful enhancements that extend the Lattice system are available in the \pkg{latticeExtra} package. } \examples{ \dontrun{ ## Show brief history of changes to lattice, including ## a summary of new features. RShowDoc("NEWS", package = "lattice") } } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/banking.Rd0000644000176200001440000000411613070415115014351 0ustar liggesusers\name{G_banking} \alias{banking} \title{Banking} \description{ Calculates banking slope } \usage{ banking(dx, dy) } \arguments{ \item{dx, dy}{ vector of consecutive x, y differences. } } \details{ \code{banking} is the banking function used when \code{aspect = "xy"} in high level Trellis functions. It is usually not very meaningful except with \code{xyplot}. It considers the absolute slopes (based on \code{dx} and \code{dy}) and returns a value which when adjusted by the panel scale limits will make the median of the above absolute slopes correspond to a 45 degree line. This function was inspired by the discussion of banking in the documentation for Trellis Graphics available at Bell Labs' website (see \code{\link{Lattice}}), but is most likely identical to an algorithm described by Cleveland et al (see below). It is not clear (to the author) whether this is the algorithm used in S-PLUS. Alternative banking rules, implemented as a similar function, can be used as a drop-in replacement by suitably modifying \code{lattice.options("banking")}. } \examples{ ## with and without banking plot <- xyplot(sunspot.year ~ 1700:1988, xlab = "", type = "l", scales = list(x = list(alternating = 2)), main = "Yearly Sunspots") print(plot, position = c(0, .3, 1, .9), more = TRUE) print(update(plot, aspect = "xy", main = "", xlab = "Year"), position = c(0, 0, 1, .3)) ## cut-and-stack plot (see also xyplot.ts) xyplot(sunspot.year ~ time(sunspot.year) | equal.count(time(sunspot.year)), xlab = "", type = "l", aspect = "xy", strip = FALSE, scales = list(x = list(alternating = 2, relation = "sliced")), as.table = TRUE, main = "Yearly Sunspots") } \references{ Cleveland, William S. and McGill, Marylyn E. and McGill, Robert (1988) \dQuote{The Shape Parameter of a Two-variable Graph}, \emph{Journal of the American Statistical Association}, \bold{83}, 289--300. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{Lattice}}, \code{\link{xyplot}}} \keyword{dplot} lattice/man/shingles.Rd0000644000176200001440000000740213070415115014555 0ustar liggesusers\name{C_07_shingles} \alias{equal.count} \alias{plot.shingle} \alias{print.shingle} \alias{as.character.shingleLevel} \alias{print.shingleLevel} \alias{summary.shingle} \alias{as.data.frame.shingle} \alias{as.factorOrShingle} \alias{as.shingle} \alias{[.shingle} \alias{is.shingle} \alias{shingle} \title{shingles} \usage{ shingle(x, intervals=sort(unique(x))) equal.count(x, \dots) as.shingle(x) is.shingle(x) \method{plot}{shingle}(x, panel, xlab, ylab, \dots) \method{print}{shingle}(x, showValues = TRUE, \dots) \method{as.character}{shingleLevel}(x, \dots) \method{print}{shingleLevel}(x, \dots) \method{summary}{shingle}(object, showValues = FALSE, \dots) % \method{as.data.frame}{shingle}(x, row.names = NULL, optional = FALSE) \method{[}{shingle}(x, subset, drop = FALSE) as.factorOrShingle(x, subset, drop) } \description{ Functions to handle shingles } \arguments{ \item{x}{ numeric variable or R object, shingle in \code{plot.shingle} and \code{x[]}. An object (list of intervals) of class "shingleLevel" in \code{print.shingleLevel} } \item{object}{ shingle object to be summarized} \item{showValues}{ logical, whether to print the numeric part. If FALSE, only the intervals are printed} % \item{row.names}{ a character vector giving the row names for the data frame} % \item{optional}{ % logical. If \code{TRUE}, setting row names is optional % } \item{intervals}{ numeric vector or matrix with 2 columns} \item{subset}{logical vector} \item{drop}{whether redundant shingle levels are to be dropped} \item{panel, xlab, ylab}{ standard Trellis arguments (see \code{\link{xyplot}} ) } \item{\dots}{ other arguments, passed down as appropriate. For example, extra arguments to \code{equal.count} are passed on to \code{co.intervals}. graphical parameters can be passed as arguments to the \code{plot} method. } } \details{ A shingle is a data structure used in Trellis, and is a generalization of factors to \sQuote{continuous} variables. It consists of a numeric vector along with some possibly overlapping intervals. These intervals are the \sQuote{levels} of the shingle. The \code{levels} and \code{nlevels} functions, usually applicable to factors, also work on shingles. The implementation of shingles is slightly different from S. There are print methods for shingles, as well as for printing the result of \code{levels()} applied to a shingle. For use in labelling, the \code{as.character} method can be used to convert levels of a shingle to character strings. \code{equal.count} converts \code{x} to a shingle using the equal count algorithm. This is essentially a wrapper around \code{co.intervals}. All arguments are passed to \code{co.intervals}. \code{shingle} creates a shingle using the given \code{intervals}. If \code{intervals} is a vector, these are used to form 0 length intervals. \code{as.shingle} returns \code{shingle(x)} if \code{x} is not a shingle. \code{is.shingle} tests whether \code{x} is a shingle. \code{plot.shingle} displays the ranges of shingles via rectangles. \code{print.shingle} and \code{summary.shingle} describe the shingle object. } \value{ \code{x$intervals} for \code{levels.shingle(x)}, logical for \code{is.shingle}, an object of class \code{"trellis"} for \code{plot} (printed by default by \code{print.trellis}), and an object of class \code{"shingle"} for the others. } \examples{ z <- equal.count(rnorm(50)) plot(z) print(z) print(levels(z)) \testonly{data.frame(x = equal.count(rnorm(100)), y = rnorm(100))} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{xyplot}}, \code{\link{co.intervals}}, \code{\link{Lattice}} } \keyword{print} \keyword{hplot} \keyword{methods} \keyword{classes} lattice/man/prepanel.functions.Rd0000644000176200001440000000575013070415115016562 0ustar liggesusers\name{F_3_prepanel.functions} \alias{prepanel.lmline} \alias{prepanel.loess} \alias{prepanel.spline} \alias{prepanel.qqmathline} \title{ Useful Prepanel Function for Lattice} \description{ These are predefined prepanel functions available in Lattice. } \usage{ prepanel.lmline(x, y, \dots) prepanel.qqmathline(x, y = x, distribution = qnorm, probs = c(0.25, 0.75), qtype = 7, groups, subscripts, \dots) prepanel.loess(x, y, span, degree, family, evaluation, horizontal = FALSE, \dots) prepanel.spline(x, y, npoints = 101, horizontal = FALSE, \dots, keep.data = FALSE) } \arguments{ \item{x, y}{x and y values, numeric or factor} \item{distribution}{ quantile function for theoretical distribution. This is automatically passed in when this is used as a prepanel function in \code{qqmath}. } \item{qtype}{ type of \code{\link{quantile}}} \item{probs}{ numeric vector of length two, representing probabilities. If used with \code{aspect="xy"}, the aspect ratio will be chosen to make the line passing through the corresponding quantile pairs as close to 45 degrees as possible. } \item{span, degree, family, evaluation}{ Arguments controlling the underlying \code{\link{loess}} smooth. } \item{horizontal, npoints}{ See documentation for corresponding panel function. } \item{keep.data}{ Ignored. Present to capture argument of the same name in \code{\link{smooth.spline}}. } \item{groups, subscripts}{ See \code{\link{xyplot}}. Whenever appropriate, calculations are done separately for each group and then combined. } \item{\dots}{ Other arguments. These are passed on to other functions if appropriate (in particular, \code{\link{smooth.spline}}), and ignored otherwise. } } \details{ All these prepanel functions compute the limits to be large enough to contain all points as well as the relevant smooth. In addition, \code{prepanel.lmline} computes the \code{dx} and \code{dy} such that it reflects the slope of the linear regression line; for \code{prepanel.qqmathline}, this is the slope of the line passing through the quantile pairs specified by \code{probs}. For \code{prepanel.loess} and \code{prepanel.spline}, \code{dx} and \code{dy} reflect the piecewise slopes of the nonlinear smooth. } \value{ usually a list with components \code{xlim}, \code{ylim}, \code{dx} and \code{dy}, the first two being used to calculate panel axes limits, the last two for banking computations. The form of these components are described under \code{\link{xyplot}}. There are also several prepanel functions that serve as the default for high level functions, see \code{\link{prepanel.default.xyplot}} } \seealso{ \link{Lattice}, \code{\link{xyplot}}, \code{\link{banking}}, \code{\link{panel.loess}}, \code{\link{panel.spline}}. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/lattice.options.Rd0000644000176200001440000001417014413020055016055 0ustar liggesusers\name{C_04_lattice.options} \alias{lattice.options} \alias{lattice.getOption} \title{ Low-level Options Controlling Behaviour of Lattice } \description{ Functions to handle settings used by lattice. Their main purpose is to make code maintainance easier, and users normally should not need to use these functions. However, fine control at this level maybe useful in certain cases. } \usage{ lattice.options(\dots) lattice.getOption(name) } \arguments{ \item{name}{ character giving the name of a setting } \item{\dots}{ new options can be defined, or existing ones modified, using one or more arguments of the form \code{name = value} or by passing a list of such tagged values. Existing values can be retrieved by supplying the names (as character strings) of the components as unnamed arguments. } } \details{ These functions are modeled on \code{options} and \code{getOption}, and behave similarly for the most part. Some of the available components are documented here, but not all. The purpose of the ones not documented are either fairly obvious, or not of interest to the end-user. \describe{ \item{\code{panel.error}}{ A function, or \code{NULL}. If the former, every call to the panel function will be wrapped inside \code{\link{tryCatch}} with the specified function as an error handler. The default is to use the \code{\link{panel.error}} function. This prevents the plot from failing due to errors in a single panel, and leaving the grid operations in an unmanageable state. If set to \code{NULL}, errors in panel functions will not be caught using \code{tryCatch}. } \item{\code{save.object}}{ Logical flag indicating whether a \code{"trellis"} object should be saved when plotted for subsequent retrieval and further manipulation. Defaults to \code{TRUE}. } \item{\code{layout.widths}, \code{layout.heights}}{ Controls details of the default space allocation in the grid layout created in the course of plotting a \code{"trellis"} object. Each named component is a list of arguments to the \pkg{grid} function \code{\link{unit}} (\code{x}, \code{units}, and optionally \code{data}). Usually not of interest to the end-user, who should instead use the similiarly named component in the graphical settings, modifiable using \code{\link{trellis.par.set}}. } \item{\code{drop.unused.levels}}{ A list of two components named \code{cond} and \code{data}, both logical flags. The flags indicate whether the unused levels of factors (conditioning variables and primary variables respectively) will be dropped, which is usually relevant when a subsetting operation is performed or an 'interaction' is created. See \code{\link{xyplot}} for more details. Note that this does not control dropping of levels of the 'groups' argument. } \item{\code{legend.bbox}}{ A character string, either \code{"full"} or \code{"panel"}. This determines the interpretation of \code{x} and \code{y} when \code{space="inside"} in \code{key} (determining the legend; see \code{\link{xyplot}}): either the full figure region ('"full"'), or just the region that bounds the panels and strips ('"panel"'). } \item{\code{default.args}}{ A list giving default values for various standard arguments: \code{as.table}, \code{auto.key}, \code{aspect}, \code{between}, \code{grid}, \code{skip}, \code{strip}, \code{xscale.components}, \code{yscale.components}, and \code{axis}. } \item{\code{highlight.gpar}}{ A list giving arguments to \code{\link{gpar}} used to highlight a viewport chosen using \code{\link{trellis.focus}}. } \item{\code{banking}}{ The banking function. See \code{\link{banking}}. } \item{\code{axis.padding}}{ List with components named \code{"numeric"} and \code{"factor"}, both scalar numbers. Panel limits are extended by this amount, to provide padding for numeric and factor scales respectively. The value for numeric is multiplicative, whereas factor is additive. } \item{\code{skip.boundary.labels}}{ Numeric scalar between 0 and 1. Tick marks that are too close to the limits are not drawn unless explicitly requested. The limits are contracted by this proportion, and anything outside is skipped. } \item{\code{interaction.sep}}{ The separator for creating interactions with the extended formula interface (see \code{\link{xyplot}}). } \item{\code{optimize.grid}}{ Logical flag, \code{FALSE} by default. Complicated grid unit calculations can be slow. Sometimes these can be optimized at the cost of potential loss of accuracy. This option controls whether such optimization should be applied. } \item{\code{axis.units}}{ List determining default units for axis components. Should not be of interest to the end-user. } } In addition, there is an option for the default prepanel and panel function for each high-level function; e.g., \code{panel.xyplot} and \code{prepanel.default.xyplot} for \code{\link{xyplot}}. The options for the others have similarly patterned names. } \value{ \code{lattice.getOption} returns the value of a single component, whereas \code{lattice.options} always returns a list with one or more named components. When changing the values of components, the old values of the modified components are returned by \code{lattice.options}. If called without any arguments, the full list is returned. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{options}}, \code{\link{trellis.device}}, \code{\link{trellis.par.get}}, \code{\link{Lattice}} } \examples{ names(lattice.options()) str(lattice.getOption("layout.widths"), max.level = 2) \dontrun{ ## change default settings for subsequent plots lattice.options(default.args = list(as.table = TRUE, grid = TRUE, auto.key = TRUE)) } } \keyword{dplot} lattice/man/panel.levelplot.Rd0000644000176200001440000001530214411505564016053 0ustar liggesusers\name{F_1_panel.levelplot} \alias{panel.levelplot} \alias{panel.contourplot} \alias{panel.levelplot.raster} \title{ Panel Functions for levelplot and contourplot } \description{ These are the default panel functions for \code{\link{levelplot}} and \code{contourplot}. Also documented is an alternative raster-based panel function for use with \code{levelplot}. } \usage{ panel.levelplot(x, y, z, subscripts, at = pretty(z), shrink, labels, label.style = c("mixed", "flat", "align"), contour = FALSE, region = TRUE, col = add.line$col, lty = add.line$lty, lwd = add.line$lwd, border = "transparent", border.lty = 1, border.lwd = 0.1, \dots, region.type = c("grid", "contour"), col.regions = regions$col, alpha.regions = regions$alpha, identifier = "levelplot") panel.contourplot(\dots) panel.levelplot.raster(x, y, z, subscripts, at = pretty(z), ..., col.regions = regions$col, alpha.regions = regions$alpha, interpolate = FALSE, identifier = "levelplot") } \arguments{ \item{x, y, z}{ Variables defining the plot. } \item{subscripts}{ Integer vector indicating what subset of \code{x}, \code{y} and \code{z} to draw. } \item{at}{ Numeric vector giving breakpoints along the range of \code{z}. See \code{\link{levelplot}} for details. } \item{shrink}{ Either a numeric vector of length 2 (meant to work as both x and y components), or a list with components x and y which are numeric vectors of length 2. This allows the rectangles to be scaled proportional to the z-value. The specification can be made separately for widths (x) and heights (y). The elements of the length 2 numeric vector gives the minimum and maximum proportion of shrinkage (corresponding to min and max of z). } \item{labels}{ Either a logical scalar indicating whether the labels are to be drawn, or a character or expression vector giving the labels associated with the \code{at} values. Alternatively, \code{labels} can be a list with the following components: \describe{ \item{\code{labels}:}{ a character or expression vector giving the labels. This can be omitted, in which case the defaults will be used. } \item{\code{col, cex, alpha}:}{ graphical parameters for label texts } \item{\code{fontfamily, fontface, font}:}{ font used for the labels } } } \item{label.style}{ Controls how label positions and rotation are determined. A value of \code{"flat"} causes the label to be positioned where the contour is flattest, and the label is not rotated. A value of \code{"align"} causes the label to be drawn as far from the boundaries as possible, and the label is rotated to align with the contour at that point. The default is to mix these approaches, preferring the flattest location unless it is too close to the boundaries. } \item{contour}{ A logical flag, specifying whether contour lines should be drawn. } \item{region}{ A logical flag, specifying whether inter-contour regions should be filled with appropriately colored rectangles. } \item{col, lty, lwd}{ Graphical parameters for contour lines. } \item{border}{ Border color for rectangles used when \code{region=TRUE}. } \item{border.lty, border.lwd}{ Graphical parameters for the border} % \item{cex, col.text, font, fontfamily, fontface}{ graphical parameters for contour labels} \item{\dots}{ Extra parameters. } \item{region.type}{ A character string, one of \code{"grid"} and \code{"contour"}. The former (the default) uses a grid of rectangles to display the colors for the level plot; the latter uses a grid of polygons, mimicking the behavior of \code{\link{filled.contour}}, which gives a smoother appearance at the cost of increased processing time. The \code{"contour"} option requires \code{x} and \code{y} to be complete, in the sense that it must include all possible combinations in the underlying grid. However, \code{z} values are allowed to be missing. } \item{col.regions}{ A vector of colors, or a function to produce a vecor of colors, to be used if \code{region=TRUE}. Each interval defined by \code{at} is assigned a color, so the number of colors actually used is one less than the length of \code{at}. See \code{\link{level.colors}} for details on how the color assignment is done. } \item{alpha.regions}{ numeric scalar controlling transparency of facets } \item{interpolate}{ logical, passed to \code{\link{grid.raster}}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ The same panel function is used for both \code{levelplot} and \code{contourplot} (which differ only in default values of some arguments). \code{panel.contourplot} is a simple wrapper to \code{panel.levelplot}. When \code{contour=TRUE}, the \code{contourLines} function is used to calculate the contour lines. \code{panel.levelplot.raster} is an alternative panel function that uses the raster drawing abilities in R 2.11.0 and higher (through \code{\link{grid.raster}}). It has fewer options (e.g., can only render data on an equispaced grid), but can be more efficient. When using \code{panel.levelplot.raster}, it may be desirable to render the color key in the same way. This is possible, but must be done separately; see \code{\link{levelplot}} for details. } \examples{ require(grid) levelplot(rnorm(10) ~ 1:10 + sort(runif(10)), panel = panel.levelplot) suppressWarnings(plot(levelplot(rnorm(10) ~ 1:10 + sort(runif(10)), panel = panel.levelplot.raster, interpolate = TRUE))) levelplot(volcano, panel = panel.levelplot.raster) levelplot(volcano, panel = panel.levelplot.raster, col.regions = hcl.colors, cuts = 30, interpolate = TRUE) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}. The functionality of \code{region.type = "contour"} is based on code borrowed from the \pkg{gridGraphics} package, written by Zhijian (Jason) Wen and Paul Murrell and ported to lattice by Johan Larsson. } \seealso{ \code{\link{levelplot}}, \code{\link{level.colors}}, \code{\link{contourLines}}, \code{\link{filled.contour}} } \keyword{dplot} lattice/man/panel.number.Rd0000644000176200001440000000643013070415115015327 0ustar liggesusers\name{G_panel.number} \alias{current.row} \alias{current.column} \alias{packet.number} \alias{panel.number} \alias{which.packet} \alias{trellis.currentLayout} \title{Accessing Auxiliary Information During Plotting} \description{ Control over lattice plots are provided through a collection of user specifiable functions that perform various tasks during the plotting. Not all information is available to all functions. The functions documented here attempt to provide a consistent interface to access relevant information from within these user specified functions, namely those specified as the \code{panel}, \code{strip} and \code{axis} functions. Note that this information is not available to the \code{prepanel} function, which is executed prior to the actual plotting. } \usage{ current.row(prefix) current.column(prefix) panel.number(prefix) packet.number(prefix) which.packet(prefix) trellis.currentLayout(which = c("packet", "panel"), prefix) } \arguments{ \item{which}{ whether return value (a matrix) should contain panel numbers or packet numbers, which are usually, but not necessarily, the same (see below for details). } \item{prefix}{ A character string acting as a prefix identifying the plot of a \code{"trellis"} object. Only relevant when a particular page is occupied by more than one plot. Defaults to the value appropriate for the last \code{"trellis"} object printed. See \code{\link{trellis.focus}}. } } \value{ \code{trellis.currentLayout} returns a matrix with as many rows and columns as in the layout of panels in the current plot. Entries in the matrix are integer indices indicating which packet (or panel; see below) occupies that position, with 0 indicating the absence of a panel. \code{current.row} and \code{current.column} return integer indices specifying which row and column in the layout are currently active. \code{panel.number} returns an integer counting which panel is being drawn (starting from 1 for the first panel, a.k.a. the panel order). \code{packet.number} gives the packet number according to the packet order, which is determined by varying the first conditioning variable the fastest, then the second, and so on. \code{which.packet} returns the combination of levels of the conditioning variables in the form of a numeric vector as long as the number of conditioning variables, with each element an integer indexing the levels of the corresponding variable. } \note{ The availability of these functions make redundant some features available in earlier versions of lattice, namely optional arguments called \code{panel.number} and \code{packet.number} that were made available to \code{panel} and \code{strip}. If you have written such functions, it should be enough to replace instances of \code{panel.number} and \code{packet.number} by the corresponding function calls. You should also remove \code{panel.number} and \code{packet.number} from the argument list of your function to avoid a warning. If these accessor functions are not enough for your needs, feel free to contact the maintainer and ask for more. } \seealso{ \code{\link{Lattice}}, \code{\link{xyplot}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/histogram.Rd0000644000176200001440000003007214576262623014755 0ustar liggesusers\name{B_03_histogram} \alias{histogram} \alias{histogram.factor} \alias{histogram.numeric} \alias{histogram.formula} \alias{histogram.data.frame} \alias{densityplot} \alias{densityplot.numeric} \alias{densityplot.formula} \alias{densityplot.data.frame} \alias{do.breaks} \title{Histograms and Kernel Density Plots} \usage{ histogram(x, data, \dots) densityplot(x, data, \dots) \method{histogram}{formula}(x, data, allow.multiple, outer = TRUE, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.histogram"), prepanel, scales, strip, groups, xlab, xlim, ylab, ylim, type = c("percent", "count", "density"), nint = if (is.factor(x)) nlevels(x) else round(log2(length(x)) + 1), endpoints = extend.limits(range(as.numeric(x), finite = TRUE), prop = 0.04), breaks, equal.widths = TRUE, drop.unused.levels = lattice.getOption("drop.unused.levels"), \dots, lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.histogram"), subscripts, subset) \method{histogram}{data.frame}(x, data = NULL, formula = data, ...) \method{histogram}{numeric}(x, data = NULL, xlab, \dots) \method{histogram}{factor}(x, data = NULL, xlab, \dots) \method{densityplot}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.densityplot"), prepanel, scales, strip, groups, weights, xlab, xlim, ylab, ylim, bw, adjust, kernel, window, width, give.Rkern, n = 512, from, to, cut, na.rm, drop.unused.levels = lattice.getOption("drop.unused.levels"), \dots, lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.densityplot"), subscripts, subset) \method{densityplot}{data.frame}(x, data = NULL, formula = data, ...) \method{densityplot}{numeric}(x, data = NULL, xlab, \dots) do.breaks(endpoints, nint) } \description{ Draw Histograms and Kernel Density Plots, possibly conditioned on other variables. } \arguments{ \item{x}{ The object on which method dispatch is carried out. For the \code{formula} method, \code{x} can be a formula of the form \code{~ x | g1 * g2 * \dots}, indicating that histograms or kernel density estimates of the \code{x} variable should be produced conditioned on the levels of the (optional) variables \code{g1}, \code{g2}, \dots. \code{x} should be numeric (or possibly a factor in the case of \code{histogram}), and each of \code{g1}, \code{g2}, \dots should be either factors or shingles. As a special case, the right hand side of the formula can contain more than one term separated by \sQuote{+} signs (e.g., \code{~ x1 + x2 | g1 * g2}). What happens in this case is described in the documentation for \code{\link{xyplot}}. Note that in either form, all the terms in the formula must have the same length after evaluation. For the \code{numeric} and \code{factor} methods, \code{x} is the variable whose histogram or Kernel density estimate is drawn. Conditioning is not allowed in these cases. } \item{data}{ For the \code{formula} method, an optional data source (usually a data frame) in which variables are to be evaluated (see \code{\link{xyplot}} for details). \code{data} should not be specified for the other methods, and is ignored with a warning if it is. } \item{formula}{ The formula to be used for the \code{"data.frame"} methods. See documentation for argument \code{x} for details. } \item{type}{ A character string indicating the type of histogram that is to be drawn. \code{"percent"} and \code{"count"} give relative frequency and frequency histograms respectively, and can be misleading when breakpoints are not equally spaced. \code{"density"} produces a density histogram. \code{type} defaults to \code{"density"} when the breakpoints are unequally spaced, and when \code{breaks} is \code{NULL} or a function, and to \code{"percent"} otherwise. } \item{nint}{ An integer specifying the number of histogram bins, applicable only when \code{breaks} is unspecified or \code{NULL} in the call. Ignored when the variable being plotted is a factor. } \item{endpoints}{ A numeric vector of length 2 indicating the range of x-values that is to be covered by the histogram. This applies only when \code{breaks} is unspecified and the variable being plotted is not a factor. In \code{do.breaks}, this specifies the interval that is to be divided up. } \item{breaks}{ Usually a numeric vector of length (number of bins + 1) defining the breakpoints of the bins. Note that when breakpoints are not equally spaced, the only value of \code{type} that makes sense is density. When \code{breaks} is unspecified, the value of \code{lattice.getOption("histogram.breaks")} is first checked. If this value is \code{NULL}, then the default is to use \preformatted{ breaks = seq_len(1 + nlevels(x)) - 0.5 } when \code{x} is a factor, and \preformatted{ breaks = do.breaks(endpoints, nint) } otherwise. Breakpoints calculated in such a manner are used in all panels. If the retrieved value is not \code{NULL}, or if \code{breaks} is explicitly specified, it affects the display in each panel independently. Valid values are those accepted as the \code{breaks} argument in \code{\link{hist}}. In particular, this allows specification of \code{breaks} as an integer giving the number of bins (similar to \code{nint}), as a character string denoting a method, or as a function. When specified explicitly, a special value of \code{breaks} is \code{NULL}, in which case the number of bins is determined by \code{nint} and then breakpoints are chosen according to the value of \code{equal.widths}. } \item{equal.widths}{ A logical flag, relevant only when \code{breaks=NULL}. If \code{TRUE}, equally spaced bins will be selected, otherwise, approximately equal area bins will be selected (typically producing unequally spaced breakpoints). } \item{n}{ Integer, giving the number of points at which the kernel density is to be evaluated. Passed on as an argument to \code{\link{density}}. } \item{panel}{ A function, called once for each panel, that uses the packet (subset of panel variables) corresponding to the panel to create a display. The default panel functions \code{\link{panel.histogram}} and \code{\link{panel.densityplot}} are documented separately, and have arguments that can be used to customize its output in various ways. Such arguments can usually be directly supplied to the high-level function. } \item{allow.multiple, outer}{ See \code{\link{xyplot}}. } \item{auto.key}{ See \code{\link{xyplot}}. } \item{aspect}{ See \code{\link{xyplot}}. } \item{prepanel}{ See \code{\link{xyplot}}. } \item{scales}{ See \code{\link{xyplot}}. } \item{strip}{ See \code{\link{xyplot}}. } \item{groups}{ See \code{\link{xyplot}}. Note that the default panel function for \code{histogram} does not support grouped displays, whereas the one for \code{densityplot} does. } \item{xlab, ylab}{ See \code{\link{xyplot}}. } \item{xlim, ylim}{ See \code{\link{xyplot}}. } \item{drop.unused.levels}{ See \code{\link{xyplot}}. } \item{lattice.options}{ See \code{\link{xyplot}}. } \item{default.scales}{ See \code{\link{xyplot}}. } \item{subscripts}{ See \code{\link{xyplot}}. } \item{subset}{ See \code{\link{xyplot}}. } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{weights}{ numeric vector of weights for the density calculations, evaluated in the non-standard manner used for \code{groups} and terms in the formula, if any. If this is specified, it is subsetted using \code{subscripts} inside the panel function to match it to the corresponding \code{x} values. At the time of writing, \code{weights} do not work in conjunction with an extended formula specification (this is not too hard to fix, so just bug the maintainer if you need this feature). } \item{bw, adjust, width}{ Arguments controlling bandwidth. Passed on as arguments to \code{\link{density}}. } \item{kernel, window}{ The choice of kernel. Passed on as arguments to \code{\link{density}}. } \item{give.Rkern}{ Logical flag, passed on as argument to \code{\link{density}}. This argument is made available only for ease of implementation, and will produce an error if \code{TRUE}. } \item{from, to, cut}{ Controls range over which density is evaluated. Passed on as arguments to \code{\link{density}}. } \item{na.rm}{ Logical flag specifying whether \code{NA} values should be ignored. Passed on as argument to \code{\link{density}}, but unlike in \code{density}, the default is \code{TRUE}. } \item{\dots}{ Further arguments. See corresponding entry in \code{\link{xyplot}} for non-trivial details. } } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \details{ \code{histogram} draws Conditional Histograms, and \code{densityplot} draws Conditional Kernel Density Plots. The default panel function uses the \code{\link{density}} function to compute the density estimate, and all arguments accepted by \code{density} can be specified in the call to \code{densityplot} to control the output. See documentation of \code{density} for details. These and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for \code{xyplot}, which should be consulted to learn more detailed usage. \code{do.breaks} is an utility function that calculates breakpoints given an interval and the number of pieces to break it into. } \note{ The form of the arguments accepted by the default panel function \code{panel.histogram} is different from that in S-PLUS. Whereas S-PLUS calculates the heights inside \code{histogram} and passes only the breakpoints and the heights to the panel function, \pkg{lattice} simply passes along the original variable \code{x} along with the breakpoints. This approach is more flexible; see the example below with an estimated density superimposed over the histogram. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \seealso{ \code{\link{xyplot}}, \code{\link{panel.histogram}}, \code{\link{density}}, \code{\link{panel.densityplot}}, \code{\link{panel.mathdensity}}, \code{\link{Lattice}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ require(stats) histogram( ~ height | voice.part, data = singer, nint = 17, endpoints = c(59.5, 76.5), layout = c(2,4), aspect = 1, xlab = "Height (inches)") histogram( ~ height | voice.part, data = singer, xlab = "Height (inches)", type = "density", panel = function(x, ...) { panel.histogram(x, ...) panel.mathdensity(dmath = dnorm, col = "black", args = list(mean=mean(x),sd=sd(x))) } ) densityplot( ~ height | voice.part, data = singer, layout = c(2, 4), xlab = "Height (inches)", bw = 5) } \keyword{hplot} lattice/man/trellis.object.Rd0000644000176200001440000000537013070415115015666 0ustar liggesusers\name{D_trellis.object} \alias{trellis.object} \docType{class} %%\non_function{} \title{A Trellis Plot Object} \description{ This class of objects is returned by high level lattice functions, and is usually plotted by default by its \code{\link[lattice:print.trellis]{print}} method. } \details{ A trellis object, as returned by high level lattice functions like \code{\link{xyplot}}, is a list with the \code{"class"} attribute set to \code{"trellis"}. Many of the components of this list are simply the arguments to the high level function that produced the object. Among them are: \code{as.table}, \code{layout}, \code{page}, \code{panel}, \code{prepanel}, \code{main}, \code{sub}, \code{par.strip.text}, \code{strip}, \code{skip}, \code{xlab} \code{ylab}, \code{par.settings}, \code{lattice.options} and \code{plot.args}. Some other typical components are: \describe{ \item{\code{formula}}{ the Trellis formula used in the call } \item{\code{index.cond}}{ list with index for each of the conditioning variables } \item{\code{perm.cond}}{ permutation of the order of the conditioning variables } \item{\code{aspect.fill}}{ logical, whether \code{aspect} is \code{"fill"} } \item{\code{aspect.ratio}}{ numeric, aspect ratio to be used if \code{aspect.fill} is \code{FALSE} } \item{\code{call}}{ call that generated the object. } \item{\code{condlevels}}{ list with levels of the conditioning variables } \item{\code{legend}}{ list describing the legend(s) to be drawn } \item{\code{panel.args}}{ a list as long as the number of panels, each element being a list itself, containing the arguments in named form to be passed to the panel function in that panel. } \item{\code{panel.args.common}}{ a list containing the arguments common to all the panel functions in \code{name=value} form } \item{\code{x.scales}}{ list describing x-scale, can consist of several other lists, paralleling panel.args, if x-relation is not \code{"same"} } \item{\code{y.scales}}{ list describing y-scale, similar to \code{x.scales} } \item{\code{x.between}}{ numeric vector of interpanel x-space } \item{\code{y.between}}{ numeric vector of interpanel y-space } \item{\code{x.limits}}{ numeric vector of length 2 or list, giving x-axis limits } \item{\code{y.limits}}{ similar to \code{x.limits} } \item{\code{packet.sizes}}{ array recording the number of observations in each packet } } } \seealso{ \code{\link{Lattice}}, \code{\link{xyplot}}, \code{\link{print.trellis}} } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{classes} lattice/man/barley.Rd0000644000176200001440000000542513070415115014222 0ustar liggesusers\name{H_barley} \alias{barley} \docType{data} \title{ Yield data from a Minnesota barley trial } \description{ Total yield in bushels per acre for 10 varieties at 6 sites in each of two years. } \usage{barley} \format{ A data frame with 120 observations on the following 4 variables. \describe{ \item{yield}{Yield (averaged across three blocks) in bushels/acre.} \item{variety}{Factor with levels \code{"Svansota"}, \code{"No. 462"}, \code{"Manchuria"}, \code{"No. 475"}, \code{"Velvet"}, \code{"Peatland"}, \code{"Glabron"}, \code{"No. 457"}, \code{"Wisconsin No. 38"}, \code{"Trebi"}.} \item{year}{Factor with levels \code{1932}, \code{1931}} \item{site}{Factor with 6 levels: \code{"Grand Rapids"}, \code{"Duluth"}, \code{"University Farm"}, \code{"Morris"}, \code{"Crookston"}, \code{"Waseca"}} } } \details{ These data are yields in bushels per acre, of 10 varieties of barley grown in 1/40 acre plots at University Farm, St. Paul, and at the five branch experiment stations located at Waseca, Morris, Crookston, Grand Rapids, and Duluth (all in Minnesota). The varieties were grown in three randomized blocks at each of the six stations during 1931 and 1932, different land being used each year of the test. Immer et al. (1934) present the data for each Year*Site*Variety*Block. The data here is the average yield across the three blocks. Immer et al. (1934) refer (once) to the experiment as being conducted in 1930 and 1931, then later refer to it (repeatedly) as being conducted in 1931 and 1932. Later authors have continued the confusion. Cleveland (1993) suggests that the data for the Morris site may have had the years switched. } \source{ Immer, R. F., H. K. Hayes, and LeRoy Powers. (1934). Statistical Determination of Barley Varietal Adaptation. \emph{Journal of the American Society of Agronomy}, \bold{26}, 403--419. Wright, Kevin (2013). Revisiting Immer's Barley Data. \emph{The American Statistician}, \bold{67(3)}, 129--133. } \author{ Documentation contributed by Kevin Wright. } \references{ Cleveland, William S. (1993) \emph{Visualizing Data}. Hobart Press, Summit, New Jersey. Fisher, R. A. (1971) \emph{The Design of Experiments}. Hafner, New York, 9th edition. } \seealso{\code{\link[MASS]{immer}} in the MASS package for data from the same experiment (expressed as total yield for 3 blocks) for a subset of varieties.} \examples{ # Graphic suggesting the Morris data switched the years 1931 and 1932 # Figure 1.1 from Cleveland dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL) } \keyword{datasets} lattice/man/panel.violin.Rd0000644000176200001440000000534413070415115015342 0ustar liggesusers\name{F_2_panel.violin} \alias{panel.violin} \title{ Panel Function to create Violin Plots } \description{ This is a panel function that can create a violin plot. It is typically used in a high-level call to \code{bwplot}. } \usage{ panel.violin(x, y, box.ratio = 1, box.width, horizontal = TRUE, alpha, border, lty, lwd, col, varwidth = FALSE, bw, adjust, kernel, window, width, n = 50, from, to, cut, na.rm, \dots, identifier = "violin") } \arguments{ \item{x, y}{ numeric vector or factor. Violin plots are drawn for each unique value of \code{y} (\code{x}) if \code{horizontal} is \code{TRUE} (\code{FALSE}) } \item{box.ratio}{ ratio of the thickness of each violin and inter violin space } \item{box.width}{ thickness of the violins in absolute units; overrides \code{box.ratio}. Useful for specifying thickness when the categorical variable is not a factor, as use of \code{box.ratio} alone cannot achieve a thickness greater than 1. } \item{horizontal}{ logical. If FALSE, the plot is \sQuote{transposed} in the sense that the behaviours of \code{x} and \code{y} are switched. \code{x} is now the \sQuote{factor}. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{alpha, border, lty, lwd, col}{ graphical parameters controlling the violin. Defaults are taken from the \code{"plot.polygon"} settings. } \item{varwidth}{ logical. If \code{FALSE}, the densities are scaled separately for each group, so that the maximum value of the density reaches the limit of the allocated space for each violin (as determined by \code{box.ratio}). If \code{TRUE}, densities across violins will have comparable scale. } \item{bw, adjust, kernel, window, width, n, from, to, cut, na.rm}{ arguments to \code{\link{density}}, passed on as appropriate } \item{\dots}{ arguments passed on to \code{density}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates Violin plot of \code{x} for every level of \code{y}. Note that most arguments controlling the display can be supplied to the high-level (typically \code{bwplot}) call directly. } \examples{ bwplot(voice.part ~ height, singer, panel = function(..., box.ratio) { panel.violin(..., col = "transparent", varwidth = FALSE, box.ratio = box.ratio) panel.bwplot(..., fill = NULL, box.ratio = .1) } ) } \seealso{ \code{\link{bwplot}}, \code{\link{density}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/panel.qqmathline.Rd0000644000176200001440000000302013070415115016172 0ustar liggesusers\name{F_2_panel.qqmathline} \alias{panel.qqmathline} \title{Useful panel function with qqmath} \description{ Useful panel function with qqmath. Draws a line passing through the points (usually) determined by the .25 and .75 quantiles of the sample and the theoretical distribution. } \usage{ panel.qqmathline(x, y = x, distribution = qnorm, probs = c(0.25, 0.75), qtype = 7, groups = NULL, \dots, identifier = "qqmathline") } \arguments{ \item{x}{ The original sample, possibly reduced to a fewer number of quantiles, as determined by the \code{f.value} argument to \code{qqmath} } \item{y}{ an alias for \code{x} for backwards compatibility } \item{distribution}{ quantile function for reference theoretical distribution. } \item{probs}{ numeric vector of length two, representing probabilities. Corresponding quantile pairs define the line drawn. } \item{qtype}{ the \code{type} of quantile computation used in \code{\link{quantile}} } \item{groups}{ optional grouping variable. If non-null, a line will be drawn for each group. } \item{\dots}{other arguments.} \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{prepanel.qqmathline}}, \code{\link{qqmath}}, \code{\link{quantile}} } \keyword{dplot} lattice/man/ethanol.Rd0000644000176200001440000000401214413020055014362 0ustar liggesusers\name{H_ethanol} \alias{ethanol} \docType{data} \title{ Engine exhaust fumes from burning ethanol } \description{ Ethanol fuel was burned in a single-cylinder engine. For various settings of the engine compression and equivalence ratio, the emissions of nitrogen oxides were recorded. } \usage{ethanol} \format{ A data frame with 88 observations on the following 3 variables. \describe{ \item{NOx}{Concentration of nitrogen oxides (NO and NO2) in micrograms/J.} \item{C}{Compression ratio of the engine.} \item{E}{Equivalence ratio--a measure of the richness of the air and ethanol fuel mixture.} } } \source{ Brinkman, N.D. (1981) Ethanol Fuel---A Single-Cylinder Engine Study of Efficiency and Exhaust Emissions. \emph{SAE transactions}, \bold{90}, 1410--1424. } \author{ Documentation contributed by Kevin Wright. } \references{ Cleveland, William S. (1993) \emph{Visualizing Data}. Hobart Press, Summit, New Jersey. } \examples{ ## Constructing panel functions on the fly EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) prepanel.loess(x, y, span = 1), xlab = "Compression ratio", ylab = "NOx (micrograms/J)", panel = function(x, y) { panel.grid(h=-1, v= 2) panel.xyplot(x, y, grid = FALSE) panel.loess(x, y, span = 1) }, aspect = "xy") # Wireframe loess surface fit. See Figure 4.61 from Cleveland. require(stats) with(ethanol, { eth.lo <- loess(NOx ~ C * E, span = 1/3, parametric = "C", drop.square = "C", family="symmetric") eth.marginal <- list(C = seq(min(C), max(C), length.out = 25), E = seq(min(E), max(E), length.out = 25)) eth.grid <- expand.grid(eth.marginal) eth.fit <- predict(eth.lo, eth.grid) wireframe(eth.fit ~ eth.grid$C * eth.grid$E, shade=TRUE, screen = list(z = 40, x = -60, y=0), distance = .1, xlab = "C", ylab = "E", zlab = "NOx") }) } \keyword{datasets} lattice/man/USMortality.Rd0000644000176200001440000000710114413020055015166 0ustar liggesusers\name{H_USMortality} \alias{USMortality} \alias{USRegionalMortality} \docType{data} \title{ Mortality Rates in US by Cause and Gender } \description{ These datasets record mortality rates across all ages in the USA by cause of death, sex, and rural/urban status, 2011--2013. The two datasets represent the national aggregate rates and the region-wise rates for each administrative region under the Department of Health and Human Services (HHS). } \usage{ USMortality USRegionalMortality } \format{ \code{USRegionalMortality} is a data frame with 400 observations on the following 6 variables. \describe{ \item{\code{Region}}{A factor specifying HHS Region. See details.} \item{\code{Status}}{A factor with levels \code{Rural} and \code{Urban}} \item{\code{Sex}}{A factor with levels \code{Female} and \code{Male}} \item{\code{Cause}}{Cause of death. A factor with levels \code{Alzheimers}, \code{Cancer}, \code{Cerebrovascular diseases}, \code{Diabetes}, \code{Flu and pneumonia}, \code{Heart disease}, \code{Lower respiratory}, \code{Nephritis}, \code{Suicide}, and \code{Unintentional injuries}} \item{\code{Rate}}{Age-adjusted death rate per 100,000 population} \item{\code{SE}}{Standard error for the rate} } \code{USMortality} is a data frame with 40 observations, containing the same variables with the exception of \code{Region}. } \details{ The region-wise data give estimated rates separately for each of 10 HHS regions. The location of the regional offices and their coverage area, available from \url{https://www.hhs.gov/about/agencies/iea/regional-offices/index.html}, is given below. \describe{ \item{HHS Region 01 - Boston: }{ Connecticut, Maine, Massachusetts, New Hampshire, Rhode Island, and Vermont } \item{ HHS Region 02 - New York: }{ New Jersey, New York, Puerto Rico, and the Virgin Islands } \item{HHS Region 03 - Philadelphia: }{ Delaware, District of Columbia, Maryland, Pennsylvania, Virginia, and West Virginia} \item{HHS Region 04 - Atlanta: }{ Alabama, Florida, Georgia, Kentucky, Mississippi, North Carolina, South Carolina, and Tennessee} \item{HHS Region 05 - Chicago: }{ Illinois, Indiana, Michigan, Minnesota, Ohio, and Wisconsin} \item{HHS Region 06 - Dallas: }{ Arkansas, Louisiana, New Mexico, Oklahoma, and Texas } \item{HHS Region 07 - Kansas City: }{ Iowa, Kansas, Missouri, and Nebraska} \item{HHS Region 08 - Denver: }{ Colorado, Montana, North Dakota, South Dakota, Utah, and Wyoming} \item{HHS Region 09 - San Francisco: }{ Arizona, California, Hawaii, Nevada, American Samoa, Commonwealth of the Northern Mariana Islands, Federated States of Micronesia, Guam, Marshall Islands, and Republic of Palau} \item{HHS Region 10 - Seattle: }{ Alaska, Idaho, Oregon, and Washington} } } \references{ Rural Health Reform Policy Research Center. _Exploring Rural and Urban Mortality Differences_, August 2015 Bethesda, MD. \url{https://ruralhealth.und.edu/projects/health-reform-policy-research-center/rural-urban-mortality} } \examples{ dotplot(reorder(Cause, Rate) ~ Rate | Status, data = USMortality, groups = Sex, grid = FALSE, par.settings = simpleTheme(pch = 16), auto.key = list(columns = 2), scales = list(x = list(log = TRUE, equispaced.log = FALSE))) dotplot(reorder(Cause, Rate):Sex ~ Rate | Status, data = USRegionalMortality, groups = Sex, auto.key = FALSE, scales = list(x = list(log = TRUE, equispaced.log = FALSE))) } \keyword{datasets} lattice/man/prepanel.default.Rd0000644000176200001440000000666513070415115016204 0ustar liggesusers\name{F_3_prepanel.default} \alias{prepanel.default.bwplot} \alias{prepanel.default.histogram} \alias{prepanel.default.qq} \alias{prepanel.default.xyplot} \alias{prepanel.default.cloud} \alias{prepanel.default.levelplot} \alias{prepanel.default.qqmath} \alias{prepanel.default.densityplot} \alias{prepanel.default.parallel} \alias{prepanel.default.splom} \title{ Default Prepanel Functions } \description{ These prepanel functions are used as fallback defaults in various high level plot functions in Lattice. These are rarely useful to normal users but may be helpful in developing new displays. } \usage{ prepanel.default.bwplot(x, y, horizontal, nlevels, origin, stack, \dots) prepanel.default.histogram(x, breaks, equal.widths, type, nint, \dots) prepanel.default.qq(x, y, \dots) prepanel.default.xyplot(x, y, type, subscripts, groups, \dots) prepanel.default.cloud(perspective, distance, xlim, ylim, zlim, screen = list(z = 40, x = -60), R.mat = diag(4), aspect = c(1, 1), panel.aspect = 1, \dots, zoom = 0.8) prepanel.default.levelplot(x, y, subscripts, \dots) prepanel.default.qqmath(x, f.value, distribution, qtype, groups, subscripts, \dots, tails.n = 0) prepanel.default.densityplot(x, darg, groups, weights, subscripts, \dots) prepanel.default.parallel(x, y, z, \dots, horizontal.axis) prepanel.default.splom(z, \dots) } \arguments{ \item{x, y}{x and y values, numeric or factor} \item{horizontal}{ logical, applicable when one of the variables is to be treated as categorical (factor or shingle). } \item{horizontal.axis}{ logical indicating whether the parallel axes should be laid out horizontally (\code{TRUE}) or vertically (\code{FALSE}). } \item{nlevels}{ number of levels of such a categorical variable. } \item{origin, stack}{ for barcharts or the \code{type="h"} plot type} \item{breaks, equal.widths, type, nint}{ details of histogram calculations. \code{type} has a different meaning in \code{prepanel.default.xyplot} (see \code{\link{panel.xyplot}}) } \item{groups, subscripts}{ See \code{\link{xyplot}}. Whenever appropriate, calculations are done separately for each group and then combined. } \item{weights}{ numeric vector of weights for the density calculations. If this is specified, it is subsetted by \code{subscripts} to match it to \code{x}. } \item{perspective, distance, xlim, ylim, zlim, screen, R.mat, aspect, panel.aspect, zoom}{ see \code{\link{panel.cloud}}} \item{f.value, distribution, tails.n}{ see \code{panel.qqmath} } \item{darg}{ list of arguments passed to \code{\link{density}}} \item{z}{ see \code{\link{panel.parallel}} and \code{\link{panel.pairs}} } \item{qtype}{ type of \code{\link{quantile}}} \item{\dots}{ other arguments, usually ignored } } \value{ A list with components \code{xlim}, \code{ylim}, \code{dx} and \code{dy}, and possibly \code{xat} and \code{yat}, the first two being used to calculate panel axes limits, the last two for banking computations. The form of these components are described in the help page for \code{\link{xyplot}}. } \seealso{ \code{\link{xyplot}}, \code{\link{banking}}, \code{\link{Lattice}}. See documentation of corresponding panel functions for more details about the arguments. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/panel.loess.Rd0000644000176200001440000000362613070415115015170 0ustar liggesusers\name{F_2_panel.loess} \alias{panel.loess} \title{Panel Function to Add a LOESS Smooth} \description{ A predefined panel function that can be used to add a LOESS smooth based on the provided data. } \usage{ panel.loess(x, y, span = 2/3, degree = 1, family = c("symmetric", "gaussian"), evaluation = 50, lwd, lty, col, col.line, type, horizontal = FALSE, \dots, identifier = "loess") } \arguments{ \item{x, y}{ Variables defining the data to be used. } \item{lwd, lty, col, col.line}{ Graphical parameters for the added line. \code{col.line} overrides \code{col}. } \item{type}{ Ignored. The argument is present only to make sure that an explicitly specified \code{type} argument (perhaps meant for another function) does not affect the display. } \item{span, degree, family, evaluation}{ Arguments to \code{\link{loess.smooth}}, for which \code{panel.loess} is essentially a wrapper. } \item{horizontal}{ A logical flag controlling which variable is to be treated as the predictor (by default \code{x}) and which as the response (by default \code{y}). If \code{TRUE}, the plot is \sQuote{transposed} in the sense that \code{y} becomes the predictor and \code{x} the response. (The name \sQuote{horizontal} may seem an odd choice for this argument, and originates from similar usage in \code{\link{bwplot}}). } \item{\dots}{ Extra arguments, passed on to \code{\link{panel.lines}}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \value{ The object returned by \code{\link[stats:scatter.smooth]{loess.smooth}}. } \seealso{\link{Lattice}, \code{\link[stats:scatter.smooth]{loess.smooth}}, \code{\link{prepanel.loess}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/melanoma.Rd0000644000176200001440000000270513070415115014533 0ustar liggesusers\name{H_melanoma} \alias{melanoma} \docType{data} \title{ Melanoma skin cancer incidence } \description{ These data from the Connecticut Tumor Registry present age-adjusted numbers of melanoma skin-cancer incidences per 100,000 people in Connectict for the years from 1936 to 1972. } \usage{melanoma} \format{ A data frame with 37 observations on the following 2 variables. \describe{ \item{year}{Years 1936 to 1972.} \item{incidence}{Rate of melanoma cancer per 100,000 population.} } } \note{ This dataset is not related to the \code{\link[boot]{melanoma}} dataset in the \bold{boot} package with the same name. The S-PLUS 6.2 help for the melanoma data says that the incidence rate is per \emph{million}, but this is not consistent with data found at the National Cancer Institute (\url{https://www.cancer.gov/}). } \source{ Houghton, A., E. W. Munster, and M. V. Viola. (1978). Increased Incidence of Malignant Melanoma After Peaks of Sunspot Activity. \emph{The Lancet}, \bold{8}, 759--760. } \author{ Documentation contributed by Kevin Wright. } \references{ Cleveland, William S. (1993) \emph{Visualizing Data}. Hobart Press, Summit, New Jersey. } \examples{ # Time-series plot. Figure 3.64 from Cleveland. xyplot(incidence ~ year, data = melanoma, aspect = "xy", panel = function(x, y) panel.xyplot(x, y, type="o", pch = 16), ylim = c(0, 6), xlab = "Year", ylab = "Incidence") } \keyword{datasets} lattice/man/panel.barchart.Rd0000644000176200001440000000723313070415115015627 0ustar liggesusers\name{F_1_panel.barchart} \alias{panel.barchart} \title{ Default Panel Function for barchart} \description{ Default panel function for \code{barchart}. } \usage{ panel.barchart(x, y, box.ratio = 1, box.width, horizontal = TRUE, origin = NULL, reference = TRUE, stack = FALSE, groups = NULL, col = if (is.null(groups)) plot.polygon$col else superpose.polygon$col, border = if (is.null(groups)) plot.polygon$border else superpose.polygon$border, lty = if (is.null(groups)) plot.polygon$lty else superpose.polygon$lty, lwd = if (is.null(groups)) plot.polygon$lwd else superpose.polygon$lwd, \dots, identifier = "barchart") } \arguments{ \item{x}{ Extent of Bars. By default, bars start at left of panel, unless \code{origin} is specified, in which case they start there. } \item{y}{ Horizontal location of bars. Possibly a factor. } \item{box.ratio}{ Ratio of bar width to inter-bar space. } \item{box.width}{ Thickness of bars in absolute units; overrides \code{box.ratio}. Useful for specifying thickness when the categorical variable is not a factor, as use of \code{box.ratio} alone cannot achieve a thickness greater than 1. } \item{horizontal}{ Logical flag. If FALSE, the plot is \sQuote{transposed} in the sense that the behaviours of x and y are switched. x is now the \sQuote{factor}. Interpretation of other arguments change accordingly. See documentation of \code{\link{bwplot}} for a fuller explanation. } \item{origin}{ The origin for the bars. For grouped displays with \code{stack = TRUE}, this argument is ignored and the origin set to 0. Otherwise, defaults to \code{NULL}, in which case bars start at the left (or bottom) end of a panel. This choice is somewhat unfortuntate, as it can be misleading, but is the default for historical reasons. For tabular (or similar) data, \code{origin = 0} is usually more appropriate; if not, one should reconsider the use of a bar chart in the first place (dot plots are often a good alternative). } \item{reference}{ Logical, whether a reference line is to be drawn at the origin. } \item{stack}{ logical, relevant when groups is non-null. If \code{FALSE} (the default), bars for different values of the grouping variable are drawn side by side, otherwise they are stacked. } \item{groups}{ Optional grouping variable. } \item{col, border, lty, lwd}{ Graphical parameters for the bars. By default, the trellis parameter \code{plot.polygon} is used if there is no grouping variable, otherwise \code{superpose.polygon} is used. \code{col} gives the fill color, \code{border} the border color, and \code{lty} and \code{lwd} the line type and width of the borders. } \item{\dots}{ Extra arguments will be accepted but ignored. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ A barchart is drawn in the panel. Note that most arguments controlling the display can be supplied to the high-level \code{barchart} call directly. } \seealso{ \code{\link{barchart}} } \examples{ barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), origin = 0, ylab = "Barley Yield (bushels/acre)", scales = list(x = list(abbreviate = TRUE, minlength = 5))) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/update.trellis.Rd0000644000176200001440000001154213070415115015700 0ustar liggesusers\name{C_06_update.trellis} \alias{update.trellis} \alias{[.trellis} \alias{t.trellis} \alias{trellis.last.object} \title{Retrieve and Update Trellis Object} \description{ Update method for objects of class \code{"trellis"}, and a way to retrieve the last printed trellis object (that was saved). } \usage{ \method{update}{trellis}(object, panel, aspect, as.table, between, key, auto.key, legend, layout, main, page, par.strip.text, prepanel, scales, skip, strip, strip.left, sub, xlab, ylab, xlab.top, ylab.right, xlim, ylim, xscale.components, yscale.components, axis, par.settings, plot.args, lattice.options, index.cond, perm.cond, \dots) \method{t}{trellis}(x) \method{[}{trellis}(x, i, j, \dots, drop = FALSE) trellis.last.object(\dots, prefix) } \arguments{ \item{object, x}{ The object to be updated, of class \code{"trellis"}. } \item{i, j}{ indices to be used. Names are not currently allowed. } \item{drop}{ logical, whether dimensions with only one level are to be dropped. Currently ignored, behaves as if it were \code{FALSE}. } % \item{warn}{ % logical, whether to warn when no plot is saved. % } \item{panel, aspect, as.table, between, key, auto.key, legend, layout, main, page, par.strip.text, prepanel, scales, skip, strip, strip.left, sub, xlab, ylab, xlab.top, ylab.right, xlim, ylim, xscale.components, yscale.components, axis, par.settings, plot.args, lattice.options, index.cond, perm.cond, \dots}{ arguments that will be used to update \code{object}. See details below. } \item{prefix}{ A character string acting as a prefix identifying the plot of a \code{"trellis"} object. Only relevant when a particular page is occupied by more than one plot. Defaults to the value appropriate for the last \code{"trellis"} object printed. See \code{\link{trellis.focus}}. } } \details{ All high level lattice functions such as \code{xyplot} produce an object of (S3) class \code{"trellis"}, which is usually displayed by its \code{print} method. However, the object itself can be manipulated and modified to a large extent using the \code{update} method, and then re-displayed as needed. Most arguments to high level functions can also be supplied to the \code{update} method as well, with some exceptions. Generally speaking, anything that would needs to change the data within each panel is a no-no (this includes the \code{formula, data, groups, subscripts} and \code{subset}). Everything else is technically game, though might not be implemented yet. If you find something missing that you wish to have, feel free to make a request. Not all arguments accepted by a Lattice function are processed by \code{update}, but the ones listed above should work. The purpose of these arguments are described in the help page for \code{\link{xyplot}}. Any other argument is added to the list of arguments to be passed to the \code{panel} function. Because of their somewhat special nature, updates to objects produced by \code{cloud} and \code{wireframe} do not work very well yet. The \code{"["} method is a convenient shortcut for updating \code{index.cond}. The \code{t} method is a convenient shortcut for updating \code{perm.cond} in the special (but frequent) case where there are exactly two conditioning variables, when it has the effect of switching (\sQuote{transposing}) their order. The print method for \code{"trellis"} objects optionally saves the object after printing it. If this feature is enabled, \code{trellis.last.object} can retrieve it. By default, the last object plotted is retrieved, but if multiple objects are plotted on the current page, then others can be retrieved using the appropriate \code{prefix} argument. If \code{\link{trellis.last.object}} is called with arguments, these are used to update the retrieved object before returning it. } % WAS: \dontrun{ % trellis.last.object(xlab = "Year") % } \examples{ spots <- by(sunspots, gl(235, 12, labels = 1749:1983), mean) old.options <- lattice.options(save.object = TRUE) xyplot(spots ~ 1749:1983, xlab = "", type = "l", scales = list(x = list(alternating = 2)), main = "Average Yearly Sunspots") update(trellis.last.object(), aspect = "xy") trellis.last.object(xlab = "Year") lattice.options(old.options) } \value{ An object of class \code{trellis}, by default plotted by \code{print.trellis}. \code{trellis.last.object} returns \code{NULL} is no saved object is available. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{trellis.object}}, \code{\link{Lattice}}, \code{\link{xyplot}} } \keyword{dplot} lattice/man/simpleTheme.Rd0000644000176200001440000000670513070415115015222 0ustar liggesusers\name{C_03_simpleTheme} \alias{simpleTheme} \title{ Function to generate a simple theme } \description{ Simple interface to generate a list appropriate as a theme, typically used as the \code{par.settings} argument in a high level call } \usage{ simpleTheme(col, alpha, cex, pch, lty, lwd, font, fill, border, col.points, col.line, alpha.points, alpha.line) } \arguments{ \item{col, col.points, col.line}{ A color specification. \code{col} is used for components \code{"plot.symbol"}, \code{"plot.line"}, \code{"plot.polygon"}, \code{"superpose.symbol"}, \code{"superpose.line"}, and \code{"superpose.polygon"}. \code{col.points} overrides \code{col}, but is used only for \code{"plot.symbol"} and \code{"superpose.symbol"}. Similarly, \code{col.line} overrides \code{col} for \code{"plot.line"} and \code{"superpose.line"}. The arguments can be vectors, but only the first component is used for scalar targets (i.e., the ones without \code{"superpose"} in their name). } \item{alpha, alpha.points, alpha.line}{ A numeric alpha transparency specification. The same rules as \code{col}, etc., apply. } \item{cex, pch, font}{ Parameters for points. Applicable for components \code{plot.symbol} (for which only the first component is used) and \code{superpose.symbol} (for which the arguments can be vectors). } \item{lty, lwd}{ Parameters for lines. Applicable for components \code{plot.line} (for which only the first component is used) and \code{superpose.line} (for which the arguments can be vectors). } \item{fill}{ fill color, applicable for components \code{plot.symbol}, \code{plot.polygon}, \code{superpose.symbol}, and \code{superpose.polygon}. } \item{border}{ border color, applicable for components \code{plot.polygon} and \code{superpose.polygon}. } } \details{ The appearance of a lattice display depends partly on the \dQuote{theme} active when the display is plotted (see \code{\link{trellis.device}} for details). This theme is used to obtain defaults for various graphical parameters, and in particular, the \code{auto.key} argument works on the premise that the same source is used for both the actual graphical encoding and the legend. The easiest way to specify custom settings for a particular display is to use the \code{par.settings} argument, which is usually tedious to construct as it is a nested list. The \code{simpleTheme} function can be used in such situations as a wrapper that generates a suitable list given parameters in simple \code{name=value} form, with the nesting made implicit. This is less flexible, but straightforward and sufficient in most situations. } \value{ A list that would work as the \code{theme} argument to \code{\link{trellis.device}} and \code{\link{trellis.par.set}}, or as the \code{par.settings} argument to any high level lattice function such as \code{\link{xyplot}}. } \examples{ str(simpleTheme(pch = 16)) dotplot(variety ~ yield | site, data = barley, groups = year, auto.key = list(space = "right"), par.settings = simpleTheme(pch = 16), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6)) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}, based on a suggestion from John Maindonald. } \seealso{ \code{\link{trellis.device}}, \code{\link{xyplot}}, \code{\link{Lattice}} } \keyword{dplot} lattice/man/interaction.Rd0000644000176200001440000004456114024040642015266 0ustar liggesusers\name{E_interaction} \alias{panel.identify} \alias{panel.identify.qqmath} \alias{panel.identify.cloud} \alias{panel.link.splom} \alias{panel.brush.splom} \alias{trellis.focus} \alias{trellis.unfocus} \alias{trellis.switchFocus} \alias{trellis.panelArgs} \alias{trellis.vpname} \alias{trellis.grobname} \concept{interaction} \concept{augment} \title{Functions to Interact with Lattice Plots} \description{ The classic Trellis paradigm is to plot the whole object at once, without the possibility of interacting with it afterwards. However, by keeping track of the grid viewports where the panels and strips are drawn, it is possible to go back to them afterwards and enhance them one panel at a time. These functions provide convenient interfaces to help in this. Note that these are still experimental and the exact details may change in future. } \usage{ panel.identify(x, y = NULL, subscripts = seq_along(x), labels = subscripts, n = length(x), offset = 0.5, threshold = 18, ## in points, roughly 0.25 inches panel.args = trellis.panelArgs(), \dots) panel.identify.qqmath(x, distribution, groups, subscripts, labels, panel.args = trellis.panelArgs(), \dots) panel.identify.cloud(x, y, z, subscripts, perspective, distance, xlim, ylim, zlim, screen, R.mat, aspect, scales.3d, \dots, panel.3d.identify, n = length(subscripts), offset = 0.5, threshold = 18, labels = subscripts, panel.args = trellis.panelArgs()) panel.link.splom(threshold = 18, verbose = getOption("verbose"), \dots) panel.brush.splom(threshold = 18, verbose = getOption("verbose"), \dots) trellis.vpname(name = c("position", "split", "split.location", "toplevel", "figure", "panel", "strip", "strip.left", "legend", "legend.region", "main", "sub", "xlab", "ylab", "xlab.top", "ylab.right", "page"), column, row, side = c("left", "top", "right", "bottom", "inside"), clip.off = FALSE, prefix) trellis.grobname(name, type = c("", "panel", "strip", "strip.left", "key", "colorkey"), group = 0, which.given = lattice.getStatus("current.which.given", prefix = prefix), which.panel = lattice.getStatus("current.which.panel", prefix = prefix), column = lattice.getStatus("current.focus.column", prefix = prefix), row = lattice.getStatus("current.focus.row", prefix = prefix), prefix = lattice.getStatus("current.prefix")) trellis.focus(name, column, row, side, clip.off, highlight = interactive(), \dots, prefix, guess = TRUE, verbose = getOption("verbose")) trellis.switchFocus(name, side, clip.off, highlight, \dots, prefix) trellis.unfocus() trellis.panelArgs(x, packet.number) } \arguments{ \item{x, y, z}{ variables defining the contents of the panel. In the case of \code{trellis.panelArgs}, a \code{"trellis"} object. } \item{n}{ the number of points to identify by default (overridden by a right click) } \item{subscripts}{ an optional vector of integer indices associated with each point. See details below. } \item{labels}{ an optional vector of labels associated with each point. Defaults to \code{subscripts} } \item{distribution, groups}{ typical panel arguments of \code{\link{panel.qqmath}}. These will usually be obtained from \code{panel.args} } \item{offset}{ the labels are printed either below, above, to the left or to the right of the identified point, depending on the relative location of the mouse click. The \code{offset} specifies (in "char" units) how far from the identified point the labels should be printed. } \item{threshold}{ threshold in grid's \code{"points"} units. Points further than these from the mouse click position are not considered } \item{panel.args}{ list that contains components names \code{x} (and usually \code{y}), to be used if \code{x} is missing. Typically, when called after \code{trellis.focus}, this would appropriately be the arguments passed to that panel. } \item{perspective, distance, xlim, ylim, zlim, screen, R.mat, aspect, scales.3d}{ arguments as passed to \code{\link{panel.cloud}}. These are required to recompute the relevant three-dimensional projections in \code{panel.identify.cloud}. } \item{panel.3d.identify}{ the function that is responsible for the actual interaction once the data rescaling and rotation computations have been done. By default, an internal function similar to \code{panel.identify} is used. } \item{name}{ A character string indicating which viewport or grob we are looking for. Although these do not necessarily provide access to all viewports and grobs created by a lattice plot, they cover most of the ones that end-users may find interesting. \code{trellis.vpname} and \code{trellis.focus} deal with viewport names only, and only accept the values explicitly listed above. \code{trellis.grobname} is meant to create names for grobs, and can currently accept any value. If \code{name}, as well as \code{column} and \code{row} is missing in a call to \code{trellis.focus}, the user can click inside a panel (or an associated strip) to focus on that panel. Note however that this assumes equal width and height for each panel, and may not work when this is not true. When \code{name} is \code{"panel"}, \code{"strip"}, or \code{"strip.left"}, \code{column} and \code{row} must also be specified. When \code{name} is \code{"legend"}, \code{side} must also be specified. } \item{column, row}{ integers, indicating position of the panel or strip that should be assigned focus in the Trellis layout. Rows are usually calculated from the bottom up, unless the plot was created with \code{as.table=TRUE} } \item{guess}{ logical. If \code{TRUE}, and the display has only one panel, that panel will be automatically selected by a call to \code{trellis.focus}. } \item{side}{ character string, relevant only for legends (i.e., when \code{name="legend"}), indicating their position. Partial specification is allowed, as long as it is unambiguous. } \item{clip.off}{ logical, whether clipping should be off, relevant when \code{name} is \code{"panel"} or \code{"strip"}. This is necessary if axes are to be drawn outside the panel or strip. Note that setting \code{clip.off=FALSE} does not necessarily mean that clipping is on; that is determined by conditions in effect during printing. } \item{type}{ A character string specifying whether the grob is specific to a particular panel or strip. When \code{type} is \code{"panel"}, \code{"strip"}, or \code{"strip.left"}, information about the panel is added to the grob name. } \item{group}{ An integer specifying whether the grob is specific to a particular group within the plot. When \code{group} is greater than zero, information about the group is added to the grob name. } \item{which.given, which.panel}{ integers, indicating which conditional variable is being represented (within a strip) and the current levels of the conditional variables. When \code{which.panel} has length greater than 1, and the \code{type} is \code{"strip"} or \code{"strip.left"}, information about the conditional variable is added to the grob name. } \item{prefix}{ A character string acting as a prefix identifying the plot of a \code{"trellis"} object, primarily used to distinguish otherwise equivalent viewports in different plots. This only becomes relevant when a particular page is occupied by more than one plot. Defaults to the value appropriate for the last \code{"trellis"} object printed, as determined by the \code{prefix} argument in \code{\link{print.trellis}}. Users should not usually need to supply a value for this argument except to interact with an existing plot other than the one plotted last. For \code{switchFocus}, ignored except when it does not match the prefix of the currently active plot, in which case an error occurs. } \item{highlight}{ logical, whether the viewport being assigned focus should be highlighted. For \code{trellis.focus}, the default is \code{TRUE} in interactive mode, and \code{trellis.switchFocus} by default preserves the setting currently active. } \item{packet.number}{ integer, which panel to get data from. See \code{\link{packet.number}} for details on how this is calculated } \item{verbose}{ whether details will be printed } \item{\dots}{ For \code{panel.identify.qqmath}, extra parameters are passed on to \code{panel.identify}. For \code{panel.identify}, extra arguments are treated as graphical parameters and are used for labelling. For \code{trellis.focus} and \code{trellis.switchFocus}, these are used (in combination with \code{\link{lattice.options}}) for highlighting the chosen viewport if so requested. Graphical parameters can be supplied for \code{panel.link.splom}. } } \details{ \code{panel.identify} is similar to \code{\link{identify}}. When called, it waits for the user to identify points (in the panel being drawn) via mouse clicks. Clicks other than left-clicks terminate the procedure. Although it is possible to call it as part of the panel function, it is more typical to use it to identify points after plotting the whole object, in which case a call to \code{trellis.focus} first is necessary. \code{panel.link.splom} is meant for use with \code{\link{splom}}, and requires a panel to be chosen using \code{trellis.focus} before it is called. Clicking on a point causes that and the corresponding proections in other pairwise scatter plots to be highlighted. \code{panel.brush.splom} is a (misnamed) alias for \code{panel.link.splom}, retained for back-compatibility. \code{panel.identify.qqmath} is a specialized wrapper meant for use with the display produced by \code{\link{qqmath}}. \code{panel.identify.qqmath} is a specialized wrapper meant for use with the display produced by \code{\link{cloud}}. It would be unusual to call them except in a context where default panel function arguments are available through \code{trellis.panelArgs} (see below). One way in which \code{panel.identify} etc. are different from \code{\link{identify}} is in how it uses the \code{subscripts} argument. In general, when one identifies points in a panel, one wants to identify the origin in the data frame used to produce the plot, and not within that particular panel. This information is available to the panel function, but only in certain situations. One way to ensure that \code{subscripts} is available is to specify \code{subscripts = TRUE} in the high level call such as \code{xyplot}. If \code{subscripts} is not explicitly specified in the call to \code{panel.identify}, but is available in \code{panel.args}, then those values will be used. Otherwise, they default to \code{seq_along(x)}. In either case, the final return value will be the subscripts that were marked. The process of printing (plotting) a Trellis object builds up a grid layout with named viewports which can then be accessed to modify the plot further. While full flexibility can only be obtained by using grid functions directly, a few lattice functions are available for the more common tasks. \code{trellis.focus} can be used to move to a particular panel or strip, identified by its position in the array of panels. It can also be used to focus on the viewport corresponding to one of the labels or a legend, though such usage would be less useful. The exact viewport is determined by the \code{name} along with the other arguments, not all of which are relevant for all names. Note that when more than one object is plotted on a page, \code{trellis.focus} will always go to the plot that was created last. For more flexibility, use grid functions directly (see note below). After a successful call to \code{trellis.focus}, the desired viewport (typically panel or strip area) will be made the \sQuote{current} viewport (plotting area), which can then be enhanced by calls to standard lattice panel functions as well as grid functions. It is quite common to have the layout of panels chosen when a \code{"trellis"} object is drawn, and not before then. Information on the layout (specifically, how many rows and columns, and which packet belongs in which position in this layout) is retained for the last \code{"trellis"} object plotted, and is available through \code{trellis.currentLayout}. \code{trellis.unfocus} unsets the focus, and makes the top level viewport the current viewport. \code{trellis.switchFocus} is a convenience function to switch from one viewport to another, while preserving the current \code{row} and \code{column}. Although the rows and columns only make sense for panels and strips, they would be preserved even when the user switches to some other viewport (where row/column is irrelevant) and then switches back. Once a panel or strip is in focus, \code{trellis.panelArgs} can be used to retrieve the arguments that were available to the panel function at that position. In this case, it can be called without arguments as \preformatted{trellis.panelArgs()} This usage is also allowed when a \code{"trellis"} object is being printed, e.g. inside the panel functions or the axis function (but not inside the prepanel function). \code{trellis.panelArgs} can also retrieve the panel arguments from any \code{"trellis"} object. Note that for this usage, one needs to specify the \code{packet.number} (as described under the \code{panel} entry in \code{\link{xyplot}}) and not the position in the layout, because a layout determines the panel only \bold{after} the object has been printed. It is usually not necessary to call \code{trellis.vpname} and \code{trellis.grobname} directly. However, they can be useful in generating appropriate names in a portable way when using grid functions to interact with the plots directly, as described in the note below. } \value{ \code{panel.identify} returns an integer vector containing the subscripts of the identified points (see details above). The equivalent of \code{identify} with \code{pos=TRUE} is not yet implemented, but can be considered for addition if requested. \code{trellis.panelArgs} returns a named list of arguments that were available to the panel function for the chosen panel. \code{trellis.vpname} and \code{trellis.grobname} return character strings. \code{trellis.focus} has a meaningful return value only if it has been used to focus on a panel interactively, in which case the return value is a list with components \code{col} and \code{row} giving the column and row positions respectively of the chosen panel, unless the choice was cancelled (by a right click), in which case the return value is \code{NULL}. If click was outside a panel, both \code{col} and \code{row} are set to 0. } \note{ The viewports created by lattice are accessible to the user through \code{trellis.focus} as described above. Functions from the grid package can also be used directly. For example, \code{\link[grid:current.viewport]{current.vpTree}} can be used to inspect the current viewport tree and \code{\link[grid:viewports]{seekViewport}} or \code{\link[grid:viewports]{downViewport}} can be used to navigate to these viewports. For such usage, \code{trellis.vpname} and \code{trellis.grobname} provides a portable way to access the appropriate viewports and grobs by name. } \examples{ \dontrun{ xyplot(1:10 ~ 1:10) trellis.focus("panel", 1, 1) panel.identify() } xyplot(Petal.Length ~ Sepal.Length | Species, iris, layout = c(2, 2)) Sys.sleep(1) trellis.focus("panel", 1, 1) do.call("panel.lmline", trellis.panelArgs()) Sys.sleep(0.5) trellis.unfocus() trellis.focus("panel", 2, 1) do.call("panel.lmline", trellis.panelArgs()) Sys.sleep(0.5) trellis.unfocus() trellis.focus("panel", 1, 2) do.call("panel.lmline", trellis.panelArgs()) Sys.sleep(0.5) trellis.unfocus() ## choosing loess smoothing parameter p <- xyplot(dist ~ speed, cars) panel.loessresid <- function(x = panel.args$x, y = panel.args$y, span, panel.args = trellis.panelArgs()) { fm <- loess(y ~ x, span = span) xgrid <- do.breaks(current.panel.limits()$xlim, 50) ygrid <- predict(fm, newdata = data.frame(x = xgrid)) panel.lines(xgrid, ygrid) pred <- predict(fm) ## center residuals so that they fall inside panel resids <- y - pred + mean(y) fm.resid <- loess.smooth(x, resids, span = span) ##panel.points(x, resids, col = 1, pch = 4) panel.lines(fm.resid, col = 1) } spans <- c(0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8) update(p, index.cond = list(rep(1, length(spans)))) panel.locs <- trellis.currentLayout() i <- 1 for (row in 1:nrow(panel.locs)) for (column in 1:ncol(panel.locs)) if (panel.locs[row, column] > 0) { trellis.focus("panel", row = row, column = column, highlight = FALSE) panel.loessresid(span = spans[i]) grid::grid.text(paste("span = ", spans[i]), x = 0.25, y = 0.75, default.units = "npc") trellis.unfocus() i <- i + 1 } } \seealso{ \code{\link{identify}}, \code{\link{Lattice}}, \code{\link{print.trellis}}, \code{\link{trellis.currentLayout}}, \code{\link[grid:current.viewport]{current.vpTree}}, \code{\link[grid:viewports]{viewports}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}. Felix Andrews provided initial implementations of \code{panel.identify.qqmath} and support for focusing on panels interctively. } \keyword{dplot} lattice/man/environmental.Rd0000644000176200001440000000411613070415115015621 0ustar liggesusers\name{H_environmental} \alias{environmental} \docType{data} \title{ Atmospheric environmental conditions in New York City } \description{ Daily measurements of ozone concentration, wind speed, temperature and solar radiation in New York City from May to September of 1973. } \usage{environmental} \format{ A data frame with 111 observations on the following 4 variables. \describe{ \item{ozone}{Average ozone concentration (of hourly measurements) of in parts per billion.} \item{radiation}{Solar radiation (from 08:00 to 12:00) in langleys.} \item{temperature}{Maximum daily emperature in degrees Fahrenheit.} \item{wind}{Average wind speed (at 07:00 and 10:00) in miles per hour.} } } \source{ Bruntz, S. M., W. S. Cleveland, B. Kleiner, and J. L. Warner. (1974). The Dependence of Ambient Ozone on Solar Radiation, Wind, Temperature, and Mixing Height. In \emph{Symposium on Atmospheric Diffusion and Air Pollution}, pages 125--128. American Meterological Society, Boston. } \author{ Documentation contributed by Kevin Wright. } \references{ Cleveland, William S. (1993) \emph{Visualizing Data}. Hobart Press, Summit, New Jersey. } \examples{ # Scatter plot matrix with loess lines splom(~environmental, panel=function(x,y){ panel.xyplot(x,y) panel.loess(x,y) } ) # Conditioned plot similar to figure 5.3 from Cleveland attach(environmental) Temperature <- equal.count(temperature, 4, 1/2) Wind <- equal.count(wind, 4, 1/2) xyplot((ozone^(1/3)) ~ radiation | Temperature * Wind, aspect=1, prepanel = function(x, y) prepanel.loess(x, y, span = 1), panel = function(x, y){ panel.grid(h = 2, v = 2) panel.xyplot(x, y, cex = .5) panel.loess(x, y, span = 1) }, xlab = "Solar radiation (langleys)", ylab = "Ozone (cube root ppb)") detach() # Similar display using the coplot function with(environmental,{ coplot((ozone^.33) ~ radiation | temperature * wind, number=c(4,4), panel = function(x, y, ...) panel.smooth(x, y, span = .8, ...), xlab="Solar radiation (langleys)", ylab="Ozone (cube root ppb)") }) } \keyword{datasets} lattice/man/panel.xyplot.Rd0000644000176200001440000002166714413020055015404 0ustar liggesusers\name{F_1_panel.xyplot} \alias{panel.xyplot} \alias{panel.splom} \alias{panel.qq} \title{ Default Panel Function for xyplot } \description{ This is the default panel function for \code{xyplot}. Also see \code{panel.superpose}. The default panel functions for \code{splom} and \code{qq} are essentially the same function. } \usage{ panel.xyplot(x, y, type = "p", groups = NULL, pch, col, col.line, col.symbol, font, fontfamily, fontface, lty, cex, fill, lwd, horizontal = FALSE, \dots, smooth = NULL, grid = lattice.getOption("default.args")$grid, abline = NULL, jitter.x = FALSE, jitter.y = FALSE, factor = 0.5, amount = NULL, identifier = "xyplot") panel.splom(\dots, identifier = "splom") panel.qq(\dots, identifier = "qq") } \arguments{ \item{x,y}{ variables to be plotted in the scatterplot } \item{type}{ character vector controlling how \code{x} and \code{y} are to be plotted. Can consist of one or more of the following: \code{"p"}, \code{"l"}, \code{"h"}, \code{"b"}, \code{"o"}, \code{"s"}, \code{"S"}, \code{"g"}, \code{"r"}, \code{"a"}, \code{"smooth"}, and \code{"spline"}. If \code{type} has more than one element, an attempt is made to combine the effect of each of the components. The behaviour if any of the first five are included in \code{type} is similar to the effect of the corresponding \code{type} in \code{\link{plot}}: \code{"p"} and \code{"l"} stand for points and lines respectively; \code{"b"} and \code{"o"} (for \sQuote{overlay}) plot both; \code{"h"} draws vertical (or horizontal if \code{horizontal = TRUE}) line segments from the points to the origin. Types \code{"s"} and \code{"S"} are like \code{"l"} in the sense that they join consecutive points, but instead of being joined by a straight line, points are connected by a vertical and a horizontal segment forming a \sQuote{step}, with the vertical segment coming first for \code{"s"}, and the horizontal segment coming first for \code{"S"}. Types \code{"s"} and \code{"S"} sort the values along one of the axes (depending on \code{horizontal}); this is unlike the behavior in \code{plot}. For the latter behavior, use \code{type = "s"} with \code{panel = panel.points}. Type \code{"g"} adds a reference grid using \code{\link{panel.grid}} in the background, but using the \code{grid} argument is now the preferred way to do so. The remaining values of \code{type} lead to various types of smoothing. This can also be achieved using the \code{smooth} argument, or by calling the relevant panel functions directly. The panel functions provide finer control over graphical and other parameters, but using \code{smooth} or \code{type} is convenient for simple usage. Using \code{smooth} is recommended, but \code{type} is also supported for backwards compatibility. Type \code{"r"} adds a linear regression line, \code{"smooth"} adds a loess fit, \code{"spline"} adds a cubic smoothing spline fit, and \code{"a"} draws line segments joining the average \code{y} value for each distinct \code{x} value. See \code{smooth} for details. See \code{example(xyplot)} and \code{demo(lattice)} for examples. } \item{groups}{ an optional grouping variable. If present, \code{\link{panel.superpose}} will be used instead to display each subgroup } \item{col, col.line, col.symbol}{ default colours are obtained from \code{plot.symbol} and \code{plot.line} using \code{\link{trellis.par.get}}. } \item{font, fontface, fontfamily}{ font used when \code{pch} is a character } \item{pch, lty, cex, lwd, fill}{ other graphical parameters. \code{fill} serves the purpose of \code{bg} in \code{\link{points}} for certain values of \code{pch} } \item{horizontal}{ A logical flag controlling the orientation for certain \code{type}'s, e.g., \code{"h"}, \code{"s"}, ans \code{"S"} and the result of smoothing. } \item{\dots}{ Extra arguments, if any, for \code{panel.xyplot}. Usually passed on as graphical parameters to low level plotting functions, or to the panel functions performing smoothing, if applicable. } \item{smooth}{ If specificied, indicates the type of smooth to be added. Can be a character vector containing one or more values from \code{"lm"}, \code{"loess"}, \code{"spline"}, and \code{"average"}. Can also be a logical flag; \code{TRUE} is interpreted as \code{"loess"}. Each of these result in calling a corresponding panel function as described below; the \code{smooth} argument simply provides a convenient shortcut. \code{"lm"} adds a linear regression line (same as \code{\link{panel.lmline}}, except for default graphical parameters). \code{"loess"} adds a loess fit (same as \code{\link{panel.loess}}). \code{"spline"} adds a cubic smoothing spline fit (same as \code{\link{panel.spline}}). \code{"average"} has the effect of calling \code{\link{panel.average}}, which in conjunction with a \code{groups} argument can be useful for creating interaction plots. Normally, smoothing is performed with the \code{y} variable as the response and the \code{x} variable as the predictor. However, the roles of \code{x} and \code{y} are reversed if \code{horizontal = TRUE}. } \item{grid}{ A logical flag, character string, or list specifying whether and how a background grid should be drawn. This provides the same functionality as \code{type="g"}, but is the preferred alternative as the effect \code{type="g"} is conceptually different from that of other \code{type} values (which are all data-dependent). Using the \code{grid} argument also allows more flexibility. Most generally, \code{grid} can be a list of arguments to be supplied to \code{\link{panel.grid}}, which is called with those arguments. Three shortcuts are available: \describe{ \item{\code{TRUE}:}{ roughly equivalent to \code{list(h = -1, v = -1)} } \item{\code{"h"}:}{ roughly equivalent to \code{list(h = -1, v = 0)} } \item{\code{"v"}:}{ roughly equivalent to \code{list(h = 0, v = -1)} } } No grid is drawn if \code{grid = FALSE}. } \item{abline}{ A numeric vector or more generally a list containing arguments that are used to call \code{\link{panel.abline}}. If specified as a numeric vector, \code{abline} is used as the first unnamed argument to \code{\link{panel.abline}}. This allows arguments of the form \code{abline = c(0, 1)}, which adds the diagonal line, or \code{abline = coef(fm)} to fit the regression line from a fitted mode. Use the list form for finer control; e.g., \code{abline = list(h = 0, v = 0, col = "grey")}. For more flexibility, use \code{\link{panel.abline}} directly. } \item{jitter.x, jitter.y}{ logical, whether the data should be jittered before being plotted. } \item{factor, amount}{ controls amount of jittering. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Creates scatterplot of \code{x} and \code{y}, with various modifications possible via the type argument. \code{panel.qq} draws a 45 degree line before calling \code{panel.xyplot}. Note that most of the arguments controlling the display can be supplied directly to the high-level (e.g. \code{\link{xyplot}}) call. } \examples{ types.plain <- c("p", "l", "o", "r", "g", "s", "S", "h", "a", "smooth") types.horiz <- c("s", "S", "h", "a", "smooth") horiz <- rep(c(FALSE, TRUE), c(length(types.plain), length(types.horiz))) types <- c(types.plain, types.horiz) x <- sample(seq(-10, 10, length.out = 15), 30, TRUE) y <- x + 0.25 * (x + 1)^2 + rnorm(length(x), sd = 5) xyplot(y ~ x | gl(1, length(types)), xlab = "type", ylab = list(c("horizontal=TRUE", "horizontal=FALSE"), y = c(1/6, 4/6)), as.table = TRUE, layout = c(5, 3), between = list(y = c(0, 1)), strip = function(...) { panel.fill(trellis.par.get("strip.background")$col[1]) type <- types[panel.number()] grid::grid.text(label = sprintf('"\%s"', type), x = 0.5, y = 0.5) grid::grid.rect() }, scales = list(alternating = c(0, 2), tck = c(0, 0.7), draw = FALSE), par.settings = list(layout.widths = list(strip.left = c(1, 0, 0, 0, 0))), panel = function(...) { type <- types[panel.number()] horizontal <- horiz[panel.number()] panel.xyplot(..., type = type, horizontal = horizontal) })[rep(1, length(types))] } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{panel.superpose}}, \code{\link{xyplot}}, \code{\link{splom}} } \keyword{dplot} lattice/man/axis.default.Rd0000644000176200001440000002014314131537416015335 0ustar liggesusers\name{G_axis.default} \alias{axis.default} \alias{xscale.components.default} \alias{yscale.components.default} \title{Default axis annotation utilities} \description{ Lattice funtions provide control over how the plot axes are annotated through a common interface. There are two levels of control. The \code{xscale.components} and \code{yscale.components} arguments can be functions that determine tick mark locations and labels given a packet. For more direct control, the \code{axis} argument can be a function that actually draws the axes. The functions documented here are the defaults for these arguments. They can additonally be used as components of user written replacements. } \usage{ xscale.components.default(lim, packet.number = 0, packet.list = NULL, top = TRUE, \dots) yscale.components.default(lim, packet.number = 0, packet.list = NULL, right = TRUE, \dots) axis.default(side = c("top", "bottom", "left", "right"), scales, components, as.table, labels = c("default", "yes", "no"), ticks = c("default", "yes", "no"), \dots, prefix) } \arguments{ \item{lim}{ the range of the data in that packet (data subset corresponding to a combination of levels of the conditioning variable). The range is not necessarily numeric; e.g. for factors, they could be character vectors representing levels, and for the various date-time representations, they could be vectors of length 2 with the corresponding class. } \item{packet.number}{ which packet (counted according to the packet order, described in \code{\link{print.trellis}}) is being processed. In cases where all panels have the same limits, this function is called only once (rather than once for each packet), in which case this argument will have the value \code{0}. } \item{packet.list}{ list, as long as the number of packets, giving all the actual packets. Specifically, each component is the list of arguments given to the panel function when and if that packet is drawn in a panel. (This has not yet been implemented.) } \item{top, right}{ the value of the \code{top} and \code{right} components of the result, as appropriate. See below for interpretation.} \item{side}{ on which side the axis is to be drawn. The usual partial matching rules apply. } \item{scales}{ the appropriate component of the \code{scales} argument supplied to the high level function, suitably standardized. } \item{components}{ list, similar to those produced by \code{xscale.components.default} and \code{yscale.components.default}. } \item{as.table}{ the \code{as.table} argument in the high level function. } \item{labels}{ whether labels are to be drawn. By default, the rules determined by \code{scales} are used. } \item{ticks}{ whether labels are to be drawn. By default, the rules determined by \code{scales} are used. } \item{\dots}{ many other arguments may be supplied, and are passed on to other internal functions. } \item{prefix}{ A character string identifying the plot being drawn (see \code{\link{print.trellis}}). Used to retrieve location of current panel in the overall layout, so that axes can be drawn appropriately. } } \value{ \code{xscale.components.default} and \code{yscale.components.default} return a list of the form suitable as the \code{components} argument of \code{axis.default}. Valid components in the return value of \code{xscale.components.default} are: \describe{ \item{\code{num.limit}}{ A numeric limit for the box. } \item{\code{bottom}}{ A list with two elements, \code{ticks} and \code{labels}. \code{ticks} must be a list with components \code{at} and \code{tck} which give the location and lengths of tick marks. \code{tck} can be a vector, and will be recycled to be as long as \code{at}. \code{labels} must be a list with components \code{at}, \code{labels}, and \code{check.overlap}. \code{at} and \code{labels} give the location and labels of the tick labels; this is usually the same as the location of the ticks, but is not required to be so. \code{check.overlap} is a logical flag indicating whether overlapping of labels should be avoided by omitting some of the labels while rendering. } \item{\code{top}}{ This can be a logical flag; if \code{TRUE}, \code{top} is treated as being the same as \code{bottom}; if \code{FALSE}, axis annotation for the top axis is omitted. Alternatively, \code{top} can be a list like \code{bottom}. } } Valid components in the return value of \code{yscale.components.default} are \code{left} and \code{right}. Their interpretations are analogous to (respectively) the \code{bottom} and \code{top} components described above. } \details{ These functions are part of a new API introduced in lattice 0.14 to provide the user more control over how axis annotation is done. While the API has been designed in anticipation of use that was previously unsupported, the implementation has initially focused on reproducing existing capabilities, rather than test new features. At the time of writing, several features are unimplemented. If you require them, please contact the maintainer. } \examples{ str(xscale.components.default(c(0, 1))) set.seed(36872) rln <- rlnorm(100) densityplot(rln, scales = list(x = list(log = 2), alternating = 3), xlab = "Simulated lognormal variates", xscale.components = function(...) { ans <- xscale.components.default(...) ans$top <- ans$bottom ans$bottom$labels$labels <- parse(text = ans$bottom$labels$labels) ans$top$labels$labels <- if (require(MASS)) fractions(2^(ans$top$labels$at)) else 2^(ans$top$labels$at) ans }) ## Direct use of axis to show two temperature scales (Celcius and ## Fahrenheit). This does not work for multi-row plots, and doesn't ## do automatic allocation of space F2C <- function(f) 5 * (f - 32) / 9 C2F <- function(c) 32 + 9 * c / 5 axis.CF <- function(side, ...) { ylim <- current.panel.limits()$ylim switch(side, left = { prettyF <- pretty(ylim) labF <- parse(text = sprintf("\%s ~ degree * F", prettyF)) panel.axis(side = side, outside = TRUE, at = prettyF, labels = labF) }, right = { prettyC <- pretty(F2C(ylim)) labC <- parse(text = sprintf("\%s ~ degree * C", prettyC)) panel.axis(side = side, outside = TRUE, at = C2F(prettyC), labels = labC) }, axis.default(side = side, ...)) } xyplot(nhtemp ~ time(nhtemp), aspect = "xy", type = "o", scales = list(y = list(alternating = 3)), axis = axis.CF, xlab = "Year", ylab = "Temperature", main = "Yearly temperature in New Haven, CT") ## version using yscale.components yscale.components.CF <- function(...) { ans <- yscale.components.default(...) ans$right <- ans$left ans$left$labels$labels <- parse(text = sprintf("\%s ~ degree * F", ans$left$labels$at)) prettyC <- pretty(F2C(ans$num.limit)) ans$right$ticks$at <- C2F(prettyC) ans$right$labels$at <- C2F(prettyC) ans$right$labels$labels <- parse(text = sprintf("\%s ~ degree * C", prettyC)) ans } xyplot(nhtemp ~ time(nhtemp), aspect = "xy", type = "o", scales = list(y = list(alternating = 3)), yscale.components = yscale.components.CF, xlab = "Year", ylab = "Temperature", main = "Yearly temperature in New Haven, CT") } \seealso{ \code{\link{Lattice}}, \code{\link{xyplot}}, \code{\link{print.trellis}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/xyplot.Rd0000644000176200001440000021043714576262623014324 0ustar liggesusers\name{B_00_xyplot} \title{Common Bivariate Trellis Plots} \alias{xyplot} \alias{xyplot.formula} \alias{xyplot.data.frame} \alias{barchart} \alias{barchart.formula} \alias{barchart.data.frame} \alias{barchart.numeric} \alias{barchart.default} \alias{bwplot} \alias{bwplot.formula} \alias{bwplot.data.frame} \alias{bwplot.numeric} \alias{dotplot} \alias{dotplot.formula} \alias{dotplot.data.frame} \alias{dotplot.numeric} \alias{dotplot.default} \alias{stripplot} \alias{stripplot.formula} \alias{stripplot.data.frame} \alias{stripplot.numeric} \usage{ xyplot(x, data, ...) dotplot(x, data, ...) barchart(x, data, ...) stripplot(x, data, ...) bwplot(x, data, ...) \method{xyplot}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.xyplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales, default.prepanel = lattice.getOption("prepanel.default.xyplot"), subscripts = !is.null(groups), subset = TRUE) \method{xyplot}{data.frame}(x, data = NULL, formula = data, ...) \method{dotplot}{formula}(x, data, panel = lattice.getOption("panel.dotplot"), default.prepanel = lattice.getOption("prepanel.default.dotplot"), ...) \method{dotplot}{data.frame}(x, data = NULL, formula = data, ...) \method{barchart}{formula}(x, data, panel = lattice.getOption("panel.barchart"), default.prepanel = lattice.getOption("prepanel.default.barchart"), box.ratio = 2, ...) \method{barchart}{data.frame}(x, data = NULL, formula = data, ...) \method{stripplot}{formula}(x, data, panel = lattice.getOption("panel.stripplot"), default.prepanel = lattice.getOption("prepanel.default.stripplot"), ...) \method{stripplot}{data.frame}(x, data = NULL, formula = data, ...) \method{bwplot}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = FALSE, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.bwplot"), prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab, xlim, ylab, ylim, box.ratio = 1, horizontal = NULL, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales, default.prepanel = lattice.getOption("prepanel.default.bwplot"), subscripts = !is.null(groups), subset = TRUE) \method{bwplot}{data.frame}(x, data = NULL, formula = data, ...) } \description{ This help page documents several commonly used high-level Lattice functions. \code{xyplot} produces bivariate scatterplots or time-series plots, \code{bwplot} produces box-and-whisker plots, \code{dotplot} produces Cleveland dot plots, \code{barchart} produces bar plots, and \code{stripplot} produces one-dimensional scatterplots. All these functions, along with other high-level Lattice functions, respond to a common set of arguments that control conditioning, layout, aspect ratio, legends, axis annotation, and many other details in a consistent manner. These arguments are described extensively in this help page, and should be used as the reference for other high-level functions as well. For control and customization of the actual display in each panel, the help page of the respective default panel function will often be more informative. In particular, these help pages describe many arguments commonly used when calling the corresponding high-level function but are specific to them. } % designed mainly for two continuous variates (though factors can be % supplied as well, in which case they will simply be coerced to % numeric), which produces Conditional Scatter plots. % The others are useful when one of the variates is a factor or a % shingle. Most of these arguments are also applicable to other high % level functions in the lattice package, but are only documented here. \arguments{ \item{x}{ All high-level function in \pkg{lattice} are generic. \code{x} is the object on which method dispatch is carried out. For the \code{"formula"} methods, \code{x} must be a formula describing the primary variables (used for the per-panel display) and the optional conditioning variables (which define the subsets plotted in different panels) to be used in the plot. Conditioning is described in the \dQuote{Details} section below. For the functions documented here, the formula is generally of the form \code{y ~ x | g1 * g2 * ...} (or equivalently, \code{y ~ x | g1 + g2 + ...}), indicating that plots of \code{y} (on the y-axis) versus \code{x} (on the x-axis) should be produced conditional on the variables \code{g1, g2, ...}. Here \code{x} and \code{y} are the primary variables, and \code{g1, g2, ...} are the conditioning variables. The conditioning variables may be omitted to give a formula of the form \code{y ~ x}, in which case the plot will consist of a single panel with the full dataset. The formula can also involve expressions, e.g., \code{sqrt()}, \code{log()}, etc. See the \code{data} argument below for rules regarding evaluation of the terms in the formula. With the exception of \code{xyplot}, the functions documented here may also be supplied a formula of the form \code{ ~ x | g1 * g2 * ...}. In that case, \code{y} defaults to \code{names(x)} if \code{x} is named, and a factor with a single level otherwise. Cases where \code{x} is not a formula is handled by appropriate methods. The \code{numeric} methods are equivalent to a call with no left hand side and no conditioning variables in the formula. For \code{barchart} and \code{dotplot}, non-trivial methods exist for tables and arrays, documented at \code{\link{barchart.table}}. The conditioning variables \code{g1, g2, ...} must be either factors or shingles. Shingles provide a way of using numeric variables for conditioning; see the help page of \code{\link{shingle}} for details. Like factors, they have a \code{"levels"} attribute, which is used in producing the conditional plots. If necessary, numeric conditioning variables are converted to shingles using the \code{shingle} function; however, using \code{\link{equal.count}} may be more appropriate in many cases. Character variables are coerced to factors. %% As an extension of the interpretation described above, % A special case is when the left and/or right sides of the % Formulas containing a \sQuote{+} sign in the specification of % primary variables before the conditioning variables) contain a \sQuote{+} sign, e.g., % \code{y1 + y2 ~ x | a*b}. \bold{Extended formula interface:} As a useful extension of the interface described above, the primary variable terms (both the LHS \code{y} and RHS \code{x}) may consist of multiple terms separated by a \sQuote{+} sign, e.g., \code{y1 + y2 ~ x | a * b}. This formula would be taken to mean that the user wants to plot both \code{y1 ~ x | a * b} and \code{y2 ~ x | a * b}, but with the \code{y1 ~ x} and \code{y2 ~ x} superposed in each panel. The two groups will be distinguished by different graphical parameters. This is essentially what the \code{groups} argument (see below) would produce, if \code{y1} and \code{y2} were concatenated to produce a longer vector, with the \code{groups} argument being an indicator of which rows come from which variable. In fact, this is exactly what is done internally using the \code{\link{reshape}} function. This feature cannot be used in conjunction with the \code{groups} argument. To interpret \code{y1 + y2} as a sum, one can either set \code{allow.multiple=FALSE} or use \code{I(y1+y2)}. A variation on this feature is when the \code{outer} argument is set to \code{TRUE}. In that case, the plots are not superposed in each panel, but instead separated into different panels (as if a new conditioning variable had been added). \bold{Primary variables:} The \code{x} and \code{y} variables should both be numeric in \code{xyplot}, and an attempt is made to coerce them if not. However, if either is a factor, the levels of that factor are used as axis labels. In the other four functions documented here, exactly one of \code{x} and \code{y} should be numeric, and the other a factor or shingle. Which of these will happen is determined by the \code{horizontal} argument --- if \code{horizontal=TRUE}, then \code{y} will be coerced to be a factor or shingle, otherwise \code{x}. The default value of \code{horizontal} is \code{FALSE} if \code{x} is a factor or shingle, \code{TRUE} otherwise. (The functionality provided by \code{horizontal=FALSE} is not S-compatible.) Note that the \code{x} argument used to be called \code{formula} in earlier versions (when the high-level functions were not generic and the formula method was essentially the only method). This is no longer allowed. It is recommended that this argument not be named in any case, but instead be the first (unnamed) argument. } \item{data}{ For the \code{formula} methods, a data frame (or more precisely, anything that is a valid \code{envir} argument in \code{\link{eval}}, e.g., a list or an environment) containing values for any variables in the formula, as well as \code{groups} and \code{subset} if applicable. If not found in \code{data}, or if \code{data} is unspecified, the variables are looked for in the environment of the formula. For other methods (where \code{x} is not a formula), \code{data} is usually ignored, often with a warning if it is explicitly specified. } \item{formula}{ The formula to be used for the \code{"data.frame"} methods. See documentation for argument \code{x} for details. } \item{allow.multiple}{ Logical flag specifying whether the extended formula interface described above should be in effect. Defaults to \code{TRUE} whenever sensible. } \item{outer}{ Logical flag controlling what happens with formulas using the extended interface described above (see the entry for \code{x} for details). Defaults to \code{FALSE}, except when \code{groups} is explicitly specified or grouping does not make sense for the default panel function. } \item{box.ratio}{ Applicable to \code{barchart} and \code{bwplot}. Specifies the ratio of the width of the rectangles to the inter-rectangle space. See also the \code{box.width} argument in the respective default panel functions. } \item{horizontal}{ Logical flag applicable to \code{bwplot}, \code{dotplot}, \code{barchart}, and \code{stripplot}. Determines which of \code{x} and \code{y} is to be a factor or shingle (\code{y} if TRUE, \code{x} otherwise). Defaults to \code{FALSE} if \code{x} is a factor or shingle, \code{TRUE} otherwise. This argument is used to process the arguments to these high-level functions, but more importantly, it is passed as an argument to the panel function, which is expected to use it as appropriate. A potentially useful component of \code{scales} in this case may be \code{abbreviate = TRUE}, in which case long labels which would usually overlap will be abbreviated. \code{scales} could also contain a \code{minlength} argument in this case, which would be passed to the \code{abbreviate} function. } % \item{jitter.data}{ % logical specifying whether the values should be jittered by adding a % random noise in stripplot. This is actually an argument of % \code{panel.stripplot}. % } % \item{factor}{ % numeric controlling amount of jitter as in \code{\link{jitter}}. % } \bold{Common arguments: } The following arguments are common to all the functions documented here, as well as most other high-level Trellis functions. These are not documented elsewhere, except to override the usage given here. \item{panel}{ Once the subset of rows defined by each unique combination of the levels of the grouping variables are obtained (see \dQuote{Details}), the corresponding \code{x} and \code{y} variables (or other variables, as appropriate, in the case of other high-level functions) are passed on to be plotted in each panel. The actual plotting is done by the function specified by the \code{panel} argument. The argument may be a function object or a character string giving the name of a predefined function. Each high-level function has its own default panel function, named as \dQuote{\code{panel.}} followed by the name of the corresponding high-level function (e.g., \code{\link{panel.xyplot}}, \code{\link{panel.barchart}}, etc). Much of the power of Trellis Graphics comes from the ability to define customized panel functions. A panel function appropriate for the functions described here would usually expect arguments named \code{x} and \code{y}, which would be provided by the conditioning process. It can also have other arguments. It is useful to know in this context that all arguments passed to a high-level Lattice function (such as \code{xyplot}) that are not recognized by it are passed through to the panel function. It is thus generally good practice when defining panel functions to allow a \code{...} argument. Such extra arguments typically control graphical parameters, but other uses are also common. See documentation for individual panel functions for specifics. Note that unlike in S-PLUS, it is not guaranteed that panel functions will be supplied only numeric vectors for the \code{x} and \code{y} arguments; they can be factors as well (but not shingles). Panel functions need to handle this case, which in most cases can be done by simply coercing them to numeric. Technically speaking, panel functions must be written using Grid graphics functions. However, knowledge of Grid is usually not necessary to construct new custom panel functions, as there are several predefined panel functions which can help; for example, \code{panel.grid}, \code{panel.loess}, etc. There are also some grid-compatible replacements of commonly used traditional graphics functions useful for this purpose. For example, \code{lines} can be replaced by \code{llines} (or equivalently, \code{panel.lines}). Note that traditional graphics functions like \code{lines} will not work in a lattice panel function. One case where a bit more is required of the panel function is when the \code{groups} argument is not \code{NULL}. In that case, the panel function should also accept arguments named \code{groups} and \code{subscripts} (see below for details). A useful panel function predefined for use in such cases is \code{\link{panel.superpose}}, which can be combined with different \code{panel.groups} functions to determine what is plotted for each group. See the \dQuote{Examples} section for an interaction plot constructed in this way. Several other panel functions can also handle the \code{groups} argument, including the default ones for \code{xyplot}, \code{barchart}, \code{dotplot}, and \code{stripplot}. Even when \code{groups} is not present, the panel function can have \code{subscripts} as a formal argument. In either case, the \code{subscripts} argument passed to the panel function are the indices of the \code{x} and \code{y} data for that panel in the original \code{data}, BEFORE taking into account the effect of the \code{subset} argument. Note that \code{groups} remains unaffected by any subsetting operations, so \code{groups[subscripts]} gives the values of \code{groups} that correspond to the data in that panel. This interpretation of \code{subscripts} does not hold when the extended formula interface is in use (i.e., when \code{allow.multiple} is in effect). A comprehensive description would be too complicated (details can be found in the source code of the function \code{latticeParseFormula}), but in short, the extended interface works by creating an artificial grouping variable that is longer than the original data frame, and consequently, \code{subscripts} needs to refer to rows beyond those in the original data. To further complicate matters, the artificial grouping variable is created after any effect of \code{subset}, in which case \code{subscripts} may have no relationship with corresponding rows in the original data frame. One can also use functions called \code{\link{panel.number}} and \code{\link{packet.number}}, representing panel order and packet order respectively, inside the panel function (as well as the strip function or while interacting with a lattice display using \code{\link{trellis.focus}} etc). Both provide a simple integer index indicating which panel is currently being drawn, but differ in how the count is calculated. The panel number is a simple incremental counter that starts with 1 and is incremented each time a panel is drawn. The packet number on the other hand indexes the combination of levels of the conditioning variables that is represented by that panel. The two indices coincide unless the order of conditioning variables is permuted and/or the plotting order of levels within one or more conditioning variables is altered (using \code{perm.cond} and \code{index.cond} respectively), in which case \code{packet.number} gives the index corresponding to the \sQuote{natural} ordering of that combination of levels of the conditioning variables. \code{\link{panel.xyplot}} has an argument called \code{type} which is worth mentioning here because it is quite frequently used (and as mentioned above, can be passed to \code{xyplot} directly). In the event that a \code{groups} variable is used, \code{\link{panel.xyplot}} calls \code{\link{panel.superpose}}, arguments of which can also be passed directly to \code{xyplot}. Panel functions for \code{bwplot} and friends should have an argument called \code{horizontal} to account for the cases when \code{x} is the factor or shingle. } % \item{panel.groups}{ % useful mostly for \code{xyplot} and \code{densityplot}. Applies when % \code{panel} is \code{panel.superpose} (which happens by default in % these cases if \code{groups} is non-null) % } \item{aspect}{ This argument controls the physical aspect ratio of the panels, which is usually the same for all the panels. It can be specified as a ratio (vertical size/horizontal size) or as a character string. In the latter case, legitimate values are \code{"fill"} (the default) which tries to make the panels as big as possible to fill the available space; \code{"xy"}, which computes the aspect ratio based on the 45 degree banking rule (see \code{\link{banking}}); and \code{"iso"} for isometric scales, where the relation between physical distance on the device and distance in the data scale are forced to be the same for both axes. If a \code{prepanel} function is specified and it returns components \code{dx} and \code{dy}, these are used for banking calculations. Otherwise, values from the default prepanel function are used. Not all default prepanel functions produce sensible banking calculations. } \item{groups}{ A variable or expression to be evaluated in \code{data}, expected to act as a grouping variable within each panel, typically used to distinguish different groups by varying graphical parameters like color and line type. Formally, if \code{groups} is specified, then \code{groups} along with \code{subscripts} is passed to the panel function, which is expected to handle these arguments. For high level functions where grouping is appropriate, the default panel functions can handle grouping. It is very common to use a key (legend) when a grouping variable is specified. See entries for \code{key}, \code{auto.key} and \code{\link{simpleKey}} for how to draw a key. } \item{auto.key}{ A logical, or a list containing components to be used as arguments to \code{\link{simpleKey}}. The default can be set using \code{\link{lattice.options}}. \code{auto.key = TRUE} is equivalent to \code{auto.key = list()}, in which case \code{\link{simpleKey}} is called with a set of default arguments (which may depend on the relevant high-level function). Most valid components to the \code{key} argument can be specified in this manner, as \code{\link{simpleKey}} will simply add unrecognized arguments to the list it produces. \code{auto.key} is typically used to automatically produce a suitable legend in conjunction with a grouping variable. If \code{auto.key = TRUE}, a suitable legend will be drawn if a \code{groups} argument is also provided, and not otherwise. In list form, \code{auto.key} will modify the default legend thus produced. For example, \code{auto.key=list(columns = 2)} will create a legend split into two columns (\code{columns} is documented in the entry for \code{key}). More precisely, if \code{auto.key} is not \code{FALSE}, \code{groups} is non-null, and there is no \code{key} or \code{legend} argument specified in the call, a key is created with \code{simpleKey} with \code{levels(groups)} as the first (\code{text}) argument. (Note: this may not work in all high-level functions, but it does work for the ones where grouping makes sense with the default panel function). If \code{auto.key} is provided as a list and includes a \code{text} component, then that is used instead as the text labels in the key, and the key is drawn even if \code{groups} is not specified. Note that \code{simpleKey} uses the default settings (see \code{\link{trellis.par.get}}) to determine the graphical parameters in the key, so the resulting legend will be meaningful only if the same settings are used in the plot as well. The \code{par.settings} argument, possibly in conjunction with \code{\link{simpleTheme}}, may be useful to temporarily modify the default settings for this purpose. One disadvantage to using \code{key} (or even \code{simpleKey}) directly is that the graphical parameters used in the key are absolutely determined at the time when the \code{"trellis"} object is created. Consequently, if a plot once created is re-\code{plot}-ted with different settings, the original parameter settings will be used for the key even though the new settings are used for the actual display. However, with \code{auto.key}, the key is actually created at plotting time, so the settings will match. } \item{prepanel}{ A function that takes the same arguments as the \code{panel} function and returns a list, possibly containing components named \code{xlim}, \code{ylim}, \code{dx}, and \code{dy} (and less frequently, \code{xat} and \code{yat}). The return value of a user-supplied prepanel function need not contain all these components; in case some are missing, they are replaced by the component-wise defaults. The \code{xlim} and \code{ylim} components are similar to the high level \code{xlim} and \code{ylim} arguments (i.e., they are usually a numeric vector of length 2 defining a range, or a character vector representing levels of a factor). If the \code{xlim} and \code{ylim} arguments are not explicitly specified (possibly as components in \code{scales}) in the high-level call, then the actual limits of the panels are guaranteed to include the limits returned by the prepanel function. This happens globally if the \code{relation} component of \code{scales} is \code{"same"}, and on a per-panel basis otherwise. The \code{dx} and \code{dy} components are used for banking computations in case \code{aspect} is specified as \code{"xy"}. See documentation of \code{\link{banking}} for details. If \code{xlim} or \code{ylim} is a character vector (which is appropriate when the corresponding variable is a factor), this implicitly indicates that the scale should include the first \code{n} integers, where \code{n} is the length of \code{xlim} or \code{ylim}, as the case may be. The elements of the character vector are used as the default labels for these \code{n} integers. Thus, to make this information consistent between panels, the \code{xlim} or \code{ylim} values should represent all the levels of the corresponding factor, even if some are not used within that particular panel. In such cases, an additional component \code{xat} or \code{yat} may be returned by the \code{prepanel} function, which should be a subset of \code{1:n}, indicating which of the \code{n} values (levels) are actually represented in the panel. This is useful when calculating the limits with \code{relation="free"} or \code{relation="sliced"} in \code{scales}. The prepanel function is responsible for providing a meaningful return value when the \code{x}, \code{y} (etc.) variables are zero-length vectors. When nothing else is appropriate, values of NA should be returned for the \code{xlim} and \code{ylim} components. } \item{strip}{ A logical flag or function. If \code{FALSE}, strips are not drawn. Otherwise, strips are drawn using the \code{strip} function, which defaults to \code{strip.default}. See documentation of \code{\link{strip.default}} to see the arguments that are available to the strip function. This description also applies to the \code{strip.left} argument (see \code{...} below), which can be used to draw strips on the left of each panel (useful for wide short panels, e.g., in time-series plots). } \item{xlab}{ Character or expression (or a \code{"grob"}) giving label(s) for the x-axis. Generally defaults to the expression for \code{x} in the formula defining the plot. Can be specified as \code{NULL} to omit the label altogether. Finer control is possible, as described in the entry for \code{main}, with the modification that if the \code{label} component is omitted from the list, it is replaced by the default \code{xlab}. } \item{ylab}{ Character or expression (or \code{"grob"}) giving label for the y-axis. Generally defaults to the expression for \code{y} in the formula defining the plot. Finer control is possible, see entries for \code{main} and \code{xlab}. } \item{scales}{ Generally a list determining how the x- and y-axes (tick marks and labels) are drawn. The list contains parameters in \code{name=value} form, and may also contain two other lists called \code{x} and \code{y} of the same form (described below). Components of \code{x} and \code{y} affect the respective axes only, while those in \code{scales} affect both. When parameters are specified in both lists, the values in \code{x} or \code{y} are used. Note that certain high-level functions have defaults that are specific to a particular axis (e.g., \code{bwplot} has \code{alternating=FALSE} for the categorical axis only); these can only be overridden by an entry in the corresponding component of \code{scales}. As a special exception, \code{scales} (or its \code{x} and \code{y} components) can also be a character string, in which case it is interpreted as the \code{relation} component. The possible components are : \describe{ \item{\code{relation}}{ A character string that determines how axis limits are calculated for each panel. Possible values are \code{"same"} (default), \code{"free"} and \code{"sliced"}. For \code{relation="same"}, the same limits, usually large enough to encompass all the data, are used for all the panels. For \code{relation="free"}, limits for each panel is determined by just the points in that panel. Behavior for \code{relation="sliced"} is similar, except that the length (max - min) of the scales are constrained to remain the same across panels. The determination of what axis limits are suitable for each panel can be controlled by the \code{prepanel} function, which can be overridden by \code{xlim}, \code{ylim} or \code{scales$limits} (except when \code{relation="sliced"}, in which case explicitly specified limits are ignored with a warning). When \code{relation} is \code{"free"}, \code{xlim} or \code{ylim} can be a list, in which case it is treated as if its components were the limit values obtained from the prepanel calculations for each panel (after being replicated if necessary). } \item{\code{tick.number}}{ An integer, giving the suggested number of intervals between ticks. This is ignored for a factor, shingle, or character vector, for in these cases there is no natural rule for leaving out some of the labels. But see \code{xlim}. } \item{\code{draw}}{ A logical flag, defaulting to \code{TRUE}, that determines whether to draw the axis (i.e., tick marks and labels) at all. } \item{\code{alternating}}{ Usually a logical flag specifying whether axis labels should alternate from one side of the group of panels to the other. For finer control, \code{alternating} can also be a vector (replicated to be as long as the number of rows or columns per page) consisting of the following numbers \itemize{ \item 0: do not draw tick labels \item 1: bottom/left \item 2: top/right \item 3: both. } \code{alternating} applies only when \code{relation="same"}. The default is \code{TRUE}, or equivalently, \code{c(1, 2)} } \item{\code{limits}}{ Same as \code{xlim} and \code{ylim}. } \item{\code{at}}{ The location of tick marks along the axis (in native coordinates), or a list as long as the number of panels describing tick locations for each panel. } \item{\code{labels}}{ Vector of labels (characters or expressions) to go along with \code{at}. Can also be a list like \code{at}. } \item{\code{cex}}{ A numeric multiplier to control character sizes for axis labels. Can be a vector of length 2, to control left/bottom and right/top labels separately. } \item{\code{font}, \code{fontface}, \code{fontfamily}}{ Specifies the font to be used for axis labels. } \item{\code{lineheight}}{ Specifies the line height parameter (height of line as a multiple of the size of text); relevant for multi-line labels. (This is currently ignored for \code{\link{cloud}}.) } \item{\code{tck}}{ Usually a numeric scalar controlling the length of tick marks. Can also be a vector of length 2, to control the length of left/bottom and right/top tick marks separately. } \item{\code{col}}{ Color of tick marks and labels. } \item{\code{rot}}{ Angle (in degrees) by which the axis labels are to be rotated. Can be a vector of length 2, to control left/bottom and right/top axes separately. } \item{\code{abbreviate}}{ A logical flag, indicating whether to abbreviate the labels using the \code{\link{abbreviate}} function. Can be useful for long labels (e.g., in factors), especially on the x-axis. } \item{\code{minlength}}{ Argument passed to \code{\link{abbreviate}} if \code{abbreviate=TRUE}. } \item{\code{log}}{ Controls whether the corresponding variable (\code{x} or \code{y}) will be log transformed before being passed to the panel function. Defaults to \code{FALSE}, in which case the data are not transformed. Other possible values are any number that works as a base for taking logarithm, \code{TRUE} (which is equivalent to 10), and \code{"e"} (for the natural logarithm). As a side effect, the corresponding axis is labeled differently. Note that this is in reality a transformation of the data, not the axes. Other than the axis labeling, using this feature is no different than transforming the data in the formula; e.g., \code{scales=list(x = list(log = 2))} is equivalent to \code{y ~ log2(x)}. See entry for \code{equispaced.log} below for details on how to control axis labeling. % Note that in this case the values passed % to the panel function are already transformed, so all % computations done inside the panel function will be affected % accordingly. For example, \code{panel.lmline} will fit a line % to the transformed values. } \item{\code{equispaced.log}}{ A logical flag indicating whether tick mark locations should be equispaced when \sQuote{log scales} are in use. Defaults to \code{TRUE}. Tick marks are always labeled in the original (untransformed) scale, but this makes the choice of tick mark locations nontrivial. If \code{equispaced.log} is \code{FALSE}, the choice made is similar to how log scales are annotated in traditional graphics. If \code{TRUE}, tick mark locations are chosen as \sQuote{pretty} equispaced values in the transformed scale, and labeled in the form \code{"base^loc"}, where \code{base} is the base of the logarithm transformation, and \code{loc} are the locations in the transformed scale. See also \code{xscale.components.logpower} in the \pkg{latticeExtra} package. } \item{\code{format}}{ The \code{format} to use for POSIXct variables. See \code{\link{strptime}} for description of valid values. } \item{\code{axs}}{ A character string, \code{"r"} (default) or \code{"i"}. In the latter case, the axis limits are calculated as the exact data range, instead of being padded on either side. (May not always work as expected.) } } Note that much of the function of \code{scales} is accomplished by \code{pscales} in \code{\link{splom}}. } \item{subscripts}{ A logical flag specifying whether or not a vector named \code{subscripts} should be passed to the panel function. Defaults to \code{FALSE}, unless \code{groups} is specified, or if the panel function accepts an argument named \code{subscripts}. This argument is useful if one wants the subscripts to be passed on even if these conditions do not hold; a typical example is when one wishes to augment a Lattice plot after it has been drawn, e.g., using \code{\link{panel.identify}}. } \item{subset}{ An expression that evaluates to a logical or integer indexing vector. Like \code{groups}, it is evaluated in \code{data}. Only the resulting rows of \code{data} are used for the plot. If \code{subscripts} is \code{TRUE}, the subscripts provided to the panel function will be indices referring to the rows of \code{data} prior to the subsetting. Whether levels of factors in the data frame that are unused after the subsetting will be dropped depends on the \code{drop.unused.levels} argument. } \item{xlim}{ Normally a numeric vector (or a DateTime object) of length 2 giving left and right limits for the x-axis, or a character vector, expected to denote the levels of \code{x}. The latter form is interpreted as a range containing c(1, length(xlim)), with the character vector determining labels at tick positions \code{1:length(xlim)}. \code{xlim} could also be a list, with as many components as the number of panels (recycled if necessary), with each component as described above. This is meaningful only when \code{scales$x$relation} is \code{"free"}, in which case these are treated as if they were the corresponding limit components returned by prepanel calculations. } \item{ylim}{ Similar to \code{xlim}, applied to the y-axis. } \item{drop.unused.levels}{ A logical flag indicating whether the unused levels of factors will be dropped, usually relevant when a subsetting operation is performed or an \code{\link{interaction}} is created. Unused levels are usually dropped, but it is sometimes appropriate to suppress dropping to preserve a useful layout. For finer control, this argument could also be list containing components \code{cond} and \code{data}, both logical, indicating desired behavior for conditioning variables and primary variables respectively. The default is given by \code{lattice.getOption("drop.unused.levels")}, which is initially set to \code{TRUE} for both components. Note that this argument does not control dropping of levels of the \code{groups} argument. } \item{default.scales}{ A list giving the default values of \code{scales} for a particular high-level function. This is rarely of interest to the end-user, but may be helpful when defining other functions that act as a wrapper to one of the high-level Lattice functions. } \item{default.prepanel}{ A function or character string giving the name of a function that serves as the (component-wise) fallback prepanel function when the \code{prepanel} argument is not specified, or does not return all necessary components. The main purpose of this argument is to enable the defaults to be overridden through the use of \code{\link{lattice.options}}. } \item{lattice.options}{ A list that could be supplied to \code{\link{lattice.options}}. These options are applied temporarily for the duration of the call, after which the settings revert back to what they were before. The options are retained along with the object and reused during plotting. This enables the user to attach options settings to the trellis object itself rather than change the settings globally. See also the \code{par.settings} argument described below for a similar treatment of graphical settings. } \item{...}{ Further arguments, usually not directly processed by the high-level functions documented here, but instead passed on to other functions. Such arguments can be broadly categorized into two types: those that affect all high-level Lattice functions in a similar manner, and those that are meant for the specific panel function being used. The first group of arguments are processed by a common, unexported function called \code{trellis.skeleton}. These arguments affect all high-level functions, but are only documented here (except to override the behaviour described here). All other arguments specified in a high-level call, specifically those neither described here nor in the help page of the relevant high-level function, are passed unchanged to the panel function used. By convention, the default panel function used for any high-level function is named as \dQuote{\code{panel.}} followed by the name of the high-level function; for example, the default panel function for \code{bwplot} is \code{panel.bwplot}. In practical terms, this means that in addition to the help page of the high-level function being used, the user should also consult the help page of the corresponding panel function for arguments that may be specified in the high-level call. The effect of the first group of common arguments are as follows: \describe{ \item{\code{as.table}:}{ A logical flag that controls the order in which panels should be displayed: if \code{FALSE} (the default), panels are drawn left to right, bottom to top (as in a graph); if \code{TRUE}, left to right, top to bottom (as in a table). } \item{\code{between}:}{ A list with components \code{x} and \code{y} (both usually 0 by default), numeric vectors specifying the space between the panels (units are character heights). \code{x} and \code{y} are repeated to account for all panels in a page and any extra components are ignored. The result is used for all pages in a multi page display. In other words, it is not possible to use different \code{between} values for different pages. } \item{\code{key}:}{ A list that defines a legend to be drawn on the plot. This list is used as an argument to the \code{\link{draw.key}} function, which produces a \code{"grob"} (grid object) eventually plotted by the print method for \code{"trellis"} objects. The structure of the legend is constrained in the ways described below. Although such a list can be and often is created explicitly, it is also possible to generate such a list using the \code{\link{simpleKey}} function; the latter is more convenient but less flexible. The \code{auto.key} argument can be even more convenient for the most common situation where legends are used, namely, in conjunction with a grouping variable. To use more than one legend, or to have arbitrary legends not constrained by the structure imposed by \code{key}, use the \code{legend} argument. The position of the key can be controlled in either of two possible ways. If a component called \code{space} is present, the key is positioned outside the plot region, in one of the four sides, determined by the value of \code{space}, which can be one of \code{"top"}, \code{"bottom"}, \code{"left"} and \code{"right"}. Alternatively, the key can be positioned inside the plot region by specifying components \code{x}, \code{y} and \code{corner}. \code{x} and \code{y} determine the location of the corner of the key given by \code{corner}, which is usually one of \code{c(0,0)}, \code{c(1,0)}, \code{c(1,1)} and \code{c(0,1)}, which denote the corners of the unit square. Fractional values are also allowed, in which case \code{x} and \code{y} determine the position of an arbitrary point inside (or outside for values outside the unit interval) the key. \code{x} and \code{y} should be numbers between 0 and 1, giving coordinates with respect to the \dQuote{display area}. Depending on the value of the \code{"legend.bbox"} option (see \code{\link{lattice.getOption}}), this can be either the full figure region (\code{"full"}), or just the region that bounds the panels and strips (\code{"panel"}). The key essentially consists of a number of columns, possibly divided into blocks, each containing some rows. The contents of the key are determined by (possibly repeated) components named \code{"rectangles"}, \code{"lines"}, \code{"points"} or \code{"text"}. Each of these must be lists with relevant graphical parameters (see later) controlling their appearance. The \code{key} list itself can contain graphical parameters, these would be used if relevant graphical components are omitted from the other components. The length (number of rows) of each such column (except \code{"text"}s) is taken to be the largest of the lengths of the graphical components, including the ones specified outside (see the entry for \code{rep} below for details on this). The \code{"text"} component must have a character or expression vector as its first component, to be used as labels. The length of this vector determines the number of rows. The graphical components that can be included in \code{key} and also in the components named \code{"text"}, \code{"lines"}, \code{"points"} and \code{"rectangles"} (as appropriate) are: \itemize{ \item \code{cex=1} (text, lines, points) \item \code{col="black"} (text, rectangles, lines, points) \item \code{alpha=1} (text, rectangles, lines, points) \item \code{fill="transparent"} (lines, points) \item \code{lty=1} (lines) \item \code{lwd=1} (lines, points) \item \code{font=1} (text, points) \item \code{fontface} (text, points) \item \code{fontfamily} (text, points) \item \code{pch=8} (lines, points) \item \code{adj=0} (text) \item \code{type="l"} (lines) \item \code{size=5} (rectangles, lines) \item \code{height=1} (rectangles) \item \code{lineheight=1} (text) \item \code{angle=0} (rectangles, but ignored) \item \code{density=-1} (rectangles, but ignored) } In addition, the component \code{border} can be included inside the \code{"rect"} component to control the border color of the rectangles; when specified at the top level, \code{border} controls the border of the entire key (see below). \code{angle} and \code{density} are unimplemented. \code{size} determines the width of columns of rectangles and lines in character widths. \code{type} is relevant for lines; \code{"l"} denotes a line, \code{"p"} denotes a point, and \code{"b"} and \code{"o"} both denote both together. \code{height} gives heights of rectangles as a fraction of the default. Other possible components of \code{key} are: \describe{ \item{\code{reverse.rows}}{ Logical flag, defaulting to \code{FALSE}. If \code{TRUE}, all components are reversed \emph{after} being replicated (the details of which may depend on the value of \code{rep}). This is useful in certain situations, e.g., with a grouped \code{barchart} with \code{stack = TRUE} with the categorical variable on the vertical axis, where the bars in the plot will usually be ordered from bottom to top, but the corresponding legend will have the levels from top to bottom unless \code{reverse.rows = TRUE}. Note that in this case, unless all columns have the same number or rows, they will no longer be aligned. } \item{\code{between}}{ Numeric vector giving the amount of space (character widths) surrounding each column (split equally on both sides). } \item{\code{title}}{ String or expression giving a title for the key. } \item{\code{rep}}{ Logical flag, defaults to \code{TRUE}. By default, it is assumed that all columns in the key (except the \code{"text"}s) will have the same number of rows, and all components are replicated to be as long as the longest. This can be suppressed by specifying \code{rep=FALSE}, in which case the length of each column will be determined by components of that column alone. } \item{\code{cex.title}}{ Zoom factor for the title. } \item{\code{lines.title}}{ The amount of vertical space to be occupied by the title in lines (in multiples of itself). Defaults to 2. } \item{\code{padding.text}}{ The amount of space (padding) to be used above and below each row containing text, in multiples of the default, which is currently \code{0.2 * "lines"}. This padding is in addition to the normal height of any row that contains text, which is the minimum amount necessary to contain all the text entries. } \item{\code{background}}{ Background color for the legend. Defaults to the global background color. } \item{\code{alpha.background}}{ An alpha transparency value between 0 and 1 for the background. } \item{\code{border}}{ Either a color for the border, or a logical flag. In the latter case, the border color is black if \code{border} is \code{TRUE}, and no border is drawn if it is \code{FALSE} (the default). } \item{\code{transparent=FALSE}}{ Logical flag, whether legend should have a transparent background. } \item{\code{just}}{ A character or numeric vector of length one or two giving horizontal and vertical justification for the placement of the legend. See \code{\link[grid:grid.layout]{grid.layout}} for more precise details. } \item{\code{columns}}{ The number of column-blocks (drawn side by side) the legend is to be divided into. } \item{\code{between.columns}}{ Space between column blocks, in addition to \code{between}. } \item{\code{divide}}{ Number of point symbols to divide each line when \code{type} is \code{"b"} or \code{"o"} in \code{lines}. } } } \item{\code{legend}:}{ The legend argument can be useful if one wants to place more than one key. It also allows the use of arbitrary \code{"grob"}s (grid objects) as legends. If used, \code{legend} must be a list, with an arbitrary number of components. Each component must be named one of \code{"left"}, \code{"right"}, \code{"top"}, \code{"bottom"}, or \code{"inside"}. The name \code{"inside"} can be repeated, but not the others. This name will be used to determine the location for that component, and is similar to the \code{space} component of \code{key}. If \code{key} (or \code{colorkey} for \code{\link{levelplot}} and \code{\link{wireframe}}) is specified, their \code{space} component must not conflict with the name of any component of \code{legend}. Each component of \code{legend} must have a component called \code{fun}. This can be a \code{"grob"}, or a function (or the name of a function) that produces a \code{"grob"} when called. If this function expects any arguments, they must be supplied as a list in another component called \code{args}. For components named \code{"inside"}, there can be additional components called \code{x}, \code{y} and \code{corner}, which work in the same way as for \code{key}. } \item{\code{page}:}{ A function of one argument (page number) to be called after drawing each page. The function must be \sQuote{grid-compliant}, and is called with the whole display area as the default viewport. } \item{\code{xlab.top}, \code{ylab.right}:}{ Labels for the x-axis on top, and y-axis on the right. Similar to \code{xlab} and \code{ylab}, but less commonly used. } \item{\code{main}:}{ Typically a character string or expression describing the main title to be placed on top of each page. Defaults to \code{NULL}. \code{main} (as well as \code{xlab}, \code{ylab} and \code{sub}) is usually a character string or an expression that gets used as the label, but can also be a list that controls further details. Expressions are treated as specification of LaTeX-like markup as described in \code{\link{plotmath}}. The label can be a vector, in which case the components will be spaced out horizontally (or vertically for \code{ylab}). This feature can be used to provide column or row labels rather than a single axis label. When \code{main} (etc.) is a list, the actual label should be specified as the \code{label} component (which may be unnamed if it is the first component). The label can be missing, in which case the default will be used (\code{xlab} and \code{ylab} usually have defaults, but \code{main} and \code{sub} do not). Further named arguments are passed on to \code{\link[grid:grid.text]{textGrob}}; this can include arguments controlling positioning like \code{just} and \code{rot} as well as graphical parameters such as \code{col} and \code{font} (see \code{\link[grid:gpar]{gpar}} for a full list). \code{main}, \code{sub}, \code{xlab}, \code{ylab}, \code{xlab.top}, and \code{ylab.right} can also be arbitrary \code{"grob"}s (grid graphical objects). } \item{\code{sub}:}{ Character string or expression (or a list or \code{"grob"}) for a subtitle to be placed at the bottom of each page. See entry for \code{main} for finer control options. } \item{\code{par.strip.text}:}{ A list of parameters to control the appearance of strip text. Notable components are \code{col}, \code{cex}, \code{font}, and \code{lines}. The first three control graphical parameters while the last is a means of altering the height of the strips. This can be useful, for example, if the strip labels (derived from factor levels, say) are double height (i.e., contains \code{"\\n"}-s) or if the default height seems too small or too large. Additionally, the \code{lineheight} component can control the space between multiple lines. The labels can be abbreviated when shown by specifying \code{abbreviate = TRUE}, in which case the components \code{minlength} and \code{dot} (passed along to the \code{\link{abbreviate}} function) can be specified to control the details of how this is done. } \item{\code{layout}:}{ In general, a conditioning plot in Lattice consists of several panels arranged in a rectangular array, possibly spanning multiple pages. \code{layout} determines this arrangement. \code{layout} is a numeric vector of length 2 or 3 giving the number of columns, rows, and pages (optional) in a multipanel display. By default, the number of columns is the number of levels of the first conditioning variable and the number of rows is the number of levels of the second conditioning variable. If there is only one conditioning variable, the default layout vector is \code{c(0,n)}, where \code{n} is the number of levels of the given vector. Any time the first value in the layout vector is 0, the second value is used as the desired number of panels per page and the actual layout is computed from this, taking into account the aspect ratio of the panels and the device dimensions (via \code{\link{par}("din")}). If \code{NA} is specified for the number of rows or columns (but not both), that dimension will be filled out according to the number of panels. The number of pages is by default set to as many as is required to plot all the panels, and so rarely needs to be specified. However, in certain situations the default calculation may be incorrect, and in that case the number of pages needs to be specified explicitly. %% Example: xyplot(yield~year|site, barley, layout = c(0, 5)) %% OK with some par("din"), but not others (e.g., square) %% NO LONGER TRUE: In general, giving a high value of %% \code{layout[3]} is not wasteful because blank pages are %% never created. } \item{\code{skip}:}{ A logical vector (default \code{FALSE}), replicated to be as long as the number of panels (spanning all pages). For elements that are \code{TRUE}, the corresponding panel position is skipped; i.e., nothing is plotted in that position. The panel that was supposed to be drawn there is now drawn in the next available panel position, and the positions of all the subsequent panels are bumped up accordingly. This may be useful for arranging plots in an informative manner. } \item{\code{strip.left}:}{ \code{strip.left} can be used to draw strips on the left of each panel, which can be useful for wide short panels, as in time-series (or similar) plots. See the entry for \code{strip} for detailed usage. } \item{\code{xlab.default}, \code{ylab.default}:}{ Fallback default for \code{xlab} and \code{ylab} when they are not specified. If \code{NULL}, the defaults are parsed from the Trellis formula. This is rarely useful for the end-user, but can be helpful when developing new Lattice functions. } \item{\code{xscale.components}, \code{yscale.components}:}{ Functions that determine axis annotation for the x and y axes respectively. See documentation for \code{\link{xscale.components.default}}, the default values of these arguments, to learn more. } \item{\code{axis}:}{ Function responsible for drawing axis annotation. See documentation for \code{\link{axis.default}}, the default value of this argument, to learn more. } \item{\code{perm.cond}:}{ An integer vector, a permutation of \code{1:n}, where \code{n} is the number of conditioning variables. By default, the order in which panels are drawn depends on the order of the conditioning variables specified in the formula. \code{perm.cond} can modify this order. If the trellis display is thought of as an \code{n}-dimensional array, then during printing, its dimensions are permuted using \code{perm.cond} as the \code{perm} argument does in \code{\link{aperm}}. } \item{\code{index.cond}:}{ Whereas \code{perm.cond} permutes the dimensions of the multidimensional array of panels, \code{index.cond} can be used to subset (or reorder) margins of that array. \code{index.cond} can be a list or a function, with behavior in each case described below. The panel display order within each conditioning variable depends on the order of their levels. \code{index.cond} can be used to choose a \sQuote{subset} (in the R sense) of these levels, which is then used as the display order for that variable. If \code{index.cond} is a list, it has to be as long as the number of conditioning variables, and the \code{i}-th component has to be a valid indexing vector for \code{levels(g_i)}, where \code{g_i} is the \code{i}-th conditioning variable in the plot (note that these levels may not contain all levels of the original variable, depending on the effects of the \code{subset} and \code{drop.unused.levels} arguments). In particular, this indexing may repeat levels, or drop some altogether. The result of this indexing determines the order of panels within that conditioning variable. To keep the order of a particular variable unchanged, the corresponding component must be set to \code{TRUE}. Note that the components of \code{index.cond} are interpreted in the order of the conditioning variables in the original call, and is not affected by \code{perm.cond}. Another possibility is to specify \code{index.cond} as a function. In this case, this function is called once for each panel, potentially with all arguments that are passed to the panel function for that panel. (More specifically, if this function has a \code{...} argument, then all panel arguments are passed, otherwise, only named arguments that match are passed.) If there is only one conditioning variable, the levels of that variable are then sorted so that these values are in ascending order. For multiple conditioning variables, the order for each variable is determined by first taking the average over all other conditioning variables. Although they can be supplied in high-level function calls directly, it is more typical to use \code{perm.cond} and \code{index.cond} to update an existing \code{"trellis"} object, thus allowing it to be displayed in a different arrangement without re-calculating the data subsets that go into each panel. In the \code{\link{update.trellis}} method, both can be set to \code{NULL}, which reverts these back to their defaults. } \item{\code{par.settings}:}{ A list that could be supplied to \code{\link{trellis.par.set}}. When the resulting object is plotted, these options are applied temporarily for the duration of the plotting, after which the settings revert back to what they were before. This enables the user to attach some display settings to the trellis object itself rather than change the settings globally. See also the \code{lattice.options} argument described above for a similar treatment of non-graphical options. } \item{\code{plot.args}:}{ A list containing possible arguments to \code{\link{plot.trellis}}, which will be used by the \code{plot} or \code{print} methods when drawing the object, unless overridden explicitly. This enables the user to attach such arguments to the trellis object itself. Partial matching is not performed. } } } } \value{ The high-level functions documented here, as well as other high-level Lattice functions, return an object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to subsequently update components of the object, and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \details{ The high-level functions documented here, as well as other high-level Lattice functions, are generic, with the \code{formula} method usually doing the most substantial work. The structure of the plot that is produced is mostly controlled by the formula (implicitly in the case of the non-formula methods). For each unique combination of the levels of the conditioning variables \code{g1, g2, ...}, a separate \dQuote{packet} is produced, consisting of the points \code{(x,y)} for the subset of the data defined by that combination. The display can be thought of as a three-dimensional array of panels, consisting of one two-dimensional matrix per page. The dimensions of this array are determined by the \code{layout} argument. If there are no conditioning variables, the plot produced consists of a single packet. Each packet usually corresponds to one panel, but this is not strictly necessary (see the entry for \code{index.cond} above). The coordinate system used by \pkg{lattice} by default is like a graph, with the origin at the bottom left, with axes increasing to the right and top. In particular, panels are by default drawn starting from the bottom left corner, going right and then up, unless \code{as.table = TRUE}, in which case panels are drawn from the top left corner, going right and then down. It is possible to set a global preference for the table-like arrangement by changing the default to \code{as.table=TRUE}; this can be done by setting \code{lattice.options(default.args = list(as.table = TRUE))}. Default values can be set in this manner for the following arguments: \code{as.table}, \code{aspect}, \code{between}, \code{page}, \code{main}, \code{sub}, \code{par.strip.text}, \code{layout}, \code{skip} and \code{strip}. Note that these global defaults are sometimes overridden by individual functions. The order of the panels depends on the order in which the conditioning variables are specified, with \code{g1} varying fastest, followed by \code{g2}, and so on. Within a conditioning variable, the order depends on the order of the levels (which for factors is usually in alphabetical order). Both of these orders can be modified using the \code{index.cond} and \code{perm.cond} arguments, possibly using the \code{\link[lattice:update.trellis]{update}} (and other related) method(s). } \note{ Most of the arguments documented here are also applicable for the other high-level functions in the \pkg{lattice} package. These are not described in any detail elsewhere unless relevant, and this should be considered the canonical documentation for such arguments. Any arguments passed to these functions and not recognized by them will be passed to the panel function. Most predefined panel functions have arguments that customize its output. These arguments are described only in the help pages for these panel functions, but can usually be supplied as arguments to the high-level plot. } \references{ Sarkar, Deepayan (2008) \emph{Lattice: Multivariate Data Visualization with R}, Springer. \url{http://lmdvr.r-forge.r-project.org/} } \seealso{ \code{\link{Lattice}} for an overview of the package, as well as \code{\link{barchart.table}}, \code{\link{print.trellis}}, \code{\link{shingle}}, \code{\link{banking}}, \code{\link{reshape}}, \code{\link{panel.xyplot}}, \code{\link{panel.bwplot}}, \code{\link{panel.barchart}}, \code{\link{panel.dotplot}}, \code{\link{panel.stripplot}}, \code{\link{panel.superpose}}, \code{\link{panel.loess}}, \code{\link{panel.average}}, \code{\link{strip.default}}, \code{\link{simpleKey}} \code{\link{trellis.par.set}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ require(stats) ## Tonga Trench Earthquakes Depth <- equal.count(quakes$depth, number=8, overlap=.1) xyplot(lat ~ long | Depth, data = quakes) update(trellis.last.object(), strip = strip.custom(strip.names = TRUE, strip.levels = TRUE), par.strip.text = list(cex = 0.75), aspect = "iso") ## Extended formula interface xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species, data = iris, scales = "free", layout = c(2, 2), auto.key = list(x = .75, y = .75, corner = c(0.5, 0.5))) ## user defined panel functions states <- data.frame(state.x77, state.name = dimnames(state.x77)[[1]], state.region = state.region) xyplot(Murder ~ Population | state.region, data = states, snames = states$state.name, panel = function(x, y, subscripts, snames) { panel.text(x = x, y = y, labels = snames[subscripts], cex = 1, fontfamily = "HersheySans") }) ## Stacked bar chart barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), stack = TRUE, auto.key = list(space = "right"), ylab = "Barley Yield (bushels/acre)", scales = list(x = list(rot = 45))) bwplot(voice.part ~ height, data = singer, xlab = "Height (inches)") dotplot(variety ~ yield | year * site, data=barley) ## Grouped dot plot showing anomaly at Morris dotplot(variety ~ yield | site, data = barley, groups = year, key = simpleKey(levels(barley$year), space = "right"), xlab = "Barley Yield (bushels/acre) ", aspect=0.5, layout = c(1,6), ylab=NULL) stripplot(voice.part ~ jitter(height), data = singer, aspect = 1, jitter.data = TRUE, xlab = "Height (inches)") ## Interaction Plot xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos, type = "a", auto.key = list(space = "right", points = FALSE, lines = TRUE)) ## longer version with no x-ticks \dontrun{ bwplot(decrease ~ treatment, OrchardSprays, groups = rowpos, panel = "panel.superpose", panel.groups = "panel.linejoin", xlab = "treatment", key = list(lines = Rows(trellis.par.get("superpose.line"), c(1:7, 1)), text = list(lab = as.character(unique(OrchardSprays$rowpos))), columns = 4, title = "Row position")) } } \keyword{hplot} lattice/man/level.colors.Rd0000644000176200001440000000534714411502706015361 0ustar liggesusers\name{D_level.colors} \alias{level.colors} \title{ A function to compute false colors representing a numeric or categorical variable } \description{ Calculates false colors from a numeric variable (including factors, using their numeric codes) given a color scheme and breakpoints. } \usage{ level.colors(x, at, col.regions, colors = TRUE, ...) } \arguments{ \item{x}{ A numeric or \code{\link{factor}} variable. } \item{at}{ A numeric variable of breakpoints defining intervals along the range of \code{x}. } \item{col.regions}{ A specification of the colors to be assigned to each interval defined by \code{at}. This could be either a vector of colors, or a function that produces a vector of colors when called with a single argument giving the number of colors. See details below. } \item{colors}{ logical indicating whether colors should be computed and returned. If \code{FALSE}, only the indices representing which interval (among those defined by \code{at}) each value in \code{x} falls into is returned. } \item{\dots}{ Extra arguments, ignored. } } \value{ A vector of the same length as \code{x}. Depending on the \code{colors} argument, this could be either a vector of colors (in a form usable by \R), or a vector of integer indices representing which interval the values of \code{x} fall in. } \author{ Deepayan Sarkar \email{deepayan.sarkar@r-project.org} } \seealso{ \code{\link{levelplot}}, \code{\link{colorRampPalette}}. } \details{ If \code{at} has length n, then it defines n-1 intervals. Values of \code{x} outside the range of \code{at} are not assigned to an interval, and the return value is \code{NA} for such values. Colors are chosen by assigning a color to each of the n-1 intervals. If \code{col.regions} is a palette function (such as \code{\link{topo.colors}}, or the result of calling \code{\link{colorRampPalette}}), it is called with n-1 as an argument to obtain the colors. Otherwise, if there are exactly n-1 colors in \code{col.regions}, these get assigned to the intervals. If there are fewer than n-1 colors, \code{col.regions} gets recycled. If there are more, a more or less equally spaced (along the length of \code{col.regions}) subset is chosen. } \examples{ depth.col <- with(quakes, level.colors(depth, at = do.breaks(range(depth), 30), col.regions = hcl.colors)) xyplot(lat ~ long | equal.count(stations), quakes, strip = strip.custom(var.name = "Stations"), colours = depth.col, panel = function(x, y, colours, subscripts, ...) { panel.xyplot(x, y, pch = 21, col = "transparent", fill = colours[subscripts], ...) }) } \keyword{utilities} lattice/man/panel.spline.Rd0000644000176200001440000000461613070415115015335 0ustar liggesusers\name{F_2_panel.spline} \alias{panel.spline} \title{Panel Function to Add a Spline Smooth} \description{ A predefined panel function that can be used to add a spline smooth based on the provided data. } \usage{ panel.spline(x, y, npoints = 101, lwd = plot.line$lwd, lty = plot.line$lty, col, col.line = plot.line$col, type, horizontal = FALSE, \dots, keep.data = FALSE, identifier = "spline") } \arguments{ \item{x, y}{ Variables defining the data to be used. } \item{npoints}{ The number of equally spaced points within the range of the predictor at which the fitted model is evaluated for plotting. } \item{lwd, lty, col, col.line}{ Graphical parameters for the added line. \code{col.line} overrides \code{col}. } \item{type}{ Ignored. The argument is present only to make sure that an explicitly specified \code{type} argument (perhaps meant for another function) does not affect the display. } \item{horizontal}{ A logical flag controlling which variable is to be treated as the predictor (by default \code{x}) and which as the response (by default \code{y}). If \code{TRUE}, the plot is \sQuote{transposed} in the sense that \code{y} becomes the predictor and \code{x} the response. (The name \sQuote{horizontal} may seem an odd choice for this argument, and originates from similar usage in \code{\link{bwplot}}). } \item{keep.data}{ Passed on to \code{\link{smooth.spline}}. The default here (\code{FALSE}) is different, and results in the original data not being retained in the fitted spline model. It may be useful to set this to \code{TRUE} if the return value of \code{panel.spline}, which is the fitted model as returned by \code{\link{smooth.spline}}, is to be used for subsequent computations. } \item{\dots}{ Extra arguments, passed on to \code{\link{smooth.spline}} and \code{\link{panel.lines}} as appropriate. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \value{ The fitted model as returned by \code{\link{smooth.spline}}. } \seealso{\link{Lattice}, \code{\link[stats:scatter.smooth]{smooth.spline}}, \code{\link{prepanel.spline}} } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/trellis.par.get.Rd0000644000176200001440000002115014424664146015770 0ustar liggesusers\name{C_02b_trellis.par.get} \alias{trellis.par.get} \alias{trellis.par.set} \alias{show.settings} \title{ Graphical Parameters for Trellis Displays } \description{ Functions used to query, display and modify graphical parameters for fine control of Trellis displays. Modifications are made to the settings for the currently active device only. } \usage{ trellis.par.set(name, value, \dots, theme, warn = TRUE, strict = FALSE) trellis.par.get(name = NULL) show.settings(x = NULL) } % trellis.par.set(name, value, warn) % trellis.par.set(theme) % trellis.par.set(\dots) \arguments{ \item{name}{ A character string giving the name of a component. If unspecified in \code{trellis.par.get()}, the return value is a named list containing all the current settings (this can be used to get the valid values for \code{name}). } \item{value}{ a list giving the desired value of the component. Components that are already defined as part of the current settings but are not mentioned in \code{value} will remain unchanged. } \item{theme}{ a list decribing how to change the settings, similar to what is returned by \code{trellis.par.get()}. This is purely for convenience, allowing multiple calls to \code{trellis.par.set} to be condensed into one. The name of each component must be a valid \code{name} as described above, with the corresponding value a valid \code{value} as described above. As in \code{\link{trellis.device}}, \code{theme} can also be a function that produces such a list when called. The function name can be supplied as a quoted string. } \item{\dots}{ Multiple settings can be specified in \code{name = value} form. Equivalent to calling with \code{theme = list(\dots)} } \item{warn}{ A logical flag, indicating whether a warning should be issued when \code{trellis.par.get} is called when no graphics device is open. } \item{strict}{ Usually a logical flag, indicating whether the \code{value} should be interpreted strictly. Usually, assignment of value to the corresponding named component is fuzzy in the sense that sub-components that are absent from \code{value} but not currently \code{NULL} are retained. By specifying \code{strict = TRUE}, such values will be removed. An even stricter interpretation is allowed by specifying \code{strict} as a numeric value larger than \code{1}. In that case, top-level components not specified in the call will also be removed. This is primarily for internal use. } \item{x}{ optional list of components that change the settings (any valid value of \code{theme}). These are used to modify the current settings (obtained by \code{trellis.par.get}) before they are displayed. } } \details{ The various graphical parameters (color, line type, background etc) that control the look and feel of Trellis displays are highly customizable. Also, R can produce graphics on a number of devices, and it is expected that a different set of parameters would be more suited to different devices. These parameters are stored internally in a variable named \code{lattice.theme}, which is a list whose components define settings for particular devices. The components are idenified by the name of the device they represent (as obtained by \code{.Device}), and are created as and when new devices are opened for the first time using \code{trellis.device} (or Lattice plots are drawn on a device for the first time in that session). The initial settings for each device defaults to values appropriate for that device. In practice, this boils down to three distinct settings, one for screen devices like \code{x11} and \code{windows}, one for black and white plots (mostly useful for \code{postscript}) and one for color printers (color \code{postcript}, \code{pdf}). Once a device is open, its settings can be modified. When another instance of the same device is opened later using \code{trellis.device}, the settings for that device are reset to its defaults, unless otherwise specified in the call to \code{trellis.device}. But settings for different devices are treated separately, i.e., opening a postscript device will not alter the x11 settings, which will remain in effect whenever an x11 device is active. The functions \code{trellis.par.*} are meant to be interfaces to the global settings. They always apply on the settings for the currently ACTIVE device. \code{trellis.par.get}, called without any arguments, returns the full list of settings for the active device. With the \code{name} argument present, it returns that component only. \code{trellis.par.get} sets the value of the \code{name} component of the current active device settings to \code{value}. \code{trellis.par.get} is usually used inside trellis functions to get graphical parameters before plotting. Modifications by users via \code{trellis.par.set} is traditionally done as follows: \code{add.line <- trellis.par.get("add.line")} \code{add.line$col <- "red"} \code{trellis.par.set("add.line", add.line)} More convenient (but not S compatible) ways to do this are \code{trellis.par.set(list(add.line = list(col = "red")))} and \code{trellis.par.set(add.line = list(col = "red"))} The actual list of the components in \code{trellis.settings} has not been finalized, so I'm not attempting to list them here. The current value can be obtained by \code{print(trellis.par.get())}. Most names should be self-explanatory. \code{show.settings} provides a graphical display summarizing some of the values in the current settings. } \note{ In some ways, \code{trellis.par.get} and \code{trellis.par.set} together are a replacement for the \code{\link{par}} function used in traditional R graphics. In particular, changing \code{par} settings has little (if any) effect on lattice output. Since lattice plots are implemented using Grid graphics, its parameter system \emph{does} have an effect unless overridden by a suitable lattice parameter setting. Such parameters can be specified as part of a lattice theme by including them in the \code{grid.pars} component (see \code{\link[grid:gpar]{gpar}} for a list of valid parameter names). } \value{ \code{trellis.par.get} returns a list giving parameters for that component. If \code{name} is missing, it returns the full list. Most of the settings are graphical parameters that control various elements of a lattice plot. For details, see the examples below. The more unusual settings are described here. \describe{ \item{\code{grid.pars}}{ Grid graphical parameters that are in effect globally unless overridden by specific settings.} \item{\code{fontsize}}{ A list of two components (each a numeric scalar), \code{text} and \code{points}, for text and symbols respectively. } \item{\code{clip}}{ A list of two components (each a character string, either \code{"on"} or \code{"off"}), \code{panel} and \code{strip}. } \item{\code{axis.components}}{ A list with four components (\code{left}, \code{top}, \code{right}, \code{bottom}), each a list giving numeric mutlipliers named \code{tck}, \code{pad1}, and \code{pad2} for corresponding grid layout units. } \item{\code{layout.heights}}{ A list with numeric multipliers for grid layout heights. } \item{\code{layout.widths}}{ A list with numeric multipliers for grid layout widths. } } } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{trellis.device}}, \code{\link{Lattice}}, \code{\link[grid:gpar]{gpar}} } \examples{ show.settings() tp <- trellis.par.get() unusual <- c("grid.pars", "fontsize", "clip", "axis.components", "layout.heights", "layout.widths") for (u in unusual) tp[[u]] <- NULL names.tp <- lapply(tp, names) unames <- sort(unique(unlist(names.tp))) ans <- matrix(0, nrow = length(names.tp), ncol = length(unames)) rownames(ans) <- names(names.tp) colnames(ans) <- unames for (i in seq_along(names.tp)) ans[i, ] <- as.numeric(unames \%in\% names.tp[[i]]) ans <- ans[, order(-colSums(ans))] ans <- ans[order(rowSums(ans)), ] ans[ans == 0] <- NA levelplot(t(ans), colorkey = FALSE, scales = list(x = list(rot = 90)), panel = function(x, y, z, ...) { panel.abline(v = unique(as.numeric(x)), h = unique(as.numeric(y)), col = "darkgrey") panel.xyplot(x, y, pch = 16 * z, ...) }, xlab = "Graphical parameters", ylab = "Setting names") } \keyword{dplot} lattice/man/qq.Rd0000644000176200001440000001150514576262623013401 0ustar liggesusers\name{B_05_qq} \alias{qq} \alias{qq.formula} \alias{qq.data.frame} \title{ Quantile-Quantile Plots of Two Samples } \description{ Quantile-Quantile plots for comparing two Distributions } \usage{ qq(x, data, ...) \method{qq}{formula}(x, data, aspect = "fill", panel = lattice.getOption("panel.qq"), prepanel, scales, strip, groups, xlab, xlim, ylab, ylim, f.value = NULL, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, qtype = 7, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.qq"), subscripts, subset) \method{qq}{data.frame}(x, data = NULL, formula = data, ...) } \arguments{ \item{x}{ The object on which method dispatch is carried out. For the \code{"formula"} method, \code{x} should be a formula of the form \code{y ~ x | g1 * g2 * ...}, where \code{x} should be a numeric variable, and \code{y} a factor, shingle, character, or numeric variable, with the restriction that there must be exactly two levels of \code{y}, which divide the values of \code{x} into two groups. Quantiles for these groups will be plotted against each other along the two axes. } \item{data}{ For the \code{formula} method, an optional data source (usually a data frame) in which variables are to be evaluated (see \code{\link{xyplot}} for details). % \code{data} should not be % specified for other methods, and is ignored with a warning if it % is. } \item{formula}{ The formula to be used for the \code{"data.frame"} method. See documentation for argument \code{x} for details. } \item{f.value}{ An optional numeric vector of probabilities, quantiles corresponding to which should be plotted. This can also be a function of a single integer (representing sample size) that returns such a numeric vector. A typical value for this argument is the function \code{ppoints}, which is also the S-PLUS default. If specified, the probabilities generated by this function is used for the plotted quantiles, through the \code{quantile} function. \code{f.value} defaults to \code{NULL}, which is equivalent to \preformatted{ f.value = function(n) ppoints(n, a = 1) } This has the effect of including the minimum and maximum data values in the computed quantiles. This is similar to what happens for \code{qqplot} but different from the default behaviour of \code{qq} in S-PLUS. For large \code{x}, this argument can be used to restrict the number of quantiles plotted. } \item{panel}{ A function, called once for each panel, that uses the packet (subset of panel variables) corresponding to the panel to create a display. The default panel function \code{\link{panel.qq}} is documented separately, and has arguments that can be used to customize its output in various ways. Such arguments can usually be directly supplied to the high-level function. } \item{qtype}{ The \code{type} argument for \code{\link{quantile}}. } \item{aspect}{ See \code{\link{xyplot}}. } \item{prepanel}{ See \code{\link{xyplot}}. } \item{scales}{ See \code{\link{xyplot}}. } \item{strip}{ See \code{\link{xyplot}}. } \item{groups}{ See \code{\link{xyplot}}. } \item{xlab, ylab}{ See \code{\link{xyplot}}. } \item{xlim, ylim}{ See \code{\link{xyplot}}. } \item{drop.unused.levels}{ See \code{\link{xyplot}}. } \item{lattice.options}{ See \code{\link{xyplot}}. } \item{default.scales}{ See \code{\link{xyplot}}. } \item{subscripts}{ See \code{\link{xyplot}}. } \item{subset}{ See \code{\link{xyplot}}. } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{...}{ Further arguments. See corresponding entry in \code{\link{xyplot}} for non-trivial details. } } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \details{ \code{qq} produces Q-Q plots of two samples. The default behaviour of \code{qq} is different from the corresponding S-PLUS function. See the entry for \code{f.value} for specifics. This and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for \code{xyplot}, which should be consulted to learn more detailed usage. } \seealso{\code{\link{xyplot}}, \code{\link{panel.qq}}, \code{\link{qqmath}}, \code{\link{Lattice}} } \examples{ qq(voice.part ~ height, aspect = 1, data = singer, subset = (voice.part == "Bass 2" | voice.part == "Tenor 1")) } \keyword{dplot} lattice/man/packet.panel.default.Rd0000644000176200001440000000506613070415115016735 0ustar liggesusers\name{G_packet.panel.default} \alias{packet.panel.default} \title{Associating Packets with Panels} \description{ When a \code{"trellis"} object is plotted, panels are always drawn in an order such that columns vary the fastest, then rows and then pages. An optional function can be specified that determines, given the column, row and page and other relevant information, the packet (if any) which should be used in that panel. The function documented here implements the default behaviour, which is to match panel order with packet order, determined by varying the first conditioning variable the fastest, then the second, and so on. This matching is performed after any reordering and/or permutation of the conditioning variables. } \usage{ packet.panel.default(layout, condlevels, page, row, column, skip, all.pages.skip = TRUE) } \arguments{ \item{layout}{ the \code{layout} argument in high level functions, suitably standardized. } \item{condlevels}{ a list of levels of conditioning variables, after relevant permutations and/or reordering of levels } \item{page, row, column}{ the location of the panel in the coordinate system of pages, rows and columns. } \item{skip}{ the \code{skip} argument in high level functions } \item{all.pages.skip}{ whether \code{skip} should be replicated over all pages. If \code{FALSE}, \code{skip} will be replicated to be only as long as the number of positions on a page, and that template will be used for all pages. } } \value{ A suitable combination of levels of the conditioning variables in the form of a numeric vector as long as the number of conditioning variables, with each element an integer indexing the levels of the corresponding variable. Specifically, if the return value is \code{p}, then the \code{i}-th conditioning variable will have level \code{condlevels[[i]][p[i]]}. } \seealso{ \code{\link{Lattice}}, \code{\link{xyplot}} } \examples{ packet.panel.page <- function(n) { ## returns a function that when used as the 'packet.panel' ## argument in print.trellis plots page number 'n' only function(layout, page, ...) { stopifnot(layout[3] == 1) packet.panel.default(layout = layout, page = n, ...) } } data(mtcars) HP <- equal.count(mtcars$hp, 6) p <- xyplot(mpg ~ disp | HP * factor(cyl), mtcars, layout = c(0, 6, 1)) print(p, packet.panel = packet.panel.page(1)) print(p, packet.panel = packet.panel.page(2)) } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \keyword{dplot} lattice/man/utilities.3d.Rd0000644000176200001440000000540313070415115015260 0ustar liggesusers\name{G_utilities.3d} \alias{utilities.3d} \alias{palette.shade} \alias{ltransform3dMatrix} \alias{ltransform3dto3d} \title{ Utility functions for 3-D plots } \description{ These are (related to) the default panel functions for \code{cloud} and \code{wireframe}. } \usage{ ltransform3dMatrix(screen, R.mat) ltransform3dto3d(x, R.mat, dist) % palette.shade(irr, ref, height, saturation) } \arguments{ \item{x}{ \code{x} can be a numeric matrix with 3 rows for \code{ltransform3dto3d} } \item{screen}{list, as described in \code{\link{panel.cloud}}} \item{R.mat}{4x4 transformation matrix in homogeneous coordinates} \item{dist}{controls transformation to account for perspective viewing} % \item{irr, ref}{ % numeric, between 0 and 1. See details below. (The names are intended % to suggest a link with irradiance and reflectance respectively.) % } % \item{height}{ % numeric, denoting height scaled to lie between 0 and 1 % } % \item{saturation}{ % used to control \code{s} in \code{hsv} inside \code{palette.shade} % } } \details{ \code{ltransform3dMatrix} and \code{ltransform3dto3d} are utility functions to help in computation of projections. These functions are used inside the panel functions for \code{cloud} and \code{wireframe}. They may be useful in user-defined panel functions as well. The first function takes a list of the form of the \code{screen} argument in \code{cloud} and \code{wireframe} and a \code{R.mat}, a 4x4 transformation matrix in homogeneous coordinates, to return a new 4x4 transformation matrix that is the result of applying \code{R.mat} followed by the rotations in \code{screen}. The second function applies a 4x4 transformation matrix in homogeneous coordinates to a 3xn matrix representing points in 3-D space, and optionally does some perspective computations. (There has been no testing with non-trivial transformation matrices, and my knowledge of the homogeneous coordinate system is very limited, so there may be bugs here.) % \code{palette.shade} is the function used by default for calculation % of colors when \sQuote{shading} a wireframe. Such a function can expect three % arguments in general, namely \code{irr}, \code{ref} and % \code{height}. \code{irr} should represent foreshortening, being the % cosine of the angle between the incident light ray and the normal to % the surface. \code{ref} represents the direction of the reflected % light, and in fact is the cosine of half the angle between the % reflected ray and the viewing direction. \code{height} is the scaled % (average) height (of any particular facet). } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{cloud}}, \code{\link{panel.cloud}}} \keyword{dplot} lattice/man/qqmath.Rd0000644000176200001440000001562414576262623014261 0ustar liggesusers\name{B_04_qqmath} \alias{qqmath} \alias{qqmath.formula} \alias{qqmath.data.frame} \alias{qqmath.numeric} \title{Q-Q Plot with Theoretical Distribution} \description{ Draw quantile-Quantile plots of a sample against a theoretical distribution, possibly conditioned on other variables. } \usage{ qqmath(x, data, ...) \method{qqmath}{formula}(x, data, allow.multiple = is.null(groups) || outer, outer = !is.null(groups), distribution = qnorm, f.value = NULL, auto.key = lattice.getOption("default.args")$auto.key, aspect = "fill", panel = lattice.getOption("panel.qqmath"), prepanel = NULL, scales, strip, groups, xlab, xlim, ylab, ylim, drop.unused.levels = lattice.getOption("drop.unused.levels"), ..., lattice.options = NULL, default.scales = list(), default.prepanel = lattice.getOption("prepanel.default.qqmath"), subscripts, subset) \method{qqmath}{data.frame}(x, data = NULL, formula = data, ...) \method{qqmath}{numeric}(x, data = NULL, ylab, ...) } \arguments{ \item{x}{ The object on which method dispatch is carried out. For the \code{"formula"} method, \code{x} should be a formula of the form \code{~ x | g1 * g2 * ...}, where \code{x} should be a numeric variable. For the \code{"numeric"} method, \code{x} should be a numeric vector. } \item{data}{ For the \code{formula} method, an optional data source (usually a data frame) in which variables are to be evaluated (see \code{\link{xyplot}} for details). \code{data} should not be specified for the other methods, and is ignored with a warning if it is. } \item{formula}{ The formula to be used for the \code{"data.frame"} methods. See documentation for argument \code{x} for details. } \item{distribution}{ A quantile function that takes a vector of probabilities as argument and produces the corresponding quantiles from a theoretical distribution. Possible values are \code{\link{qnorm}}, \code{\link{qunif}}, etc. Distributions with other required arguments need to be provided as user-defined functions (see example with \code{\link{qt}}). } \item{f.value}{ An optional numeric vector of probabilities, quantiles corresponding to which should be plotted. This can also be a function of a single integer (representing sample size) that returns such a numeric vector. A typical value for this argument is the function \code{ppoints}, which is also the S-PLUS default. If specified, the probabilities generated by this function is used for the plotted quantiles, through the \code{\link{quantile}} function for the sample, and the function specified as the \code{distribution} argument for the theoretical distribution. \code{f.value} defaults to \code{NULL}, which has the effect of using \code{ppoints} for the quantiles of the theoretical distribution, but the exact data values for the sample. This is similar to what happens for \code{qqnorm}, but different from the S-PLUS default of \code{f.value=ppoints}. For large \code{x}, this argument can be used to restrict the number of points plotted. See also the \code{tails.n} argument in \code{\link{panel.qqmath}}. } \item{panel}{ A function, called once for each panel, that uses the packet (subset of panel variables) corresponding to the panel to create a display. The default panel function \code{\link{panel.qqmath}} is documented separately, and has arguments that can be used to customize its output in various ways. Such arguments can usually be directly supplied to the high-level function. } \item{allow.multiple, outer}{ See \code{\link{xyplot}}. } \item{auto.key}{ See \code{\link{xyplot}}. } \item{aspect}{ See \code{\link{xyplot}}. } \item{prepanel}{ See \code{\link{xyplot}}. } \item{scales}{ See \code{\link{xyplot}}. } \item{strip}{ See \code{\link{xyplot}}. } \item{groups}{ See \code{\link{xyplot}}. } \item{xlab, ylab}{ See \code{\link{xyplot}}. } \item{xlim, ylim}{ See \code{\link{xyplot}}. } \item{drop.unused.levels}{ See \code{\link{xyplot}}. } \item{lattice.options}{ See \code{\link{xyplot}}. } \item{default.scales}{ See \code{\link{xyplot}}. } \item{subscripts}{ See \code{\link{xyplot}}. } \item{subset}{ See \code{\link{xyplot}}. } \item{default.prepanel}{ Fallback prepanel function. See \code{\link{xyplot}}. } \item{...}{ Further arguments. See corresponding entry in \code{\link{xyplot}} for non-trivial details. } } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \details{ \code{qqmath} produces Q-Q plots of the given sample against a theoretical distribution. The default behaviour of \code{qqmath} is different from the corresponding S-PLUS function, but is similar to \code{qqnorm}. See the entry for \code{f.value} for specifics. The implementation details are also different from S-PLUS. In particular, all the important calculations are done by the panel (and prepanel function) and not \code{qqmath} itself. In fact, both the arguments \code{distribution} and \code{f.value} are passed unchanged to the panel and prepanel function. This allows, among other things, display of grouped Q-Q plots, which are often useful. See the help page for \code{\link{panel.qqmath}} for further details. This and all other high level Trellis functions have several arguments in common. These are extensively documented only in the help page for \code{\link{xyplot}}, which should be consulted to learn more detailed usage. } \author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{xyplot}}, \code{\link{panel.qqmath}}, \code{\link{panel.qqmathline}}, \code{\link{prepanel.qqmathline}}, \code{\link{Lattice}}, \code{\link{quantile}} } \examples{ qqmath(~ rnorm(100), distribution = function(p) qt(p, df = 10)) qqmath(~ height | voice.part, aspect = "xy", data = singer, prepanel = prepanel.qqmathline, panel = function(x, ...) { panel.qqmathline(x, ...) panel.qqmath(x, ...) }) vp.comb <- factor(sapply(strsplit(as.character(singer$voice.part), split = " "), "[", 1), levels = c("Bass", "Tenor", "Alto", "Soprano")) vp.group <- factor(sapply(strsplit(as.character(singer$voice.part), split = " "), "[", 2)) qqmath(~ height | vp.comb, data = singer, groups = vp.group, auto.key = list(space = "right"), aspect = "xy", prepanel = prepanel.qqmathline, panel = function(x, ...) { panel.qqmathline(x, ...) panel.qqmath(x, ...) }) } \keyword{dplot} lattice/man/tmd.Rd0000644000176200001440000000731614576262623013551 0ustar liggesusers\name{B_09_tmd} \alias{tmd} \alias{tmd.formula} \alias{tmd.data.frame} \alias{tmd.trellis} \alias{prepanel.tmd.default} \alias{prepanel.tmd.qqmath} \alias{panel.tmd.default} \alias{panel.tmd.qqmath} \title{Tukey Mean-Difference Plot} \description{ \code{tmd} Creates Tukey Mean-Difference Plots from a trellis object returned by \code{xyplot}, \code{qq} or \code{qqmath}. The prepanel and panel functions are used as appropriate. The \code{formula} and \code{data.frame} methods for \code{tmd} are provided for convenience, and simply call \code{tmd} on the object created by the corresponding \code{xyplot} methods. } \usage{ tmd(object, \dots) \method{tmd}{trellis}(object, xlab = "mean", ylab = "difference", panel, prepanel, \dots) prepanel.tmd.qqmath(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, subscripts, \dots) panel.tmd.qqmath(x, f.value = NULL, distribution = qnorm, qtype = 7, groups = NULL, subscripts, \dots, identifier = "tmd") panel.tmd.default(x, y, groups = NULL, \dots, identifier = "tmd") prepanel.tmd.default(x, y, \dots) } \arguments{ \item{object}{ An object of class \code{"trellis"} returned by \code{xyplot}, \code{qq} or \code{qqmath}. } \item{xlab}{ x label} \item{ylab}{ y label} \item{panel}{ panel function to be used. See details below. } \item{prepanel}{ prepanel function. See details below. } \item{f.value, distribution, qtype}{see \code{\link{panel.qqmath}}. } \item{groups, subscripts}{see \code{\link{xyplot}}. } \item{x, y}{ data as passed to panel functions in original call. } \item{\dots}{ other arguments} \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ The Tukey Mean-difference plot is produced by modifying the (x,y) values of each panel as follows: the new coordinates are given by \code{x=(x+y)/2} and \code{y=y-x}, which are then plotted. The default panel function(s) add a reference line at \code{y=0} as well. \code{tmd} acts on the a \code{"trellis"} object, not on the actual plot this object would have produced. As such, it only uses the arguments supplied to the panel function in the original call, and completely ignores what the original panel function might have done with this data. \code{tmd} uses these panel arguments to set up its own scales (using its \code{prepanel} argument) and display (using \code{panel}). It is thus important to provide suitable prepanel and panel functions to \code{tmd} depending on the original call. Such functions currently exist for \code{xyplot}, \code{qq} (the ones with \code{default} in their name) and \code{qqmath}, as listed in the usage section above. These assume the default displays for the corresponding high-level call. If unspecified, the \code{prepanel} and \code{panel} arguments default to suitable choices. \code{tmd} uses the \code{update} method for \code{"trellis"} objects, which processes all extra arguments supplied to \code{tmd}. } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{qq}}, \code{\link{qqmath}}, \code{\link{xyplot}}, \code{\link{Lattice}} } \examples{ tmd(qqmath(~height | voice.part, data = singer)) } \keyword{dplot} lattice/man/panel.cloud.Rd0000644000176200001440000003542214413025460015152 0ustar liggesusers\name{F_1_panel.cloud} \alias{panel.cloud} \alias{panel.wireframe} \alias{panel.3dscatter} \alias{panel.3dwire} \alias{makeShadePalette} \title{ Default Panel Function for cloud } \description{ Default panel functions controlling \code{cloud} and \code{wireframe} displays. } \usage{ panel.cloud(x, y, subscripts, z, groups = NULL, perspective = TRUE, distance = if (perspective) 0.2 else 0, xlim, ylim, zlim, panel.3d.cloud = "panel.3dscatter", panel.3d.wireframe = "panel.3dwire", screen = list(z = 40, x = -60), R.mat = diag(4), aspect = c(1, 1), par.box = NULL, xlab, ylab, zlab, xlab.default, ylab.default, zlab.default, scales.3d, proportion = 0.6, wireframe = FALSE, scpos, \dots, at, identifier = "cloud") panel.wireframe(\dots) panel.3dscatter(x, y, z, rot.mat, distance, groups, type = "p", xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, zero.scaled, col, col.point, col.line, lty, lwd, cex, pch, fill, cross, \dots, .scale = FALSE, subscripts, identifier = "3dscatter") panel.3dwire(x, y, z, rot.mat = diag(4), distance, shade = FALSE, shade.colors.palette = trellis.par.get("shade.colors")$palette, light.source = c(0, 0, 1000), xlim, ylim, zlim, xlim.scaled, ylim.scaled, zlim.scaled, col = if (shade) "transparent" else "black", lty = 1, lwd = 1, alpha, col.groups = superpose.polygon$col, polynum = 100, \dots, .scale = FALSE, drape = FALSE, at, col.regions = regions$col, alpha.regions = regions$alpha, identifier = "3dwire") makeShadePalette(col.regions, \dots, min = 0.05, pref = 0.75) } \arguments{ \item{x, y, z}{ numeric (or possibly factors) vectors representing the data to be displayed. The interpretation depends on the context. For \code{panel.cloud} these are essentially the same as the data passed to the high level plot (except if \code{formula} was a matrix, the appropriate \code{x} and \code{y} vectors are generated). By the time they are passed to \code{panel.3dscatter} and \code{panel.3dwire}, they have been appropriately subsetted (using \code{subscripts}) and scaled (to lie inside a bounding box, usually the [-0.5, 0.5] cube). Further, for \code{panel.3dwire}, \code{x} and \code{y} are shorter than \code{z} and represent the sorted locations defining a rectangular grid. Also in this case, \code{z} may be a matrix if the display is grouped, with each column representing one surface. In \code{panel.cloud} (called from \code{wireframe}) and \code{panel.3dwire}, \code{x}, \code{y} and \code{z} could also be matrices (of the same dimension) when they represent a 3-D surface parametrized on a 2-D grid. } \item{subscripts}{ index specifying which points to draw. The same \code{x}, \code{y} and \code{z} values (representing the whole data) are passed to \code{panel.cloud} for each panel. \code{subscripts} specifies the subset of rows to be used for the particular panel. } \item{groups}{ specification of a grouping variable, passed down from the high level functions. } \item{perspective}{ logical, whether to plot a perspective view. Setting this to \code{FALSE} is equivalent to setting \code{distance} to 0 } \item{distance}{ numeric, between 0 and 1, controls amount of perspective. The distance of the viewing point from the origin (in the transformed coordinate system) is \code{1 / distance}. This is described in a little more detail in the documentation for \code{\link{cloud}} } \item{screen}{ A list determining the sequence of rotations to be applied to the data before being plotted. The initial position starts with the viewing point along the positive z-axis, and the x and y axes in the usual position. Each component of the list should be named one of \code{"x"}, \code{"y"} or \code{"z"} (repetitions are allowed), with their values indicating the amount of rotation about that axis in degrees. } \item{R.mat}{ initial rotation matrix in homogeneous coordinates, to be applied to the data before \code{screen} rotates the view further. } \item{par.box}{ graphical parameters for box, namely, col, lty and lwd. By default obtained from the parameter \code{box.3d}. } \item{xlim, ylim, zlim}{ limits for the respective axes. As with other lattice functions, these could each be a numeric 2-vector or a character vector indicating levels of a factor. } \item{panel.3d.cloud, panel.3d.wireframe}{ functions that draw the data-driven part of the plot (as opposed to the bounding box and scales) in \code{cloud} and \code{wireframe}. This function is called after the \sQuote{back} of the bounding box is drawn, but before the \sQuote{front} is drawn. Any user-defined custom display would probably want to change these functions. The intention is to pass as much information to this function as might be useful (not all of which are used by the defaults). In particular, these functions can expect arguments called \code{xlim}, \code{ylim}, \code{zlim} which give the bounding box ranges in the original data scale and \code{xlim.scaled}, \code{ylim.scaled}, \code{zlim.scaled} which give the bounding box ranges in the transformed scale. More arguments can be considered on request. } \item{aspect}{ aspect as in \code{cloud} } \item{xlab, ylab, zlab}{ Labels, have to be lists. Typically the user will not manipulate these, but instead control this via arguments to \code{cloud} directly. } \item{xlab.default}{ for internal use } \item{ylab.default}{ for internal use } \item{zlab.default}{ for internal use } \item{scales.3d}{ list defining the scales } \item{proportion}{ numeric scalar, gives the length of arrows as a proportion of the sides } \item{scpos}{ A list with three components x, y and z (each a scalar integer), describing which of the 12 sides of the cube the scales should be drawn. The defaults should be OK. Valid values are x: 1, 3, 9, 11; y: 8, 5, 7, 6 and z: 4, 2, 10, 12. (See comments in the source code of \code{panel.cloud} to see the details of this enumeration.) } \item{wireframe}{logical, indicating whether this is a wireframe plot} \item{drape}{ logical, whether the facets will be colored by height, in a manner similar to \code{levelplot}. This is ignored if \code{shade=TRUE}. } \item{at}{ When \code{drape = TRUE} in \code{\link{wireframe}}, the facets defining the surface are colored as a function of (average) height, similar to \code{\link{levelplot}}. \code{at} is a numeric vector giving the breakpoints along the z-axis where colors change. } \item{col.regions}{ vector of colors to be used in conjunction with \code{at} when \code{drape = TRUE}. In \code{makeShadePalette}, which can be used to define a shading palette (see below), \code{col.regions} is an initial vector defining the base color (as a function of height) that is then adjusted according to irradiance and reflectance. } \item{alpha.regions}{ numeric scalar controlling transparency when \code{drape = TRUE}. } \item{rot.mat}{ 4x4 transformation matrix in homogeneous coordinates. This gives the rotation matrix combining the \code{screen} and \code{R.mat} arguments to \code{\link{panel.cloud}} } \item{type}{ Character vector, specifying type of cloud plot. Can include one or more of \code{"p"}, \code{"l"}, \code{"h"} or \code{"b"}. \code{"p"} and \code{"l"} mean \sQuote{points} and \sQuote{lines} respectively, and \code{"b"} means \sQuote{both}. \code{"h"} stands for \sQuote{histogram}, and causes a line to be drawn from each point to the X-Y plane (i.e., the plane representing \code{z = 0}), or the lower (or upper) bounding box face, whichever is closer. } \item{xlim.scaled, ylim.scaled, zlim.scaled}{ axis limits (after being scaled to the bounding box) } \item{zero.scaled}{ z-axis location (after being scaled to the bounding box) of the X-Y plane in the original data scale, to which lines will be dropped (if within range) from each point when \code{type = "h"} } \item{cross}{ logical, defaults to \code{TRUE} if \code{pch = "+"}. \code{panel.3dscatter} can represent each point by a 3d \sQuote{cross} of sorts (it's much easier to understand looking at an example than from a description). This is different from the usual \code{pch} argument, and reflects the depth of the points and the orientation of the axes. This argument indicates whether this feature will be used. This is useful for two reasons. It can be set to \code{FALSE} to use \code{"+"} as the plotting character in the regular sense. It can also be used to force this feature in grouped displays. } \item{shade}{ logical, indicating whether the surface is to be colored using an illumination model with a single light source } \item{shade.colors.palette}{ a function (or the name of one) that is supposed to calculate the color of a facet when shading is being used. Three pieces of information are available to the function: first, the cosine of the angle between the incident light ray and the normal to the surface (representing foreshortening); second, the cosine of half the angle between the reflected ray and the viewing direction (useful for non-Lambertian surfaces); and third, the scaled (average) height of that particular facet with respect to the total plot z-axis limits. All three numbers should be between 0 and 1. The \code{shade.colors.palette} function should return a valid color. The default function is obtained from the trellis settings using \code{makeShadePalette}. } \item{min}{ numeric, between 0 and 1, giving a minimum saturation in \code{makeShadePalette} } \item{pref}{ numeric, giving a power that is applied to reflectance value before it is used to \sQuote{darken} the colors. } \item{light.source}{ a 3-vector representing (in cartesian coordinates) the light source. This is relative to the viewing point being (0, 0, 1/distance) (along the positive z-axis), keeping in mind that all observations are bounded within the [-0.5, 0.5] cube } \item{polynum}{ quadrilateral faces are drawn in batches of \code{polynum} at a time. Drawing too few at a time increases the total number of calls to the underlying \code{grid.polygon} function, which affects speed. Trying to draw too many at once may be unnecessarily memory intensive. This argument controls the trade-off. } \item{col.groups}{colors for different groups} \item{col, col.point, col.line, lty, lwd, cex, pch, fill, alpha}{ Graphical parameters. Some other arguments (such as \code{lex} for line width) may also be passed through the \code{\dots} argument. } \item{\dots}{ other parameters, passed down when appropriate} \item{.scale}{ Logical flag, indicating whether \code{x}, \code{y}, and \code{z} should be assumed to be in the original data scale and hence scaled before being plotted. \code{x}, \code{y}, and \code{z} are usually already scaled. However, setting \code{.scale=TRUE} may be helpful for calls to \code{panel.3dscatter} and \code{panel.3dwire} in user-supplied panel functions. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ These functions together are responsible for the content drawn inside each panel in \code{cloud} and \code{wireframe}. \code{panel.wireframe} is a wrapper to \code{panel.cloud}, which does the actual work. \code{panel.cloud} is responsible for drawing the content that does not depend on the data, namely, the bounding box, the arrows/scales, etc. At some point, depending on whether \code{wireframe} is TRUE, it calls either \code{panel.3d.wireframe} or \code{panel.3d.cloud}, which draws the data-driven part of the plot. The arguments accepted by these two functions are different, since they have essentially different purposes. For cloud, the data is unstructured, and \code{x}, \code{y} and \code{z} are all passed to the \code{panel.3d.cloud} function. For wireframe, on the other hand, \code{x} and \code{y} are increasing vectors with unique values, defining a rectangular grid. \code{z} must be a matrix with \code{length(x) * length(y)} rows, and as many columns as the number of groups. \code{panel.3dscatter} is the default \code{panel.3d.cloud} function. It has a \code{type} argument similar to \code{\link{panel.xyplot}}, and supports grouped displays. It tries to honour depth ordering, i.e., points and lines closer to the camera are drawn later, overplotting more distant ones. (Of course there is no absolute ordering for line segments, so an ad hoc ordering is used. There is no hidden point removal.) \code{panel.3dwire} is the default \code{panel.3d.wireframe} function. It calculates polygons corresponding to the facets one by one, but waits till it has collected information about \code{polynum} facets, and draws them all at once. This avoids the overhead of drawing \code{grid.polygon} repeatedly, speeding up the rendering considerably. If \code{shade = TRUE}, these attempt to color the surface as being illuminated from a light source at \code{light.source}. \code{palette.shade} is a simple function that provides the deafult shading colors Multiple surfaces are drawn if \code{groups} is non-null in the call to \code{wireframe}, however, the algorithm is not sophisticated enough to render intersecting surfaces correctly. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \examples{ wireframe(volcano, shade = TRUE, shade.colors.palette = makeShadePalette(hcl.colors(10, "Inferno"), pref = 0.2)) wireframe(volcano, shade = TRUE, shade.colors.palette = makeShadePalette(hcl.colors(10, "Dark Mint"), pref = 0.2)) wireframe(volcano, shade = TRUE, shade.colors.palette = makeShadePalette(hcl.colors(10, "Harmonic"), pref = 0.2)) } \seealso{\code{\link{cloud}}, \code{\link{utilities.3d}}} \keyword{dplot} lattice/man/panel.parallel.Rd0000644000176200001440000000544413070415115015637 0ustar liggesusers\name{F_1_panel.parallel} \alias{panel.parallel} \title{ Default Panel Function for parallel } \description{ This is the default panel function for \code{parallel}. } \usage{ panel.parallel(x, y, z, subscripts, groups = NULL, col, lwd, lty, alpha, common.scale = FALSE, lower, upper, \dots, horizontal.axis = TRUE, identifier = "parallel") } \arguments{ \item{x, y}{ dummy variables, ignored. } \item{z}{ The data frame used for the plot. Each column will be coerced to numeric before being plotted, and an error will be issued if this fails. } \item{subscripts}{ The indices of the rows of \code{z} that are to be displyed in this panel. } \item{groups}{ An optional grouping variable. If specified, different groups are distinguished by use of different graphical parameters (i.e., rows of \code{z} in the same group share parameters). } \item{col, lwd, lty, alpha}{ graphical parameters (defaults to the settings for \code{superpose.line}). If \code{groups} is non-null, these parameters used one for each group. Otherwise, they are recycled and used to distinguish between rows of the data frame \code{z}. } \item{common.scale}{ logical, whether a common scale should be used columns of \code{z}. Defaults to \code{FALSE}, in which case the horizontal range for each column is different (as determined by \code{lower} and \code{upper}). } \item{lower, upper}{ numeric vectors replicated to be as long as the number of columns in \code{z}. Determines the lower and upper bounds to be used for scaling the corresponding columns of \code{z} after coercing them to numeric. Defaults to the minimum and maximum of each column. Alternatively, these could be functions (to be applied on each column) that return a scalar. } \item{\dots}{ other arguments (ignored) } \item{horizontal.axis}{logical indicating whether the parallel axes should be laid out horizontally (\code{TRUE}) or vertically (\code{FALSE}). } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \details{ Produces parallel coordinate plots, which are easier to understand from an example than through a verbal description. See example for \code{\link{parallel}} } \references{ Inselberg, Alfred (2009) \emph{Parallel Coordinates: Visual Multidimensional Geometry and Its Applications}, Springer. ISBN: 978-0-387-21507-5. Inselberg, A. (1985) \dQuote{The Plane with Parallel Coordinates}, \emph{The Visual Computer}. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{parallel}}} \keyword{dplot} lattice/man/panel.densityplot.Rd0000644000176200001440000000631014413020055016407 0ustar liggesusers\name{F_1_panel.densityplot} \alias{panel.densityplot} \title{ Default Panel Function for densityplot } \description{ This is the default panel function for \code{\link{densityplot}}. } \usage{ panel.densityplot(x, darg, plot.points = "jitter", ref = FALSE, groups = NULL, weights = NULL, jitter.amount, type, \dots, grid = lattice.getOption("default.args")$grid, identifier = "density") } \arguments{ \item{x}{ data points for which density is to be estimated } \item{darg}{ list of arguments to be passed to the \code{\link{density}} function. Typically, this should be a list with zero or more of the following components : \code{bw}, \code{adjust}, \code{kernel}, \code{window}, \code{width}, \code{give.Rkern}, \code{n}, \code{from}, \code{to}, \code{cut}, \code{na.rm} (see \code{\link{density}} for details) } \item{plot.points}{ logical specifying whether or not the data points should be plotted along with the estimated density. Alternatively, a character string specifying how the points should be plotted. Meaningful values are \code{"rug"}, in which case \code{\link{panel.rug}} is used to plot a \sQuote{rug}, and \code{"jitter"}, in which case the points are jittered vertically to better distinguish overlapping points. } \item{ref}{ logical, whether to draw x-axis } \item{groups}{ an optional grouping variable. If present, \code{\link{panel.superpose}} will be used instead to display each subgroup } \item{weights}{ numeric vector of weights for the density calculations. If this is specified, the \code{\dots} part must also include a \code{subscripts} argument that matches the weights to \code{x}. } \item{jitter.amount}{ when \code{plot.points="jitter"}, the value to use as the \code{amount} argument to \code{\link{jitter}}. } \item{type}{\code{type} argument used to plot points, if requested. This is not expected to be useful, it is available mostly to protect a \code{type} argument, if specified, from affecting the density curve. } \item{\dots}{ extra graphical parameters. Note that additional arguments to \code{\link{panel.rug}} cannot be passed on through \code{panel.densityplot}. } \item{grid}{ A logical flag, character string, or list specifying whether and how a background grid should be drawn. In its general form, \code{grid} can be a list of arguments to be supplied to \code{\link{panel.grid}}, which is called with those arguments. Three shortcuts are available: \describe{ \item{\code{TRUE}:}{ roughly equivalent to \code{list(h = -1, v = -1)} } \item{\code{"h"}:}{ roughly equivalent to \code{list(h = -1, v = 0)} } \item{\code{"v"}:}{ roughly equivalent to \code{list(h = 0, v = -1)} } } No grid is drawn if \code{grid = FALSE}. } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{ \code{\link{densityplot}}, \code{\link{jitter}} } \keyword{dplot} lattice/man/panel.histogram.Rd0000644000176200001440000000243313070415115016033 0ustar liggesusers\name{F_1_panel.histogram} \alias{panel.histogram} \title{ Default Panel Function for histogram } \description{ This is the default panel function for \code{histogram}. } \usage{ panel.histogram(x, breaks, equal.widths = TRUE, type = "density", nint = round(log2(length(x)) + 1), alpha, col, border, lty, lwd, \dots, identifier = "histogram") } \arguments{ \item{x}{ The data points for which the histogram is to be drawn} \item{breaks}{ The breakpoints for the histogram} \item{equal.widths}{ logical used when \code{breaks==NULL} } \item{type}{ Type of histogram, possible values being \code{"percent"}, \code{"density"} and \code{"count"}} \item{nint}{ Number of bins for the histogram } \item{alpha, col, border, lty, lwd}{ graphical parameters for bars; defaults are obtained from the \code{plot.polygon} settings. } \item{\dots}{ other arguments, passed to \code{\link{hist}} when deemed appropriate } \item{identifier}{ A character string that is prepended to the names of grobs that are created by this panel function. } } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{histogram}}} \keyword{dplot} lattice/man/rfs.Rd0000644000176200001440000000252513070415115013534 0ustar liggesusers\name{B_10_rfs} \alias{rfs} \title{ Residual and Fit Spread Plots} \description{ Plots fitted values and residuals (via qqmath) on a common scale for any object that has methods for fitted values and residuals. } \usage{ rfs(model, layout=c(2, 1), xlab="f-value", ylab=NULL, distribution = qunif, panel, prepanel, strip, \dots) } \arguments{ \item{model}{a fitted model object with methods \code{fitted.values} and \code{residuals}. Can be the value returned by \code{oneway} } \item{layout}{default layout is c(2,1) } \item{xlab}{defaults to \code{"f.value"} } \item{distribution}{the distribution function to be used for \code{qqmath}} \item{ylab, panel, prepanel, strip}{ See \code{\link{xyplot}} } \item{\dots}{ other arguments, passed on to \code{\link{qqmath}}. } } \value{ An object of class \code{"trellis"}. The \code{\link[lattice:update.trellis]{update}} method can be used to update components of the object and the \code{\link[lattice:print.trellis]{print}} method (usually called by default) will plot it on an appropriate plotting device. } \author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}} \seealso{\code{\link{oneway}}, \code{\link{qqmath}}, \code{\link{xyplot}}, \code{\link{Lattice}} } \examples{ rfs(oneway(height ~ voice.part, data = singer, spread = 1), aspect = 1) } \keyword{dplot} lattice/DESCRIPTION0000644000176200001440000000432214773255122013416 0ustar liggesusersPackage: lattice Version: 0.22-7 Date: 2025-03-31 Priority: recommended Title: Trellis Graphics for R Authors@R: c(person("Deepayan", "Sarkar", role = c("aut", "cre"), email = "deepayan.sarkar@r-project.org", comment = c(ORCID = "0000-0003-4107-1553")), person("Felix", "Andrews", role = "ctb"), person("Kevin", "Wright", role = "ctb", comment = "documentation"), person("Neil", "Klepeis", role = "ctb"), person("Johan", "Larsson", role = "ctb", comment = "miscellaneous improvements"), person("Zhijian (Jason)", "Wen", role = "cph", comment = "filled contour code"), person("Paul", "Murrell", role = "ctb", email = "paul@stat.auckland.ac.nz"), person("Stefan", "Eng", role = "ctb", comment = "violin plot improvements"), person("Achim", "Zeileis", role = "ctb", comment = "modern colors"), person("Alexandre", "Courtiol", role = "ctb", comment = "generics for larrows, lpolygon, lrect and lsegments") ) Description: A powerful and elegant high-level data visualization system inspired by Trellis graphics, with an emphasis on multivariate data. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. See ?Lattice for an introduction. Depends: R (>= 4.0.0) Suggests: KernSmooth, MASS, latticeExtra, colorspace Imports: grid, grDevices, graphics, stats, utils Enhances: chron, zoo LazyLoad: yes LazyData: yes License: GPL (>= 2) URL: https://lattice.r-forge.r-project.org/ BugReports: https://github.com/deepayan/lattice/issues NeedsCompilation: yes Packaged: 2025-04-02 04:55:57 UTC; deepayan Author: Deepayan Sarkar [aut, cre] (), Felix Andrews [ctb], Kevin Wright [ctb] (documentation), Neil Klepeis [ctb], Johan Larsson [ctb] (miscellaneous improvements), Zhijian (Jason) Wen [cph] (filled contour code), Paul Murrell [ctb], Stefan Eng [ctb] (violin plot improvements), Achim Zeileis [ctb] (modern colors), Alexandre Courtiol [ctb] (generics for larrows, lpolygon, lrect and lsegments) Maintainer: Deepayan Sarkar Repository: CRAN Date/Publication: 2025-04-02 15:40:02 UTC lattice/GPL-30000644000176200001440000010451313070415115012405 0ustar liggesusers GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .