## # mae.writeEigenData() - Write the three Eigen data files from # simplePCAanalysis() computed prcomp() PCA data frame. # Args: # sPCA - the simplePCAanalysis() computed PCA data frame # eigenValFile - name of eigen values data file # eigenVecsFile - name of eigen vectors (1:6) data file # points3Dfile - name of 3D coordinate points for plotting data file # Developer: Shyam(shyamss@hotmail.com). Edited by P. Lemkin # Date : 07/18/2002 ## mae.writeEigenData <- function(sPCA, eigenValFile="EigenValues.out", eigenVecsFile="EigenVectors.out", points3Dfile="Points3D.out") { # mae.writeEigenData # [1] Output the PCA results eigenVals <- sPCA$sdev^2 write.table(file=eigenValFile, eigenVals, sep="\t", eol="\n", row.names=FALSE, col.names=FALSE) eigenVec <- sPCA$rotation[,1:6] write.table(file=eigenVecsFile, eigenVec, sep="\t", eol="\n", row.names=FALSE, col.names=FALSE) # [2] Output the 3D data for the points. points3D <- cbind(sPCA$x[,1],sPCA$x[,2],sPCA$x[,3]) write.table(file=points3Dfile, points3D, sep="\t", eol="\n", row.names=FALSE, col.names=FALSE) } # end of mae.writeEigenData