jolars / eulerr

Area-Proportional Euler and Venn Diagrams with Ellipses
https://jolars.github.io/eulerr/
GNU General Public License v3.0
130 stars 18 forks source link

Dataframe input no longer working #42

Closed ImagingCore closed 5 years ago

ImagingCore commented 5 years ago

I have been using EulerR 4.1.0 with data frame input with variables looking something this:

Apple Banana Orange 1 0 1 0 1 0 0 0 1 1 1 0

Unfortunately, this doesn't seem to be compatible with the most recent EulerR 5.0.0 version. Would it be possible to preserve this original input format? I've tried other work arounds, but it gets pretty ugly. I'm not an R master, so I wouldn't be surprised if I'm missing something here. Any advice would be much appreciated.

Many thanks!

jolars commented 5 years ago

Thanks for catching this. This is a bug. In the meanwhile, you can get around it by doing

d <- data.frame(Apple = c(1, 0, 0, 1), 
                Banana = c(0, 1, 0, 1),
                Orange = c(1, 0, 1, 0))
d <- as.matrix(d)
mode(d) <- "logical"
plot(euler(d))
ImagingCore commented 5 years ago

Thanks!!