R/scores.R

Defines functions scores

Documented in scores

scores=function(X){

     if (inherits(X,"SpatFD") ) {

          puntaje=list()
          puntajes=list()
          for(j in 1:length(X)){


               puntaje[[j]]=X[[j]]$fpca$scores
               rownames(puntaje[[j]])=X[[j]]$coordsnames
               puntajes[[j]]=as.data.frame(puntaje[[j]])
          }
     } else if(inherits(X,"scores_pred")){
          puntajes = X$scores_pred
     } else {
          stop("Wrong class of X object. It must be of class SpatFD or scores_pred")
     }
     return(puntajes)
}
catalinavillamil/SpatFD documentation built on May 2, 2021, 4:21 a.m.