Plotting Data using barplot

I am trying to create a barplot with the below data.



March 511.62
April 1242.00
May 1469.00
June 1693.00
July 1596.00
August 7337.00
September 7304.00
October 9690.00
November 10797.00
December 11356.00

When I use barplot(Cal_Month20), the error I get is as below.
Error in barplot.default(Cal_Month20) : 'height' must be a vector or a matrix

Can anyone advise where I am going wrong?

You can use either of the following commands

barplot(Cal_Month20$Total_Cal, names.arg = Cal_Month20$Month)

barplot(Total_Cal ~ Month, data = Cal_Month20)
1 Like

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.