aboutsummaryrefslogtreecommitdiffstats
path: root/R/filterruns.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/filterruns.R')
-rw-r--r--R/filterruns.R25
1 files changed, 25 insertions, 0 deletions
diff --git a/R/filterruns.R b/R/filterruns.R
new file mode 100644
index 00000000..b6d93f73
--- /dev/null
+++ b/R/filterruns.R
@@ -0,0 +1,25 @@
+lcds <- c()
+blcds <- c()
+ #non upfront case
+upfront <- grep("[0-9]+ *- *[0-9]+\\+500",x)
+quotes <- x[upfront]
+for(i in 1:length(quotes)){
+ matches <- gregexpr("[0-9]+ *- *[0-9]+\\+500",quotes[i])
+ row <- substring(quotes[i],matches[[1]],matches[[1]]+attr(matches[[1]],"match.length")-1)
+ row <- gsub("\\+500","",row)
+ row <- gsub(" ","",row)
+ lcds <- rbind(lcds,c(as.numeric(strsplit(row,"-")[[1]]),500,500))
+ blcds <- rbind(blcds,c(as.numeric(strsplit(row,"-")[[2]]),500,500))
+}
+quotes <- x[-upfront]
+running <- grep("[0-9]+ *- *[0-9]+",quotes)
+quotes <- quotes[running]
+for(i in 1:length(quotes)){
+ matches <- gregexpr("[0-9]+ *- *[0-9]+",quotes[i])
+ row <- substring(quotes[i],matches[[1]],matches[[1]]+attr(matches[[1]],"match.length")-1)
+ row <- gsub("\\+500","",row)
+ row <- gsub(" ","",row)
+ lcds <- rbind(lcds,c(0,0,as.numeric(strsplit(row,"-")[[1]])))
+ blcds <- rbind(blcds,c(0,0,as.numeric(strsplit(row,"-")[[2]])))
+}
+