I have a dataset with several pathogens. I want to create a bar-graph that lists the pathogens on the x-axis with 3 bars "Negative" "Positive" and "NA" (which are listed in the dataset) and count on the y-axis. I am successful in creating a bar-graph for a single pathogen with the following code, but I cannot figure out how to get all the pathogens on a single graph. Help would be appreciated.
For single pathogen:
countST=table(NetJoint$`sT-ETEC`)
barplot(countST)
My attempt for multiple pathogens:
ETECcounts=table(NetJoint$`LT-ETEC`, NetJoint$`sT-ETEC`)
barplot(ETECcounts, main="Pathogen Distribution",
xlab="Pathogen", beside=TRUE)
^^This code lists "NA", "Negative" and "Positive" on the x-axis instead of the pathogens.