How to plot multiple bar charts on the same plot?

I have the data below and am trying to plot it all in one chart with a bar for each of the Nad_Totals values, and then the x-axis divided into the three frequencies. Does anyone know how to do this? Thanks The data is below:

Nad_Frequency Nad_Totals

|Weekly |550.6233863|
|Weekly |553.5625904|
|Weekly |563.0517622|
|Weekly |563.6506493|
|Weekly |566.7065001|
|Weekly |563.8054161|
|Weekly |561.7409152|
|Monthly |572.6378529|
|Monthly |573.9247763|
|Monthly |509.9807722|
|Monthly |561.8506329|
|Monthly |579.9562373|
|Monthly |564.9121329|
|Monthly |592.8302856|
|Monthly |585.6264275|
|Monthly |559.6527|
|Monthly |549.3891637|
|Stratified|565.1179935|
|Stratified|566.2964748|
|Stratified|563.2220424|
|Stratified|559.6463513|
|Stratified|562.8478125|
|Stratified|562.7622964|
|Stratified|563.8086893|

so I am trying to produce a graph like this but with Nad_Totals on the y-axis and Nad_Frequency on the x

You may benefit from studying this useful book.
https://r4ds.had.co.nz/
Particularly chapter 3

Assuming your data is formatted as a dataframe, I'd do something like this using the ggplot2 package:

ggplot(data=data, aes(x=Nad_Frequency,y=Nad_Totals)) + 
  geom_bar(stat="identity",position=position_dodge())

Which will produce side by side barplots based on the different values in Nad_Totals.

Hope this helps!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.