sample_mode <- function(x){
input_type <- typeof(x)
frequence <- table(x)
res <- names(frequence)[which.max(frequence)]
str_res <- paste("as.",input_type,"(res)",sep = "")
return(eval(parse(text = str_res)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.