从每日数据中选择季节性摘要

时间:2018-07-03 13:40:58

标签: r database aggregate

我在从每日数据中选择季节性摘要时遇到问题。 我需要在seasonFilter(冬季)中对变量进行分类 冬季始于11月,结束于4月

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)
}

谢谢!

0 个答案:

没有答案