Using CUT and Quartile to generate breaks in R function
问题 Following some great advice from before, I\'m now writing my 2nd R function and using a similar logic. However, I\'m trying to automate a bit more and may be getting too smart for my own good. I want to break the clients into quintiles based on the number of orders. Here\'s my code to do so: # sample data clientID <- round(runif(200,min=2000, max=3000),0) orders <- round(runif(200,min=1, max=50),0) df <- df <- data.frame(cbind(clientID,orders)) #function to break them into quintiles