My data:
I have a data set containing presence of various chemicals across multiple waterbodies. I want to create a barplot of the frequency of "Yes" values across multiple variables/columns.
I've tried various attempts using base r and ggplot2
, the problem I am consistently running into is that the functions want the sub variable id or just a singular variable and I am looking to select the range of chem1 through chem5 to display.
ggplot(MyData, aes(x=3:7, y="Yes")) + geom_bar()
Created on 2022-02-22 by the reprex package (v2.0.1)
I know this does not work but I wanted to attach to delineate my goal in r. The 3:7 is the range of columns I want plotted.
I am new to R and sifted through similar questions and couldn't figure it out.