我可以使用 plyr 将列和列上的函数组合起来吗?
我不知道为什么这段尝试根据 id 和更大粒度对事件进行分组的代码无法使用 plyr 库:
times <- as.POSIXct("1970-01-01")+1:100
vals <- sample.int(2,100,replace=TRUE)
df <- data.frame(times,vals)
ddply(df, .(vals,round(times,"mins")), function(x)nrow(x))
Error in if (n > 2^31) { : missing value where TRUE/FALSE needed
我做错了什么?
I don't know why this code that is trying to group events based on an id and with bigger granularity fails using the plyr library:
times <- as.POSIXct("1970-01-01")+1:100
vals <- sample.int(2,100,replace=TRUE)
df <- data.frame(times,vals)
ddply(df, .(vals,round(times,"mins")), function(x)nrow(x))
Error in if (n > 2^31) { : missing value where TRUE/FALSE needed
What I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这是 R 2.12 的一个错误。升级到2.14解决了这个问题。谢谢你的提示。
It seems that is a bug of R 2.12. Upgrading to 2.14 solved the problem. Thanks for the hint.