discretize <- function(x, q) {
xq = quantile(x, c(q, 1-q), na.rm=T)
xd = ifelse(is.na(x),NA,1)
xd[x<=xq[1]] = 0
xd[x>=xq[2]] = 2
return(xd)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.