怎样才能“安排”?命令用于为 R 中的直方图生成一组 bin
当我尝试通过定义一组 bin 来在 R 中绘制直方图时,我收到此错误“some 'x' not counted; some 'x' not counted;”也许“中断”不跨越“x”的范围。 我正在关注网站“http://msenux.redwoods.edu/math/R/hist.php”上的信息,其中指出“使用 arange 命令生成这组垃圾箱”。我尝试在互联网上搜索如何为我的数据集生成合适范围的垃圾箱,但徒劳无功。
谁能告诉我它是如何完成的?或者是否还有其他方法。 我尝试将垃圾箱设置为
bins=seq(0,3,by=0.2)
并将直方图绘制为
hist(log10(a),col=4,breaks=bins)
While I try to plot histogram in R by defining a set of bins I get this error 'some 'x' not counted; maybe 'breaks' do not span range of 'x''.
I am following the information on the website 'http://msenux.redwoods.edu/math/R/hist.php' which states 'Use the arange command to produce this set of bins'. I tried to search in the internet about how to produce suitable range of bins for my data set but in vain.
Could anyone tell me how its done? or if there is any other way.
I have tried to set the bins as
bins=seq(0,3,by=0.2)
and plot histogram as
hist(log10(a),col=4,breaks=bins)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑某些
log10(a)
超出了[0,3]
范围。在这种情况下,您可以简单地执行类似这样的操作,以确保所有值都在容器内。
I suspect that some
log10(a)
is outside the range[0,3]
. In that case, you can simply do something likeThis ensures that all the values are within the bins.