Examples for 'GGally::ggally_crosstable'


Display a cross-tabulated table

Aliases: ggally_crosstable

Keywords:

### ** Examples

# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive

data(tips, package = "reshape")

# differences with ggally_table()
p_(ggally_table(tips, mapping = aes(x = day, y = time)))
plot of chunk example-GGally-ggally_crosstable-1
p_(ggally_crosstable(tips, mapping = aes(x = day, y = time)))
plot of chunk example-GGally-ggally_crosstable-1
# display column proportions
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "col.prop"))
plot of chunk example-GGally-ggally_crosstable-1
# display row proportions
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), cells = "row.prop"))
plot of chunk example-GGally-ggally_crosstable-1
# change size of text
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), size = 8))
plot of chunk example-GGally-ggally_crosstable-1
# fill cells with standardized residuals
p_(ggally_crosstable(tips, mapping = aes(x = day, y = sex), fill = "std.resid"))
plot of chunk example-GGally-ggally_crosstable-1
# 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))
Scale for 'fill' is already present. Adding another scale for 'fill', which
will replace the existing scale.
plot of chunk example-GGally-ggally_crosstable-1

[Package GGally version 2.1.2 Index]