masterarbeit/dokumentation/evolution1d/R_analysis.sh

30 lines
697 B
Bash
Raw Permalink Normal View History

2017-10-24 11:22:20 +00:00
#!/bin/bash
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[,4],DF[,6],type="spearman")
print("spearman for improvement-potential vs. steps")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,4],DF[,5],type="spearman")
print("spearman for regularity vs. steps")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,2],DF[,5],type="spearman")
print("spearman for variability vs. evolution-error")
DF=as.matrix(read.csv("$1",header=TRUE))
rcorr(DF[,3],DF[,6],type="spearman")
EOF
else
echo "Usage: $0 <Filename.csv>"
fi