# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
data(tips)
# differences with ggally_table()
p_(ggally_table(tips, mapping = aes(x = day, y = time)))
p_(ggally_crosstable(tips, mapping = aes(x = day, y = time)))
# display column proportions
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop"))
# display row proportions
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop"))
# change size of text
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8))
# fill cells with standardized residuals
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "std.resid"))
# change scale for fill
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "std.resid") +
scale_fill_steps2(breaks = c(-2, 0, 2), show.limits = TRUE))
Run the code above in your browser using DataLab