# NOT RUN {
# for reproducibility
set.seed(123)
# simplest possible call with the defaults
PlotXTabs2(
data = mtcars,
y = vs,
x = cyl
)
# more complex call
PlotXTabs2(
data = datasets::mtcars,
y = vs,
x = cyl,
bf.details = TRUE,
labels.legend = c("0 = V-shaped", "1 = straight"),
legend.title = "Engine Style",
legend.position = "right",
title = "The perenial mtcars example",
palette = "Pastel1"
)
PlotXTabs2(
data = as.data.frame(HairEyeColor),
y = Eye,
x = Hair,
counts = Freq
)
# }
# NOT RUN {
# mosaic plot requires ggmosaic 0.2.2 or higher from github
PlotXTabs2(
data = mtcars,
x = vs,
y = am,
plottype = "mosaic",
data.label = "both",
mosaic.alpha = .9,
bf.display = "support",
title = "Motorcars Mosaic Plot VS by AM"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab