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1, 1, 0, 0, 1, 1,
0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1)),
row.names = c(NA, -111L),
class = c("data.frame")
)
f <- eulerr::euler(d)
f
#> original fitted residuals regionError
#> V1 8 8 0 0.001
#> V2 1 1 0 0.000
#> V3 28 28 0 0.003
#> V1&V2 1 0 1 0.011
#> V1&V3 44 44 0 0.005
#> V2&V3 4 4 0 0.000
#> V1&V2&V3 6 6 0 0.001
#>
#> diagError: 0.011
#> stress: 0
V1&V2
is not in the fit, so it cannot be plotted. eulerr::euler(d, shape = "ellipse")
will likely give you an exact fit.
Thanks so much for explaining this and excuse my ignorance. Very useful!
Hello Johan. Thanks so much for writing eulerr. Very useful! I was hoping that you can help with the following issue. I'm quite new to R and github so please correct me if I place this wrongly and don't hesitate to contact me if you need more information.
Data x.xlsx
Code fit2 <- euler(x) plot(fit2 ,quantities = TRUE,)
Result Rplot.pdf
If I build the sum of the quantities in the Plot I get: V1: sum 58 instead of 59 V2: sum 11 instead of 12
What am I doing wrong? Thanks so much. Tobi