## S3 method for class 'table':
pairs(x, upper_panel = pairs_mosaic, upper_panel_args = list(),
lower_panel = pairs_mosaic, lower_panel_args = list(),
diag_panel = pairs_diagonal_mosaic, diag_panel_args = list(),
main = NULL, sub = NULL, main_gp = gpar(fontsize = 20),
sub_gp = gpar(fontsize = 15), space = 0.3,
newpage = TRUE, pop = TRUE, return_grob = FALSE,
margins = unit(1, "lines"), ...)dimnames(x) attribute.NULL, no panel is drawn.NULL, no panel is drawn.NULL, no panel is drawn.main is a logical and TRUE, the
name of the object supplied as x is used.sub is a logical and TRUE and main is unspecified, the
name of the object supplied as x is used."gpar" containing the graphical
parameters used for the main (sub) title, if specified."unit" of length 4, or
a numeric vector of length 4. The elements are recycled as needed.
The four components specify the top, right,
bottom, and left margin of the plot, respectively.
When a numeric pairs method for objects inheriting
from class "table" or "structable".
It plots a matrix of pairwise mosaic plots.
Four independence types are distinguished: "pairwise",
"total", "conditional" and "joint".
The pairwise mosaic matrix shows bivariate marginal relations,
collapsed over all other variables.
The total independence mosaic matrix shows mosaic plots for mutual
independence, i.e., for marginal and conditional independence among
all pairs of variables.
The conditional independence mosaic matrix shows mosaic plots for
conditional independence for each pair of variables, given all other variables.
The joint independence mosaic matrix shows mosaic plots for joint
independence of all pairs of variables from the others. This method uses panel functions called for each cell of the
matrix which can be different for upper matrix, lower matrix, and
diagonal cells. Correspondingly, for each panel parameter foo
(= upper, lower, or diag), pairs.table takes
two arguments: foo_panel and foo_panel_args, which can
be used to specify the parameters as follows:
"panel_generator") tofoo_panel, along with parameters passed tofoo_panel_args, that generates such a function. Friendly, M. (1992),
Graphical methods for categorical data.
SAS User Group International Conference Proceedings, 17,
190--200.
Meyer, D., Zeileis, A., and Hornik, K. (2006),
The strucplot framework: Visualizing multi-way contingency tables with
vignette("strucplot").
pairs_mosaic,
pairs_assoc,
pairs_sieve,
pairs_diagonal_text,
pairs_diagonal_mosaic,
pairs_text,
pairs_barplot,
assoc,
sieve,
mosaicdata("UCBAdmissions")
data("PreSex")
data(HairEyeColor)
hec = structable(Eye ~ Sex + Hair, data = HairEyeColor)
pairs(PreSex)
pairs(UCBAdmissions)
pairs(UCBAdmissions, upper_panel_args = list(shade = TRUE))
pairs(UCBAdmissions, lower_panel = pairs_mosaic(type = "conditional"))
pairs(UCBAdmissions, diag_panel = pairs_text)
pairs(UCBAdmissions, upper_panel = pairs_assoc, shade = TRUE)
pairs(hec, highlighting = 2, diag_panel_args = list(fill = grey.colors))
pairs(hec, highlighting = 2, diag_panel = pairs_diagonal_mosaic,
diag_panel_args = list(fill = grey.colors, alternate_labels =TRUE))Run the code above in your browser using DataLab