Using the cut function in R:
as.numeric(cut( 1:6,4))
## [1] 1 1 2 3 4 4
Is there a way to get it to cut the value in largest chunks first so that
as.numeric(cut( 1:6,4))
would return
## [1] 1 1 2 2 3 4
instead? and,
table(as.numeric(cut( 1:7,4)))
would return
## [1] 2 2 2 1
instead of
## [1] 2 2 1 2
etc…