scale_x_mergelist: Merge list columns into character vectors

View source: R/scale_upset.R

scale_x_mergelistR Documentation

Merge list columns into character vectors

Description

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.

Usage

scale_x_mergelist(sep = "-", ..., position = "bottom")

Arguments

sep

String the is used to delimit the elements in each list entry. Default: "-".

...

additional arguments that are passed on to ggplot2::scale_x_discrete

position

either "top" or "bottom" to specify where the x axis drawn. Default: "bottom"

See Also

discrete_scale

Examples

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))



ggupset documentation built on June 24, 2024, 5:08 p.m.