0

I have a problem to select a seasonal summary from daily data. I need to classificated a variable in the seasonFilter (winter) The winter season started at November and end at April

for( i in 1:length(years)){

seasonFilter <- neu20[(neu20$Year == years[i] & neu20$Moth %in% c(11:12) $ 
                ((neu20$Year == years[i+1] & neu20$Month %in% c(1:4), ]))

season <- data.frame(YEAR = as.integer(years[i]), YEAR+1 = as.integer(years[i+1]), 
          numDies = as.integer(nrows(seasonFilter)))

outputFinal <- rbind(outputFinal, season)
}

THANKS!

Andy Waite
  • 10,785
  • 4
  • 33
  • 47
  • How about just finding the season for each entry and then subsetting based on that? https://stackoverflow.com/questions/9500114/find-which-season-a-particular-date-belongs-to – Roman Luštrik Jul 03 '18 at 13:44
  • Hello Anna. Welcome to StackOverflow. If you could offer a reproductible example it would be easier for the community to help you. You could follow any of these steps: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Nicolás Velasquez Jul 03 '18 at 13:55
  • 1
    Possible duplicate of [Find which season a particular date belongs to](https://stackoverflow.com/questions/9500114/find-which-season-a-particular-date-belongs-to) – Giorgio Jul 03 '18 at 14:54

0 Answers0