I have a column of continuous values. Say 1 to 10000. I want to make it to "n" buckets in considerable range, say from 1 to 1000 - call it as bucket 1, 1000 to 5000 bucket 2 etc. Is there any package available in R to do this
Thank you
I have a column of continuous values. Say 1 to 10000. I want to make it to "n" buckets in considerable range, say from 1 to 1000 - call it as bucket 1, 1000 to 5000 bucket 2 etc. Is there any package available in R to do this
Thank you
We can try rep
. In general, it is better to use cut
or findInterval
, but in this special case, rep
also should work.
rep(1:3, c(1000, 4000, 5000))