renaming the output column with the plyr package in R

前端 未结 2 1228
感动是毒
感动是毒 2020-12-31 11:16

Hadley turned me on to the plyr package and I find myself using it all the time to do \'group by\' sort of stuff. But I find myself having to always rename the resulting col

2条回答
  •  情书的邮戳
    2020-12-31 11:54

    Use summarise (or summarize):

      groupAcres <- ddply(mydata, "state", summarise, 
         myName = sum(acres))
    

提交回复
热议问题