ggtetris_tidy: Tidy ggtetris inputs to regular ggplot usage

Description Usage Arguments Value Examples

Description

transforms (named) vector of counts or data.frames with names and counts to tidy data.frames. If names are not provided for all counts in the vector, will they be set to capital letters.

Usage

1

Arguments

data

Numerical vector of counts, Named or otherwise or data.frame with a name column and a count column.

Value

Tidy tibble ready to be used with geom_bar().

Examples

1
2
3
4
5
6
7
8
vec <- rep(5, 10)
ggtetris_tidy(vec)

vec_named <- c('AA' = 20, 'BB' = 10, 'CC' = 15)
ggtetris_tidy(vec_named)

data <- data.frame(names = letters[1:4], vals = c(80, 30, 20, 10))
ggtetris_tidy(data)

EmilHvitfeldt/ggtetris documentation built on May 29, 2019, 2:48 p.m.