23 |
dimx <- dim(x) |
dimx <- dim(x) |
24 |
stopifnot(inherits(x, "trellis")) |
stopifnot(inherits(x, "trellis")) |
25 |
stopifnot(length(dimx) == 2) |
stopifnot(length(dimx) == 2) |
26 |
|
as.table <- x$as.table |
27 |
|
|
28 |
opar <- if (is.null(x$par.settings)) list() else x$par.settings |
opar <- if (is.null(x$par.settings)) list() else x$par.settings |
29 |
par.settings <- |
par.settings <- |
30 |
modifyList(opar, |
modifyList(opar, |
31 |
list(layout.heights = |
list(layout.heights = |
32 |
if (x$as.table) list(strip = c(strip.lines, rep(0, dimx[2]-1))) |
if (as.table) list(strip = c(strip.lines, rep(0, dimx[2]-1))) |
33 |
else list(strip = c(rep(0, dimx[2]-1), strip.lines)), |
else list(strip = c(rep(0, dimx[2]-1), strip.lines)), |
34 |
layout.widths = |
layout.widths = |
35 |
list(strip.left = c(strip.left.lines, rep(0, dimx[1]-1))))) |
list(strip.left = c(strip.left.lines, rep(0, dimx[1]-1))))) |
41 |
if (is.function(strip)) |
if (is.function(strip)) |
42 |
{ |
{ |
43 |
function(which.given, which.panel, var.name, ...) { |
function(which.given, which.panel, var.name, ...) { |
44 |
if (which.given == 1) |
row.to.keep <- if (as.table) 1 else nrow(trellis.currentLayout()) |
45 |
|
if (which.given == 1 && current.row() == row.to.keep) |
46 |
strip(which.given = 1, |
strip(which.given = 1, |
47 |
which.panel = which.panel[1], |
which.panel = which.panel[1], |
48 |
var.name = var.name[1], |
var.name = var.name[1], |
49 |
...) |
...) |
50 |
} |
} |
51 |
} |
} |
52 |
else strip |
else strip # This could reasonable happen only if strip == FALSE |
53 |
if (is.character(strip.left)) |
if (is.character(strip.left)) |
54 |
strip.left <- get(strip.left) |
strip.left <- get(strip.left) |
55 |
if (is.logical(strip.left) && strip.left) |
if (is.logical(strip.left) && strip.left) |
58 |
if (is.function(strip.left)) |
if (is.function(strip.left)) |
59 |
{ |
{ |
60 |
function(which.given, which.panel, var.name, ...) { |
function(which.given, which.panel, var.name, ...) { |
61 |
if (which.given == 2) |
if (which.given == 2 && current.column() == 1) |
62 |
strip.left(which.given = 1, |
strip.left(which.given = 1, |
63 |
which.panel = which.panel[2], |
which.panel = which.panel[2], |
64 |
var.name = var.name[2], |
var.name = var.name[2], |