Cut() error - 'breaks' are not unique

后端 未结 4 1179
甜味超标
甜味超标 2020-11-29 04:12

I have following dataframe:

 a         
    ID   a.1    b.1     a.2   b.2
1    1  40.00   100.00  NA    88.89
2    2  100.00  100.00  100   100.00
3    3  5         


        
4条回答
  •  無奈伤痛
    2020-11-29 04:21

    If you'd rather keep the number of quantiles, another option is to just add a little bit of jitter, e.g.

    breaks = c(-Inf,quantile(a[,paste(i,1,sep=".")], na.rm=T),Inf)
    breaks = breaks + seq_along(breaks) * .Machine$double.eps
    

提交回复
热议问题