Nothing
#' @title Set Factor Class
#'
#' @param x the data that you want to set
#' @param levels levels, the first levels is the reference. If the length of levels is 1, no levels will be given to x
#'
#' @return factor x
#' @export
#'
#' @examples
#' to.factor(mtcars$gear,c(4,3,5))
#' to.factor(mtcars$gear)
to.factor <- function(x,levels){
if (missing(levels)){
factor(x)
}else{
factor(x,levels = levels)
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.