[Analogue-commits] r356 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 26 20:06:25 CEST 2013


Author: gsimpson
Date: 2013-08-26 20:06:24 +0200 (Mon, 26 Aug 2013)
New Revision: 356

Modified:
   pkg/R/deshrink.R
   pkg/R/internal.R
   pkg/R/weightedCor.R
Log:
stop R CMD check complaining about :::, even in comments

Modified: pkg/R/deshrink.R
===================================================================
--- pkg/R/deshrink.R	2013-08-24 21:02:08 UTC (rev 355)
+++ pkg/R/deshrink.R	2013-08-26 18:06:24 UTC (rev 356)
@@ -21,7 +21,7 @@
         return(list(coefficients = coef, env = pred))
     }
     ## deshrink to equal SD
-    ## A bit like in vegan:::wascores, but wascores uses
+    ## A bit like in vegan's wascores, but wascores uses
     ## weighted sd which would need row and column sums in the
     ## function call, and this would make the function API
     ## incompatible with other *.deshrink functions.

Modified: pkg/R/internal.R
===================================================================
--- pkg/R/internal.R	2013-08-24 21:02:08 UTC (rev 355)
+++ pkg/R/internal.R	2013-08-26 18:06:24 UTC (rev 356)
@@ -172,41 +172,6 @@
     opt
 }
 
-## inverse deshrinking function
-## `inv.deshrink` <- function(env, wa.env) {
-##     X <- cbind(rep(1, length(wa.env)), wa.env)
-##     QR <- qr(X)
-##     coef <- qr.coef(QR, env)
-##     pred <- qr.fitted(QR, env)
-##     return(list(coefficients = coef, env = pred))
-## }
-
-## classical deshrinking
-## `class.deshrink` <- function(env, wa.env) {
-##     X <- cbind(rep(1, length(env)), env)
-##     QR <- qr(X)
-##     coef <- drop(qr.coef(QR, wa.env))
-##     coef <- c(-coef[1], 1)/coef[2]
-##     pred <- deshrink.pred(wa.env, coef)
-##     return(list(coefficients = coef, env = pred))
-## }
-
-## deshrinking to equal sd
-## A bit like in vegan:::wascores, but wascores uses weighted sd which
-## would need row and column sums in the function call, and this would
-## make the function API incompatible with other *.deshrink functions.
-## `expand.deshrink` <- function(env, wa.env) {
-##     b1 <- sd(env)/sd(wa.env)
-##     b0 <- mean(env) - b1 * mean(wa.env)
-##     pred <- b0 + b1 * wa.env
-##     return(list(coefficients = c(b0, b1), env = pred))
-## }
-
-# Do not deshrink: for those who think they know what they do
-## `no.deshrink` <- function(env, wa.env) {
-##     return(list(coefficients = c(0, 1), env = wa.env))
-## }
-
 ## fast rowSums and colSums functiosn without the checking
 `RowSums` <- function(x, na.rm = FALSE) {
     dn <- dim(x)

Modified: pkg/R/weightedCor.R
===================================================================
--- pkg/R/weightedCor.R	2013-08-24 21:02:08 UTC (rev 355)
+++ pkg/R/weightedCor.R	2013-08-26 18:06:24 UTC (rev 356)
@@ -18,7 +18,7 @@
     x <- x[, nams]
     fossil <- fossil[, nams]
     ## WA model and optima
-    Args <- head(formals(analogue:::wa.default), -1)
+    Args <- head(formals(wa.default), -1)
     dots <- list(x = x, y = env, env = NULL, ...)
     Args <- modifyList(Args, dots)
     Args <- lapply(Args,
@@ -66,7 +66,6 @@
                 if(verbose)
                     setTxtProgressBar(pb, i)
                 Args$y <- unifs[i,]
-                ##rmod <- do.call(analogue:::waFit, Args)
                 rmod <- do.call(waFit, Args)
                 ropt <- rmod$wa.optima
                 pArgs$optima <- ropt



More information about the Analogue-commits mailing list