[Pomp-commits] r605 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 19 22:19:22 CET 2012


Author: kingaa
Date: 2012-01-19 22:19:22 +0100 (Thu, 19 Jan 2012)
New Revision: 605

Modified:
   pkg/R/version.R
Log:
- add a 'version.string' to the return list


Modified: pkg/R/version.R
===================================================================
--- pkg/R/version.R	2012-01-19 21:14:59 UTC (rev 604)
+++ pkg/R/version.R	2012-01-19 21:19:22 UTC (rev 605)
@@ -2,14 +2,14 @@
   version <- library(help=pomp)$info[[1]]
   version <- strsplit(version[pmatch("Version",version)]," ")[[1]]
   version <- version[nchar(version)>0][2]
-  version <- as.numeric(strsplit(version,"[-.]")[[1]])
+  splv <- as.numeric(strsplit(version,"[-.]")[[1]])
   if (is.null(at.least)) {
-    list(major=version[1],minor=version[2],rev=version[3])
+    list(major=splv[1],minor=splv[2],rev=splv[3],version.string=version)
   } else {
     minv <- as.numeric(strsplit(as.character(at.least),"[-.]")[[1]])
-    (version[1]>minv[1]) ||
-    (version[1]==minv[1]) && (version[2]>minv[2]) ||
-    (version[1]==minv[1]) && (version[2]==minv[2]) && (version[3]>=minv[3])
+    (splv[1]>minv[1]) ||
+    (splv[1]==minv[1]) && (splv[2]>minv[2]) ||
+    (splv[1]==minv[1]) && (splv[2]==minv[2]) && (splv[3]>=minv[3])
   }
 }
 



More information about the pomp-commits mailing list