# This function clips variables at a multiple of their standard deviation, for better color palette scaling.
clip_at_sd <- function(x, multiple = 1) {
m <- mean(x, na.rm = TRUE)
s <- sd(x, na.rm = TRUE) * multiple
y <- x %>%
pmin(m + s) %>%
pmax(m - s)
return(y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.