openplantpathology / Mungbean_PM

A meta-analysis of mungbean powdery mildew control fungicide efficacy trials
https://openplantpathology.github.io/Mungbean_PM/
Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

Figure 2 only accounts for 365 days #36

Closed adamhsparks closed 4 years ago

adamhsparks commented 4 years ago

2012 and 2016 were both leap years, should we not account for this?

PaulMelloy commented 4 years ago

I have updated the code to allow for leap years where estimating the season length

 mutate(season_length = case_when(
    # add a day for leap years
    leap_year(year(first_sign_disease)) &
      (is.na(planting_date) | is.na(harvest_date)) ~
      season_length + 1,