2020年12月24日星期四

create labels for interval

I am trying to create a label with cut and here is the example

> cut(c(1,5,10,15,160),c(0,5,10,15,Inf))  [1] (0,5]    (0,5]    (5,10]   (10,15]  (15,Inf]  Levels: (0,5] (5,10] (10,15] (15,Inf]  

I wanted to automatically create labels like this

"1~5" "6~10" "11~15" "15+"  

Is there any way I can do it automatically?

https://stackoverflow.com/questions/65444439/create-labels-for-interval December 25, 2020 at 09:06AM

没有评论:

发表评论