euler graphics with 3 groups: problems
Opened this issue · 3 comments
There is an issue for the graphics of 3 groups with common "people"
The first coding herebelow produces the A&B (260 shown in the graphics, instead of 50 in the coding) to be smaller than the B&C (50 shown in the graphics instead of 260 in the coding)
V2<- euler(c("A" = 10000, # RACL
"B" = 1000, # RACD
"C" = 100, # RAAP
"B&C" = 250+10,
"A&C" = 30+10,
"A&B" = 40+10, # le nombre commun a deux groupes
"A&B&C" = 15)) # le nombre commun à 3 groupes
plot(V2, shape="circle",
fills=c("red3", "salmon1", "red"),
edges=list(col="blue"),
legend=list(labels=c("A", "B 2023", "C")),
labels= c("A","B", "C"),
quantities = c("A" = 10000,
"B" = 1000,
"C" = 100,
"B&C" = 260, # ???????
"A&C" = 30,
"A&B" = 50, # ?????
"A&B&C" = 15))
To solve the issue I had to invert ( in the coding of the plot) A&B and B&C, i,e: A&B is now 60 in the coding and 250 in the plot and bigger than B&C which is now 250 in the coding and 50 in the plot
fitcot2023<- euler(c("A" = 10000, # RACL
"B" = 1000, # RACD
"C" = 100, # RAAP
"B&C" = 50+15,
"A&C" = 30+15,
"A&B" = 250+15, # le nombre commun a deux groupes
"A&B&C" = 15)) # le nombre commun à 3 groupes
plot(fitcot2023, shape="circle",
fills=c("red3", "salmon1", "red"),
edges=list(col="blue"),
legend=list(labels=c("A", "B", "C")),
labels= c("A","B", "C"),
quantities = c("A" = 10000,
"B" = 1000,
"C" = 100,
"B&C" = 250, # ???????
"A&C" = 30,
"A&B" = 50, # ?????
"A&B&C" = 15))
Ah, I understand that this tripped you up, but actually the names you give the vector in your input to quantities
has no effect, only the ordering has, and it assumes that you order the input same as in the output. Maybe it would be a good idea to allow a named vector actually. Anyway, it seems like you just want to print out the original quantities, so why not just use plot(V2, quantities = TRUE)
? Or maybe I'm misunderstanding.
Also, note that shape
has no effect in the call to plot()
here.
Great! I'll keep this open since I think the interface could be improved here.