I have a good one. I have been thinking about this for a long time. I have this data set, and this data set can be huge. I would like to draw a ggplot stack line based on the 5 highest counts for each month. For example, for 1/1/2012 the most important are I, G, F, D and E.
Df
Date Desc count
1/1/2012 A 10
1/1/2012 B 5
1/1/2012 C 7
1/1/2012 D 25
1/1/2012 E 19
1/1/2012 F 30
1/1/2012 G 50
1/1/2012 H 10
1/1/2012 I 100
2/1/2012 A 10
2/1/2012 B 5
2/1/2012 C 7
2/1/2012 D 25
2/1/2012 E 19
2/1/2012 F 30
2/1/2012 G 50
2/1/2012 H 10
2/1/2012 I 100
3/1/2012 A 1
3/1/2012 B 4
3/1/2012 C 5
3/1/2012 D 6
3/1/2012 E 6
3/1/2012 F 7
3/1/2012 G 8
3/1/2012 H 5
3/1/2012 I 10
I have something like this, but this displays all the values:
ggplot(df, aes(Date, count))+ geom_bar(aes(fill=Desc), stat="identity", position="stack") + theme_bw()
source
share