I am trying to create an Upset plot for 4 clinical data sets from 200 patients in R studio. I am only able to do so if I create a data frame and type each data point (0 or 1). Since I have 200 entries, it is difficult to type in for 4 clinical variable. Is there a simpler way out to this? All my entries are binary values (0/1).
I created a data frame of 14 patients (by entering 0 or 1 for each data point) for these 4 clinical variable, and I got the Upset plot. How do I do this for a larger population.
Upset.2 <- data.frame(ID = c("IG1", "IG5", "IG8", "IG10",
"IG11", "IG12", "IG14", "IG18",
"IG19", "IG20", "IG21", "IG23",
"IG26", "IG27"),
cranialnerveabnormality = c(0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 1, 0),
meningealsigns = c( 0, 1, 0, 1, 1, 0, 0, 1, 0, 0,
0, 0, 1, 0),
cerebellarsigns = c(0, 0, 1, 0, 0, 0, 0, 1, 1, 0,
0, 0, 0, 0),
involuntarymvmts = c(0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0))
upset(Upset.2[,-1])
I tried this for 14 patients by creating a data frame and entering each value (0/1) from the list. This created the plot. However, I have 200 patients and I do not want to copy and paste value. How can I do that?