How to calculate events per day in R including dates when no events occurred?
I made the assumption that:

Events (All) =   Events (Female)  + Events (Male)

I also manipulated the data so that there are more than one event per day.

As a result, df looks like:

  Sex Age       Date
1   2  36 2004-01-05
2   1  47 2004-01-05
3   1  26 2004-01-10
4   2  23 2004-01-10
5   1  50 2004-01-27
6   2  35 2004-01-27
7   1  35 2004-01-30
8   1  38 2004-02-30
9   2  29 2004-02-30


The following code should achieve the desired results.

library(tidyr)
df = read.csv([Path to dataset], stringsAsFactors = FALSE) 

df %&gt;% group_by(Date, Sex) %&gt;%  
  summarise(sex_count = n()) %&gt;% 
  spread(Sex,sex_count, fill=0) %&gt;% 
  rename( event_female = '1', event_male = '2') %&gt;%
  mutate(event_all = event_female + event_male ) %&gt;%
  select(event_all, event_female, event_male)


output:

 Date       event_all event_female event_male
  &lt;chr&gt;          &lt;dbl&gt;        &lt;dbl&gt;      &lt;dbl&gt;
1 2004-01-05         2            1          1
2 2004-01-10         2            1          1
3 2004-01-27         2            1          1
4 2004-01-30         1            1          0
5 2004-02-30         2            1          1
```