Mercurial > repos > mb2013 > nepenthes_3dpca
view PCA.R @ 19:f3d9bb18110a draft default tip
Uploaded
author | mb2013 |
---|---|
date | Tue, 20 May 2014 03:30:07 -0400 |
parents | 5aaede6275f9 |
children |
line wrap: on
line source
# The tool PCA creates a Principal Component Analysis on Procrustes coordinates. # MB #commands of commandline args <- commandArgs(TRUE) #input file: procrustes coordinates input <- args[1] #output file output <- args[2] output2 <- args[3] #package geomorph suppressMessages(library("geomorph")) #reading of coordinates read <- read.csv(file <- input,header = TRUE) #principal component analysis with princomp, using covariance matrix of coordinates pca <- princomp(x=cov(read)) #output pca scores write.csv(pca$scores,output, row.names = FALSE) write.csv(pca$sdev, output2, row.names = FALSE)