gaospecial / ggVennDiagram

A 'ggplot2' implement of Venn Diagram.
https://gaospecial.github.io/ggVennDiagram/
GNU General Public License v3.0
284 stars 38 forks source link

How can I get the full list of elements per overlap subset? #52

Closed vertesy closed 1 year ago

vertesy commented 1 year ago

Hey, thanks for the great package.

I am curious to know if there is a simple method to get a list of elements in each subset of your venn diagrams?

Similar in gplots::venn:

xx.1 <- list(A = sort(sample(LETTERS, 15)),
             B = sort(sample(LETTERS, 15)),
             C = sort(sample(LETTERS, 15)),
             D = sort(sample(LETTERS, 15)))

ItemsList <- gplots::venn(xx.1, show.plot = FALSE)
lengths(attributes(ItemsList)$intersections)
attributes(ItemsList)$intersections

resulting in

> attributes(ItemsList)$intersections
$A
[1] "C"

$B
[1] "D" "Q"

$C
[1] "B"

$D
[1] "V"

$`A:B`
[1] "N"

$`A:C`
[1] "E" "W"

If so, u may want to share also at:

https://stackoverflow.com/questions/65898472/how-to-obtain-the-list-of-elements-from-a-venn-diagram https://stackoverflow.com/questions/23559371/get-the-list-of-items-in-venn-diagram

Thanks for your time!

gaospecial commented 1 year ago

I believe this topic has been talked in #5 .

If you have further question, just reply in this issue.

vertesy commented 1 year ago

Ok, thank you!