Skip to content

Commit

Permalink
minor fixes - added original_data attribute in PCA
Browse files Browse the repository at this point in the history
  • Loading branch information
brasmus committed May 8, 2024
1 parent 5c1b5b4 commit 78613be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/DS.R
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ DS.pca <- function(y, X, verbose=FALSE, plot=FALSE, it=NULL, method="lm",
attr(ds,'model') <- model ## REB 2024-03-08: Save the model summary rather than the model itself
#attr(ds,'model') <- summary(model)
attr(ds,'eof') <- eof
attr(y0,'location') <- loc(y)
attr(ds,'original_data') <- y0
attr(ds,'variable') <- varid(y0)
attr(ds,'mean') <- attr(y0,'mean') # + offset
Expand Down
1 change: 1 addition & 0 deletions R/PCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ PCA.station <- function(X,...,n=20,na.action='fill',verbose=FALSE,it=NULL,is=NUL
attr(y,'sum.eigenv') <- sum(pca$d)
attr(y,'tot.var') <- sum(pca$d^2)
attr(y,'aspect') <- 'anomaly'
attr(y,'original_data') <- X
attr(y,'history') <- history.stamp(X)
class(y) <- c("pca",class(X))
invisible(y)
Expand Down

0 comments on commit 78613be

Please sign in to comment.