upset | R Documentation |
Add an upset panel to an existing plot.
upset(
x,
xat = NULL,
yat = NULL,
col = c("black", "white"),
labels.x = NULL,
labels.y = rownames(x),
col.na = "grey75",
col.rect = c("grey95", "transparent"),
fullrange = FALSE
)
x |
a numeric or integer matrix, coerced to binary with 0s and
|
xat, yat |
the x- and y-coordinates for the columns and rows of
|
col |
the colors for |
labels.x, labels.y |
(optional) labels for the columns and rows |
col.na, col.rect |
colors for background placeholder points and
bars for each row of |
fullrange |
logical; if |
x <- t(mtcars[, c('cyl', 'vs', 'am', 'gear')])
y <- t(!!mtcars[, c('cyl', 'vs', 'am')])
op <- par(mar = c(9, 5, 4, 1), las = 1L)
bp <- barplot(x, col = 2:5, axisnames = FALSE)
text(bp, -4, colnames(x), srt = 45, xpd = NA, adj = 1)
box(bty = 'u')
yat <- seq(1, 3, length.out = nrow(y))
upset(y, xat = bp, yat = -yat, col.na = NA, fullrange = TRUE)
upset(y, xat = bp, yat = par('usr')[4L] + yat, col.rect = adjustcolor(2:4, 0.5))
par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.