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: 247
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
- c,d,e,f will be the names - Apple, Ball, Cat.
- Y-axis will be Frequency
- Each group will have 4 bars: DJF,JJA,MAM,SON
- Filled by seasons
- 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?
© Stack Overflow or respective owner