##
## Define scale
DefineScale <- function(data){
require(pbapply)
eleMean <- apply(data, 2, mean)
eleSd <- apply(data, 2, sd)
function(data){
eleIndex <- which(eleSd!=0)
dataReturn <- pbsapply(eleIndex, function(i) (data[,i] - eleMean[i]) / eleSd[i])
return(dataReturn)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.