I know how to do it for one single variable. We can use equal.count() or a combination of quantile() and cut(). anyone knows an aggregate function to do this for 100 columns at the same time?
I know I can write a loop but it is slow. Is there a faster way? Because I am looking at a big data issue and possible solution using revolution R is welcome too. Thanks advance!
To clarify: I was trying to break every single column to 20 ranges not just by the first column. I am not trying to split the dataset but trying to transform variables to different ranges . Hope it clarifies. Thank you a lot
Use the g argument in cut2() to choose the breaks your will cut the variable into.
As this is slow considering the OP is dealing with a large dataset:
ALTERNATIVE METHOD USING set()