I have two binary variables consisting of 0 and 1 value. I want to create a barplot of the two variable that only shows the count of value equal to 1. I created the following code:
counts = table(Flag1, Flag2)
barplot(counts, beside = TRUE)
this code gives me the following plot:
I am trying to create a plot similar to this one but that only shows the two barplots for the value 1 instead of both 0 and 1 barplots. Is there any way to achieve this in R?
Any suggestions or tips would be greatly appreciated!