For all examples the movies data set contained in the package will be used.

library(UpSetR)
library(ggplot2)
library(grid)
library(plyr)
movies <- read.csv(system.file("extdata", "movies.csv", package = "UpSetR"), 
    header = T, sep = ";")


attribute.plots Parameter Breakdown

The attribute.plots parameter is broken down into 3 fields: gridrows, plots, and ncols

Additional: to add a legend of the queries, use query.legend = "bottom" (see Example 2).


Example 1: Built-In Attribute Histogram

Example of how to add built-in histogram attribute plot. If main.bar.color is not specified as black, elements contained in black intersection size bars will be represented as gray in attribute plots.

upset(movies, main.bar.color = "black", queries = list(list(query = intersects, 
    params = list("Drama"), active = T)), attribute.plots = list(gridrows = 50, 
    plots = list(list(plot = histogram, x = "ReleaseDate", queries = F), list(plot = histogram, 
        x = "AvgRating", queries = T)), ncols = 2))


Example 2: Built-In Attribute Scatter Plot

Example of how to add built-in attribute scatter plot. If main.bar.color not specified as black, elements contained in black intersection size bars will be represented as gray in attribute plots.

notice the use of query.legend

upset(movies, main.bar.color = "black", queries = list(list(query = intersects, 
    params = list("Drama"), color = "red", active = F), list(query = intersects, 
    params = list("Action", "Drama"), active = T), list(query = intersects, 
    params = list("Drama", "Comedy", "Action"), color = "orange", active = T)), 
    attribute.plots = list(gridrows = 45, plots = list(list(plot = scatter_plot, 
        x = "ReleaseDate", y = "AvgRating", queries = T), list(plot = scatter_plot, 
        x = "AvgRating", y = "Watches", queries = F)), ncols = 2), query.legend = "bottom")