How can I make a group bar plot in ggplot2?

Posted by maximusyoda on Stack Overflow See other posts from Stack Overflow or by maximusyoda
Published on 2014-08-22T04:16:29Z Indexed on 2014/08/22 4:20 UTC
Read the original article Hit count: 225

Filed under:
|

I have four of these kind of dataframes each with a different name (Apple,Ball,Cat) with different values of frequency but same 4 season names

Seasons Frequency
DJF 9886
JJA 5408
MAM 12876
SON 6932

And I am trying to make a group bar plot.

The graph I'm looking for is like this, where

  1. c,d,e,f will be the names - Apple, Ball, Cat.
  2. Y-axis will be Frequency
  3. Each group will have 4 bars: DJF,JJA,MAM,SON
  4. Filled by seasons
  5. The number of Frequency written above the bar plot.

How can I format the data to make it suitable for ggplot (cbind, melt etc) and use it in ggplot?

enter image description here

© Stack Overflow or respective owner

Related posts about r

    Related posts about ggplot2