[Vegan-commits] r2961 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 16 13:20:45 CEST 2015
Author: jarioksa
Date: 2015-09-16 13:20:43 +0200 (Wed, 16 Sep 2015)
New Revision: 2961
Modified:
pkg/vegan/R/scalingUtils.R
Log:
Merge branch 'cran-2.3' into r-forge-svn-local
Modified: pkg/vegan/R/scalingUtils.R
===================================================================
--- pkg/vegan/R/scalingUtils.R 2015-09-15 07:23:30 UTC (rev 2960)
+++ pkg/vegan/R/scalingUtils.R 2015-09-16 11:20:43 UTC (rev 2961)
@@ -6,7 +6,12 @@
##' @param correlation logical; should correlation-like scores be returned?
##' @param hill logical; should Hill's scaling scores be returned?
`scalingType` <- function(scaling = c("none", "sites", "species", "symmetric"),
- correlation = FALSE, hill = FALSE) {
+ correlation = FALSE, hill = FALSE)
+{
+ ## numeric scaling: return as-is
+ if (is.numeric(scaling))
+ return(scaling)
+ ## non-numeric scaling: change to numeric
tab <- c("none", "sites", "species", "symmetric")
scaling <- match.arg(scaling)
scl <- match(scaling, tab) - 1 # -1 as none == scaling 0
More information about the Vegan-commits
mailing list