Description Usage Arguments Value Examples
Plots (extended) mosaic displays via mosaic
.
The last response variable is highlighted.
A high-dimensional contingency table is calculated via structable
from the given dataset.
Flat contingency table splits predictors horizontally and optional responses vertically.
1 2 3 4 5 6 7 | mosaicPlot(
dataset = cs.in.dataset(),
preds = cs.in.predictors(),
resps = cs.in.responses(),
return.results = FALSE,
...
)
|
dataset |
[ |
preds |
[ |
resps |
[ |
return.results |
[ |
... |
[ANY] |
Logical [TRUE
] invisibly and outputs to Cornerstone or,
if return.results = TRUE
, list
of
resulting data.frame
objects:
long.contingency |
Contingency table in long format. |
1 2 3 4 | # Draw mosaic plot from 'titanic' data:
mosaicPlot(titanic, c("Class", "Age", "Sex", "Survived"))
res = mosaicPlot(titanic, c("Class", "Age"), c("Sex", "Survived"), return.results = TRUE)
print(res)
|
$long.contingency
Class Age Sex Survived Freq
1: 1st Adult Female No 4
2: 2nd Adult Female No 13
3: 3rd Adult Female No 89
4: Crew Adult Female No 3
5: 1st Child Female No 0
6: 2nd Child Female No 0
7: 3rd Child Female No 17
8: Crew Child Female No 0
9: 1st Adult Male No 118
10: 2nd Adult Male No 154
11: 3rd Adult Male No 387
12: Crew Adult Male No 670
13: 1st Child Male No 0
14: 2nd Child Male No 0
15: 3rd Child Male No 35
16: Crew Child Male No 0
17: 1st Adult Female Yes 140
18: 2nd Adult Female Yes 80
19: 3rd Adult Female Yes 76
20: Crew Adult Female Yes 20
21: 1st Child Female Yes 1
22: 2nd Child Female Yes 13
23: 3rd Child Female Yes 14
24: Crew Child Female Yes 0
25: 1st Adult Male Yes 57
26: 2nd Adult Male Yes 14
27: 3rd Adult Male Yes 75
28: Crew Adult Male Yes 192
29: 1st Child Male Yes 5
30: 2nd Child Male Yes 11
31: 3rd Child Male Yes 13
32: Crew Child Male Yes 0
Class Age Sex Survived Freq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.