我有一个剪断代码工作得很好,因为在上周,当我更新ggplot2的0.9.3到1.0.1.
所以基本上这是一个可重复的例子:
df <- data.frame(values=rnorm(200000),
title=rep(seq(1,20), each=10000))
ggplot(df, aes(values)) + geom_histogram(binwidth=.08) + facet_wrap(~ title)
ggplot(df, aes(values)) + geom_histogram(binwidth=.05) + facet_wrap(~ title)
Run Code Online (Sandbox Code Playgroud)
在0.9.3它使用的版本中binwidth=.05.现在它返回一个错误:
Error: arguments imply differing number of rows: 238, 207
Run Code Online (Sandbox Code Playgroud)
我想知道如何以保存方式计算binwidth,因此它不会退出.标准设置实际上不适合我的口味.
还有很多我不完全理解的警告信息:
1: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
Run Code Online (Sandbox Code Playgroud)
提前致谢.
编辑
由于经过几次测试后,它似乎对我有时而且有时不起作用,我也使用种子使一切都可以重现......但最后,即使有种子,有时也会有效,有时则不然.
有谁知道如何解决这个问题?我在更新前从未遇到任何问题.这是完整的输出:
> set.seed(123)
> df <- data.frame(values=rnorm(200000),
+ title=rep(seq(1,20), each=10000))
> ggplot(df, aes(values)) + geom_histogram(binwidth=.05) + facet_wrap(~ title)
Error: arguments imply differing number of rows: 188, 177
In addition: Warning messages:
1: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
2: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
3: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
4: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
5: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
6: In loop_apply(n, do.ply) :
position_stack requires constant width: output may be incorrect
> ggplot(df, aes(values)) + geom_histogram(binwidth=.08) + facet_wrap(~ title)
> set.seed(123)
> df <- data.frame(values=rnorm(200000),
+ title=rep(seq(1,20), each=10000))
> ggplot(df, aes(values)) + geom_histogram(binwidth=.05) + facet_wrap(~ title)
There were 20 warnings (use warnings() to see them)
> ggplot(df, aes(values)) + geom_histogram(binwidth=.08) + facet_wrap(~ title)
Run Code Online (Sandbox Code Playgroud)
如您所见,只有第一个ggplot命令会出错.在重新创建相同的数据框后,它可以工作,只会产生一些警告.
也许有人知道如何缩小问题?
警告包括In loop_apply(n, do.ply),表示包plyr可能涉及正在发生的任何事情.当我加载包plyr_1.8.2时,我可以重现错误.
更新到当前开发版本plyr_1.8.2.9000可以解决此问题.
| 归档时间: |
|
| 查看次数: |
288 次 |
| 最近记录: |