[Vwgh-commits] r13 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 13 14:57:44 CET 2008


Author: martinkober
Date: 2008-02-13 14:57:44 +0100 (Wed, 13 Feb 2008)
New Revision: 13

Modified:
   pkg/R/duration_of_proc.R
Log:
duration updated

Modified: pkg/R/duration_of_proc.R
===================================================================
--- pkg/R/duration_of_proc.R	2008-02-13 09:22:18 UTC (rev 12)
+++ pkg/R/duration_of_proc.R	2008-02-13 13:57:44 UTC (rev 13)
@@ -8,14 +8,15 @@
 	month_list = c("Jänner"=1, Januar=1, Feber=2, Februar=2, "März"=3, April=4,
 		Mai=5, Juni=6, Juli=7, August=8, September=9, Oktober=10, November=11, Dezember=12)
 	month_pattern = paste(names(month_list), collapse="|");
-	pattern = paste("\\d{1,2}\\.\\W{1,4}(", month_pattern, ")\\D{1,4}\\d{4}", sep="")
+	pattern = paste("\\d{1,2}\\.\\W{1,4}(", month_pattern, ")\\D{1,4}\\d{4}\\D", sep="")
 	matches = gregexpr(pattern, txt, perl=TRUE)[[1]]
 	
-	if (matches[1] == -1) {  
-		## No date found in 'Betreff', let's try 'Begruendung'
-		txt = data[["Begruendung"]]
-		matches = gregexpr(pattern, txt, perl=TRUE)[[1]]
-	}
+#	if (matches[1] == -1) {  
+#		## No date found in 'Betreff', let's try 'Begruendung'
+#		txt = data[["Begruendung"]]
+#		matches = gregexpr(pattern, txt, perl=TRUE)[[1]]
+#	}
+	
 
 	dates = c()
 	for (i in 1:length(matches)) {
@@ -26,7 +27,7 @@
 		dates[i] = as.Date(paste(dd, collapse="-"), "%Y-%m-%d")
 	}
 	class(dates) = "Date"
-	start = max(dates)
+	start = dates[1]
 	dur = end - start
 	
 	return(list(duration_of_proc=(as.integer(dur) + correction_factor), 



More information about the Vwgh-commits mailing list