[英]I can't summarize by multiple columns
我想按某些列(客戶,年份,LoS和國家/地區)匯總我的數據集
但是當我使用group_by並總結時,我沒有得到這個,我只得到了部分總結...
我究竟做錯了什么?
像這樣嗎 請更清楚您的需求。
data %>%
group_by(Client, Year, LoS, Country) %>%
summarise_all("mean", na.rm = TRUE)
我認為這應該可以解決問題
library(plyr)
ddply(data, .(Client, Year, LoS, Country), function(x){colSums(x[,5:6]))}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.