I'm trying to create a Venn Diagram in R to show whether certain tests on different machines are performed for all participants. In other words, I'm interested to see if certain tests for participants are performed on all three, two, one or none of the machines.
Here is an example of the data:
dat <- data.frame(id=1:30,
machine1 = sample(0:7, 30, replace =T),
machine2 = sample(0:3, 30, replace =T),
machine3 = sample(0:6, 30, replace =T))
These machine columns are sums of original columns for different tests. I have omitted those, but if easier they can be created with: machine1test1 = sample(0:1, 30, replace = T) etcetera
So, if a participant had 2 tests on machine 1 and 3 tests on machine 2 and 0 tests on machine 3, it should add a value of 5 in the Venn diagram for the overlap between machine 1 and machine 2.
I have tried to follow several examples online, but they all seem to take in string values for a Venn Diagram. This would require me to restructure the data, and I was hoping it's possible without converting to strings. I've tried to follow these example:
https://www.datanovia.com/en/blog/venn-diagram-with-r-or-rstudio-a-million-ways/ Making a venn diagram from a count table How to add count values in venn diagram for more than 6 sets? Create a Venn Diagram in R to represent rows with the same value from a dataframe
But none of those seem to fully apply, since they mostly apply to string values. Any help would be much appreciated!