covmcd <-
function(x,nsamp="sample"){
#
# nsamp="best" is the default used by R,
# meaning that the number of samples is chosen so that
# exhaustive enumeration is done up to 5000 samples
# nsamp="sample" the number of samples
# is min(5*p, 3000)
#
library(MASS)
oldSeed <- .Random.seed
val<-cov.mcd(x,nsamp=nsamp)
assign(x='.Random.seed', value=oldSeed, envir=.GlobalEnv)
list(center=val$center,cov=val$cov)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.