Cut and labels/breaks length conflict

爱⌒轻易说出口 提交于 2019-11-29 09:32:52

With cut(), 11 breaks delimit 10 levels which will require only 10 labels. The "labels/breaks length conflict" error is telling you that the call to sprintf() is supplying one too many labels to the labels= argument.

In code:

breaks <- 0:10/10
dat <- runif(1e4)

length(breaks)
# [1] 11
length(levels(cut(breaks, sq)))
# [1] 10
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!