-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_results.R
More file actions
32 lines (20 loc) · 914 Bytes
/
run_results.R
File metadata and controls
32 lines (20 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Combine all results
############################################################################################
ptm <- proc.time(); print(ptm)
write_results=function(filename, sitename, resultsfile, patternfile) {
source("./stabil_function.r")
#Read file
sitefile=read.table(filename,header=T)
#Run analysis
sitename_out=stabil(sitefile,names(sitefile)[-(1:3)],sitename)
#Save results
write.table(cbind(site=sitename,sitename_out$results), resultsfile, append=T, sep=",", col.names = F, row.names=FALSE)
write.table(cbind(site=sitename,sitename_out$pattern), patternfile, append=T, sep=",", col.names = F, row.names=FALSE)
}
#List of files
files=list.files(pattern=".txt",recursive=T)[60:102]
names=gsub("\\..*","",list.files(pattern=".txt",recursive=T))[60:102]
for(i in 1:length(files)) {
write_results(files[i],names[i],"nonlinearresults.csv","nonlinearpattern.csv")
}
print(proc.time() - ptm)