scale2 <- function(x) {
if (all(is.na(x))) return(NA)
if (sd(x,na.rm=TRUE)!=0){
return((x-mean(x,na.rm=TRUE))/sd(x,na.rm=TRUE))
} else {
return(rep(0, length(x)))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.