这在不到一个月前就奏效了。有什么改变吗?(添加了简单的示例):
adk47sample
PeakName Elevation
Marcy 5344
Marcy 5344
Marcy 5344
Marcy 5344
Marcy 5344
Marcy 5344
Marcy 5344
Algonquin 5114
Algonquin 5114
Algonquin 5114
> require(plyr)
Loading required package: plyr
> adk.need.fr.round.6 <- ddply(adk47sample, .(PeakName, Elevation),
+ summarize, needThese=if(length(PeakName) < 6) "needThis")
Error in class(output[[var]]) <- class(value) :
attempt to set an attribute on NULL
对于这个简单的例子,我期望:
> adk.need.fr.round.6
PeakName Elevation needThese
1 Algonquin 5114 needThis