[Pomp-commits] r678 - pkg/pomp/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 24 18:23:26 CEST 2012


Author: kingaa
Date: 2012-04-24 18:23:25 +0200 (Tue, 24 Apr 2012)
New Revision: 678

Modified:
   pkg/pomp/R/aaa.R
   pkg/pomp/R/nlf-funcs.R
   pkg/pomp/R/plot-pomp.R
   pkg/pomp/R/pomp.R
   pkg/pomp/R/probe-match.R
   pkg/pomp/R/probe.R
   pkg/pomp/R/spect.R
Log:
- use 'paste0' where appropriate.  define 'paste0' for use with R <= 2.15.0


Modified: pkg/pomp/R/aaa.R
===================================================================
--- pkg/pomp/R/aaa.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/aaa.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -17,3 +17,7 @@
 setGeneric("pred.mean",function(object,...)standardGeneric("pred.mean"))
 setGeneric("pred.var",function(object,...)standardGeneric("pred.var"))
 setGeneric("filter.mean",function(object,...)standardGeneric("filter.mean"))
+
+if (!exists("paste0",where="package:base")) {
+  paste0 <- function(...) paste(...,sep="")
+}

Modified: pkg/pomp/R/nlf-funcs.R
===================================================================
--- pkg/pomp/R/nlf-funcs.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/nlf-funcs.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -16,9 +16,9 @@
   a <- start
   b <- a + n - 1
   if(xd == 1)
-    lab <- format(paste("lag", rep(lags, rep(xd, length(lags))), sep = ""))
+    lab <- format(paste0("lag",rep(lags,rep(xd,length(lags)))))
   else
-    lab <- format(paste( rep(1:xd, length(lags)), "lag", rep(lags,rep(xd, length(lags))), sep = ""))
+    lab <- format(paste0(rep(seq_len(xd),length(lags)),"lag",rep(lags,rep(xd,length(lags)))))
   dimnames(temp) <- list(NULL,lab)
   skip <- NA
   if (!is.null(cov)) {

Modified: pkg/pomp/R/plot-pomp.R
===================================================================
--- pkg/pomp/R/plot-pomp.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/plot-pomp.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -54,7 +54,7 @@
               if (is.null(nm))
                 nm <- colnames(x)
               if (is.null(nm))
-                nm <- paste("Series", 1:nser)
+                nm <- paste("Series",seq_len(nser))
               if (is.null(nc))
                 nc <- if(nser>4){2}else{1}
               nr <- ceiling(nser/nc)

Modified: pkg/pomp/R/pomp.R
===================================================================
--- pkg/pomp/R/pomp.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/pomp.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -308,8 +308,8 @@
   }
   obsnames <- unlist(lapply(formulae,function(x)x[[2]]))
   distrib <- lapply(formulae,function(x)as.character(x[[3]][[1]]))
-  ddistrib <- lapply(distrib,function(x)paste("d",x,sep=''))
-  rdistrib <- lapply(distrib,function(x)paste("r",x,sep=''))
+  ddistrib <- lapply(distrib,function(x)paste0("d",x))
+  rdistrib <- lapply(distrib,function(x)paste0("r",x))
   for (k in seq_len(nobs)) {
     res <- try(
                match.fun(ddistrib[[k]]),

Modified: pkg/pomp/R/probe-match.R
===================================================================
--- pkg/pomp/R/probe-match.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/probe-match.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -130,7 +130,7 @@
     val <- obj.fn(guess)
     conv <- NA
     evals <- as.integer(c(1,0))
-    msg <- paste("no optimization performed")
+    msg <- "no optimization performed"
 
   } else {
 

Modified: pkg/pomp/R/probe.R
===================================================================
--- pkg/pomp/R/probe.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/probe.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -161,7 +161,7 @@
             labels <- paste("pb",seq_len(nprobes))
             if (!is.null(names(x at datvals)))
               labels <- ifelse(names(x at datvals)=="",labels,names(x at datvals))
-            lab.plus <- paste(labels,paste("p=",round(x at pvals,3),sep=""),sep="\n")
+            lab.plus <- paste(labels,paste0("p=",round(x at pvals,3)),sep="\n")
             ##now make the plot
 
             if (nprobes>1) {

Modified: pkg/pomp/R/spect.R
===================================================================
--- pkg/pomp/R/spect.R	2012-04-23 11:43:59 UTC (rev 677)
+++ pkg/pomp/R/spect.R	2012-04-24 16:23:25 UTC (rev 678)
@@ -327,12 +327,7 @@
                    ylab=expression(paste(log[10],"power"))
                    )
               title(
-                    main=paste(
-                      ylabs[i],
-                      ", p = ",
-                      round(spomp at pvals[i],4),
-                      sep=""
-                      ),
+                    main=paste0(ylabs[i],", p = ",round(spomp at pvals[i],4)),
                     line=0
                     )
               for (j in seq_along(quantiles)) {



More information about the pomp-commits mailing list