Вот вам и арчик.
Код: Выделить всё
#recreate variable response curves with confidence intervals in gray
v = "Dem"
indir = "D:\\Programming\\R\\maxent\\sample_output\\plots\\"
reps = 5
#get x, they are always the same
fn = paste(indir,"Saiga_",1,"_",v,".dat",sep="")
d = read.table(fn,sep=",",header=T)
res = d$x
for (i in 1:reps) {
fn = paste(indir,"Saiga_",i-1,"_",v,".dat",sep="")
d = read.table(fn,sep=",",header=T)
res = cbind(res,d$y)
}
means = rowMeans(res[,-1])
maxs = apply(res[,-1],1,max)
mins = apply(res[,-1],1,min)
plot(d$x,means,ylim=c(0,1),type="l",lwd=2,xlab=v,ylab="Logistic output (probability of presence)")
arrows(d$x,mins,d$x,maxs,code=0,length=0.1,col="gray")
lines(d$x,means,lwd=2)