I have a dataframe, called dets_per_month
, that looks like so...
**Zone month yearcollected total**
1 Jul 2017 183
1 Jul 2015 18
1 Aug 2015 202
1 Aug 2017 202
1 Aug 2017 150
1 Sep 2017 68
2 Apr 2018 65
2 Jun 2018 25
2 Sep 2018 278
I'm trying to input 0's for months where there are no totals in a particular zone. This is the code I tried using to input those 0's
complete(dets_per_month, nesting(zone, month), yearcollected = 2016:2018, fill = list(count = 0))
But the output of this doesn't give me any 0's, instead it adds on columns from my original dataframe. Can anyone tell me how to get 0's for this?