A lightweight (and reasonably efficient) alternative to the UpSetR package. These plots allow visualisation of an arbitrary number of set interactions (see http://doi.org/gbjxr9).

agitated(
  x,
  nsets = 20,
  exclusive = TRUE,
  intersection_order = c("frequency", "degree"),
  sort_sets = TRUE,
  title = NULL,
  subtitle = NULL,
  return_plots = FALSE
)

Arguments

x

A list or presence/absence matrix.

nsets

Numeric scalar specifying the maximum number of sets to be shown.

exclusive

Logical scalar controlling whether the intersections should be exclusive.

intersection_order

Character scalar controlling whether sorting of intersections is done by "frequency" (size of intersection) or "degree" (number of intersecting sets).

sort_sets

Logical scalar controlling whether the input sets are re-ordered based on descending size.

title, subtitle

Character scalars specifying plot title and subtitle.

return_plots

Logical scalar specifying whether the ggplot2 objects should be returned directly (TRUE) or if plot_grid should be called on these objects instead.

Value

If return_plots = TRUE, the function returns a list of three ggplot2 objects. If return_plots = TRUE, the function calls plot_grid on the plot objects.

agitated functions

agitated: produce an upset plot

References

UpSetR: an R package for the visualization of intersecting sets and their properties Jake R Conway, Alexander Lex, Nils Gehlenborg <doi:10.1093/bioinformatics/btx364>.

Examples

data <- agitated:::example_data() agitated(data)
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.
agitated(data, nsets = 10)
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.
agitated(data, exclusive = FALSE)
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.
agitated(data, intersection_order = "degree")
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.
agitated(data, sort_sets = FALSE)
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.
agitated(data, title = "title", subtitle = "subtitle")
#> Warning: It is deprecated to specify `guide = FALSE` to remove a guide. Please use `guide = "none"` instead.