Created
December 16, 2013 11:28
-
-
Save nassimhaddad/7985652 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cut_equal <- function(x, n = 3){ | |
q <- quantile(x, prob= seq(0,1,length.out = n+1 )) | |
cut(x, | |
breaks = as.numeric(q), | |
include.lowest=TRUE, labels = 1:n) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment