Aggregate sum obs with different ID's in the same data frame

南楼画角 提交于 2019-12-02 09:12:35

a$Doseringer_pr_kg_dyr[is.na(a$Doseringer_pr_kg_dyr)]<-0 a$x<-ave(a$Doseringer_pr_kg_dyr,a$CHR_NR,FUN = cumsum)

where x is the cummulated and "ave" groups the accumulation in CHR

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!