R/getLoadingsFromPCA.R

Defines functions getLoadingsFromPCA

Documented in getLoadingsFromPCA

getLoadingsFromPCA <-
function(x){
  if(class(x) == 'prcomp'){
    return(x$rotation)
  }
  else if(class(x) == 'princomp'){
    return(x$loadings)
  }
  else if(class(x) == 'pcaRes'){
    return(x@loadings)
  }
  else if(class(x) == 'acp'){
    return(x$eigen$vectors)
  }
stop("Erro: No loads");
}
juscelino-izidoro/supcavs documentation built on Jan. 2, 2022, 7:49 a.m.