#' Quick Cut
#'
#' Produces a quick cut of a variable by various tiles
#'
#' @param x A numeric vector (or integer)
#' @param breaks The number of breaks to create using \link{quantile} or predefined breaks
#' @param ... other arguments passed to \link{cut}
#' @export
credo.cut <- function(x,breaks=5,right=TRUE,include.lowest=TRUE,...) {
if(length(breaks) == 1) {
x <- cut(x, c(-Inf, quantile(x,seq(0,1,1/breaks))),...)
}
if(length(breaks) > 1) {
x <- cut(x, c(-Inf, breaks,Inf),...)
}
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.