1 | sampler(n = 24)
|
n |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (n = 24)
{
old.par <- par(ask = T)
on.exit(par(old.par))
require(lattice)
y <- 0:n
x <- 0:n
print(xyplot(y ~ x, type = "n", xlab = "lty", ylab = "col",
panel = function(x, y, ...) {
for (i in x) {
panel.xyplot(c(i, i), range(y), type = "l", lty = i,
col = 1, lwd = 3)
}
for (i in y) {
for (j in seq(0, 0.9, by = 0.1)) {
panel.xyplot(c(min(x) + j * (max(x) - min(x)),
min(x) + (j + 0.1) * (max(x) - min(x))),
c(i, i), type = "l", lty = 1, col = i, lwd = 3)
}
}
}))
spl <- trellis.par.get("superpose.line")
z <- expand.grid(y = 1:length(spl$lty), x = 0:2)
print(xyplot(y ~ x, z, ylim = c(0, length(spl$lty)), groups = y,
type = "b", main = "superpose.line and .symbol"))
y <- 10 * (0:25)
x <- 0:9
print(xyplot(y ~ x, type = "n", main = "pch", xlab = expression(~alpha +
beta + gamma + delta[epsilon] + zeta^eta + theta + iota +
kappa), ylab = expression(~lambda + mu + nu + xi + omicron +
pi + rho + sigma + tau + upsilon + phi + chi + psi +
omega), panel = function(x, y, ...) {
for (i in x) {
for (j in y) {
panel.xyplot(i, j, pch = i + j, cex = 2)
}
}
}))
invisible(0)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.