Description Usage Arguments Value Examples
Using a list of sets, construct a data.frame with the correct
format for geom_venn
.
1 | prepare_venn(l, ...)
|
l |
|
... |
Name-value pairs and other arguments to be passed to
|
Returns a data.frame
with length(l)
rows and at least three
essential columns: column 1 is set_name
with the names of each set,
column 2 is elements
contains the elements in each set, column 3 is
count
which defines the smallest and the largest set overlap which is
used for the legend limits in geom_venn(type = 'continuous')
. Any additional
columns are added afterward.
1 2 3 4 5 6 7 8 9 10 11 12 13 | lst <- list(
set1 = c(1:3),
set2 = c(3:20),
set3 = c(1, 20:66)
)
# Add an additional column called 'fill'
vd <- prepare_venn(lst, fill = c("blue", "red", "green"))
# Plot a Venn diagram
ggplot() +
geom_venn(aes(set_name = set_name, elements = elements, fill = fill), data = vd) +
scale_fill_identity()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.