# HG changeset patch # User mb2013 # Date 1384949899 18000 # Node ID dce35de9677e42844ff1abcbc4fbcab8c468fee1 # Parent b9d127d6b00ed1330660735d3c348b4ab0fb8906 Uploaded diff -r b9d127d6b00e -r dce35de9677e PCA.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PCA.R Wed Nov 20 07:18:19 2013 -0500 @@ -0,0 +1,22 @@ +# The tool PCA creates a principle component analysis on procrustes data. +# developer: M.Baak + +#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) +#principle componten 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)