scale_x_mergelist | R Documentation |
The function handles list columns by collapsing them into delimited strings
using the sep
argument. This is useful to show sets and in combination
with the axis_combmatrix()
function.
scale_x_mergelist(sep = "-", ..., position = "bottom")
sep |
String the is used to delimit the elements in each list entry. Default: "-". |
... |
additional arguments that are passed on to
|
position |
either "top" or "bottom" to specify where the x axis drawn. Default: "bottom" |
discrete_scale
library(ggplot2)
ggplot(tidy_movies[1:100, ], aes(x=Genres)) +
geom_bar() +
scale_x_mergelist() +
theme(axis.text.x = element_text(angle = 90, hjust=1, vjust = 0.5))
ggplot(tidy_movies[1:100, ], aes(x=Genres)) +
geom_bar() +
scale_x_mergelist(sep = " & ", name = "Merged Movie Genres", position = "top") +
theme(axis.text.x = element_text(angle = 90, hjust=0, vjust = 0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.