[Vegan-commits] r1508 - in pkg/vegan: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 24 15:27:01 CET 2011


Author: jarioksa
Date: 2011-02-24 15:27:01 +0100 (Thu, 24 Feb 2011)
New Revision: 1508

Added:
   pkg/vegan/R/nobs.R
Modified:
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/vegan-internal.Rd
Log:
nobs() methods for vegan classes

Added: pkg/vegan/R/nobs.R
===================================================================
--- pkg/vegan/R/nobs.R	                        (rev 0)
+++ pkg/vegan/R/nobs.R	2011-02-24 14:27:01 UTC (rev 1508)
@@ -0,0 +1,28 @@
+### R 2.13.0 introduces nobs() method to get the number of
+### observations. This file provides methods for vegan classes.
+
+`nobs.adonis` <- function(object, ...) NROW(object$coef.sites)
+
+`nobs.betadisper` <- function(object, ...) length(object$distances)
+
+`nobs.cca` <- function(object, ...) max(NROW(object$pCCA$u),
+                                        NROW(object$CCA$u),
+                                        NROW(object$CA$u))
+
+`nobs.CCorA` <- function(object, ...) NROW(object$Cy)
+
+`nobs.decorana` <- function(object, ...) NROW(object$rproj)
+
+`nobs.isomap` <- function(object, ...) NROW(object$points)
+
+`nobs.metaMDS` <- function(object, ...) NROW(object$points)
+
+`nobs.pcnm` <- function(object, ...) NROW(object$vectors)
+
+`nobs.procrustes` <- function(object, ...) NROW(object$X)
+
+`nobs.rad` <- function(object, ...) length(object$y)
+
+`nobs.varpart` <- function(object, ...) object$part$n
+
+`nobs.wcmdscale` <- function(object, ...) NROW(object$points)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-02-23 09:37:51 UTC (rev 1507)
+++ pkg/vegan/inst/ChangeLog	2011-02-24 14:27:01 UTC (rev 1508)
@@ -50,6 +50,13 @@
 	(use approx to get average predictions?) and the very natural link
 	to fitspecaccum models.
 
+	* nobs: R 2.13.0 will introduce new generic nobs() that will
+	return the number of observations. This is at least needed in
+	functions to evaluate BIC and in step() and functions it
+	calls. Implemented nobs() for several vegan classes -- some of
+	these may be unnecessary. Not yet documented but aliases in
+	vegan-internal.Rd. 
+
 	* FAQ updates: using 'select' in ordination text() and points(),
 	using 'xlim' to flip axes or zoom into ordination plot(), the
 	non-effects of 'strata' in adonis(). All these indeed are

Modified: pkg/vegan/man/vegan-internal.Rd
===================================================================
--- pkg/vegan/man/vegan-internal.Rd	2011-02-23 09:37:51 UTC (rev 1507)
+++ pkg/vegan/man/vegan-internal.Rd	2011-02-24 14:27:01 UTC (rev 1508)
@@ -10,6 +10,19 @@
 \alias{ordiArrowMul}
 \alias{ordiArgAbsorber}
 \alias{veganCovEllipse}
+\alias{nobs.adonis}
+\alias{nobs.betadisper}
+\alias{nobs.cca}
+\alias{nobs.CCorA}
+\alias{nobs.decorana}
+\alias{nobs.isomap}
+\alias{nobs.metaMDS}
+\alias{nobs.pcnm}
+\alias{nobs.procrustes}
+\alias{nobs.rad}
+\alias{nobs.varpart}
+\alias{nobs.wcmdscale}
+
 \title{Internal vegan functions}
 
 \description{



More information about the Vegan-commits mailing list