I have a data frame that looks like this,
df <- data.frame(type=c("SNP","DEL","SNP","SNP"),geneA=c(1,1,1,0), geneB=c(0,0,1,1), geneC=c(1,0,0,1))
type geneA geneB geneC
1 SNP 1 0 1
2 DEL 1 0 0
3 SNP 1 1 0
4 SNP 0 1 1
I want to make an UpSet plot in R to find the common genes and
I want to plot the distribution of types (SNP or DEL) in an histogram.
this is my code so far
upset(df,
attribute.plots = list(gridrows=50,
plots=list(list(plot=histogram,
x="type"))))
and this is my error, which I can not solve
Error: StatBin requires a continuous x variable: the x variable is discrete.Perhaps you want stat="count"?
ANY help is highly appreciated