masterarbeit/dokumentation/evolution3d/R_analysis.sh
2017-10-25 20:40:51 +02:00

33 lines
806 B
Bash
Executable File

#!/bin/bash
# regularity,variability,improvement,"Evolution error",steps
# 6.57581e-05,0.00592209,0.622392,113.016,2368
if [[ -f "$1" ]]; then
R -q --slave --vanilla <<EOF
print("================ Analyzing $1")
library(Hmisc)
print("spearman for improvement-potential vs. evolution-error")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,3],DF[,4],type="spearman")
print("spearman for improvement-potential vs. steps")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,3],DF[,5],type="spearman")
print("spearman for regularity vs. steps")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,1],DF[,5],type="spearman")
print("spearman for variability vs. evolution-error")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,2],DF[,4],type="spearman")
EOF
else
echo "Usage: $0 <Filename.csv>"
fi