Description Usage Arguments Value Examples
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.
1 |
data |
Numerical vector of counts, Named or otherwise or data.frame with a name column and a count column. |
Tidy tibble ready to be used with geom_bar()
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.