Function to Save PCA Loadings and Scores as .csv files
Function to save PCA matrices following computations by functions gx.mva
, gx.mva.closed
, gx.robmva
, gx.robmva.closed
or gx.rotate
as ‘.csv’ files. By default appropriate files names are generated and the files saved in the Working Directory.
gx.rqpca.save(save, ifload = TRUE, ifcntrb = FALSE, ifscore = TRUE, file = NULL)
save |
a saved object from any of functions |
ifload |
if |
ifcntrb |
if |
ifscore |
if |
file |
the name of the folder where the files are to be saved, a ‘/’ is appended before the synthesized file name, details of which are displayed on the current device. If no file is specified, the files are saved to the Working Directory. |
By default the PCA matrices are saved to the Working Directory with a synthesized file name consisting of the name of the saved object from which the matrices are sourced and an appropriate identifying suffix and ‘.csv’. If a folder name has been provided in file
, a ‘/’ is appended prior to the synthesized file name. As each matrix is saved its file name is displayed on the current device. When the saved object is from gx.rotate
and is the input object both the original and Varimax loadings and PC scores will be saved by default.
The last saved table, table.rows
, is returned and may be saved as an object if required.
Robert G. Garrett
## Make test data available data(sind.mat2open) ## Estimate and save robust PCA loadings and scores sind.save <- gx.robmva.closed(sind.mat2open) gx.rqpca.save(sind.save) ## NOTE: the example below is commented out ## Save PCA scores for future use ## gx.rqpca.save(sind.save, ifcntrb = TRUE, file = "D:\R_work\Project3") ## Clean-up rm(sind.save)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.