getEigenvaluesFromPCA <-
function(x){
if(class(x) == 'prcomp'){
return(x$sdev^2)
}
else if(class(x) == 'princomp'){
return(x$sdev^2)
}
else if(class(x) == 'pcaRes'){
return(x@sDev^2)
}
else if(class(x) == 'acp'){
return(x$explica)
}
stop("Erro: No eigenvalues");
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.