I have the following R code to plot the counts for two values side by side each month (d1 and d2). Before summarising with ddply, I have the count for separate 'posts' made on different dates.
I really want / need to add a space between the paired bars each month, and labels for each month, so it is clearer to read. Can anybody suggest what I should do for this?
m_scores = ddply(data_NKsam2,.(zdate),summarise, d1 = sum(d1) , d2 = sum(d2))
require(tidyr)
df <- gather(m_scores, event, total, d1:d2)
plot <- ggplot(df, aes(zdate, total, fill=event))
plot <- plot + geom_bar(stat = "identity", position = 'dodge')
This code currently produces a chart like this:
Here is a section of the data 'm_scores'
zdate d1 d2
11 Nov 2014 263 318
12 Dec 2014 430 662
13 Jan 2015 507 326
14 Feb 2015 326 279
15 Mar 2015 281 345
16 Apr 2015 352 260
17 May 2015 280 315
18 Jun 2015 243 238
19 Jul 2015 313 251
20 Aug 2015 446 439
21 Sep 2015 416 404
22 Oct 2015 616 423
23 Nov 2015 269 242
24 Dec 2015 781 527
25 Jan 2016 865 861
26 Feb 2016 997 2139
27 Mar 2016 920 1421
28 Apr 2016 376 498
29 May 2016 434 309
30 Jun 2016 271 284