[Analogue-commits] r158 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 22 20:02:48 CET 2010
Author: gsimpson
Date: 2010-01-22 20:02:48 +0100 (Fri, 22 Jan 2010)
New Revision: 158
Modified:
pkg/R/wa.R
Log:
Tidying WA code to match R standards for indenting
Modified: pkg/R/wa.R
===================================================================
--- pkg/R/wa.R 2010-01-18 19:04:17 UTC (rev 157)
+++ pkg/R/wa.R 2010-01-22 19:02:48 UTC (rev 158)
@@ -1,12 +1,12 @@
`wa` <- function(x, ...) UseMethod("wa")
`wa.default` <-
- function(x, env,
- deshrink = c("inverse", "classical", "expanded", "none"),
- tol.dw = FALSE, useN2 = TRUE,
- na.tol = c("min","mean","max"),
- small.tol = c("min","fraction","absolute"),
- min.tol = NULL, f = 0.1, ...)
+ function(x, env,
+ deshrink = c("inverse", "classical", "expanded", "none"),
+ tol.dw = FALSE, useN2 = TRUE,
+ na.tol = c("min","mean","max"),
+ small.tol = c("min","fraction","absolute"),
+ min.tol = NULL, f = 0.1, ...)
{
## x = species abundances (weights), env = response vector
x <- as.matrix(x)
@@ -42,9 +42,9 @@
min.tol = min.tol, f = f, env = env)
## calculate WA estimate of env for each site
wa.env <- if(tol.dw) {
- WATpred(x, wa.optima, tol, n.samp, n.spp)
+ WATpred(x, wa.optima, tol, n.samp, n.spp)
} else {
- WApred(x, wa.optima)
+ WApred(x, wa.optima)
}
## taken averages twice so deshrink
expanded <- deshrink(env, wa.env, type = deshrink)
More information about the Analogue-commits
mailing list