[Vegan-commits] r1597 - in branches/1.17: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 29 11:00:53 CEST 2011


Author: jarioksa
Date: 2011-04-29 11:00:53 +0200 (Fri, 29 Apr 2011)
New Revision: 1597

Added:
   branches/1.17/R/nobs.R
   branches/1.17/man/nobs.adonis.Rd
Modified:
   branches/1.17/DESCRIPTION
   branches/1.17/inst/ChangeLog
Log:
ported nobs() to vegan_1.17-11 tree

Modified: branches/1.17/DESCRIPTION
===================================================================
--- branches/1.17/DESCRIPTION	2011-04-27 18:19:47 UTC (rev 1596)
+++ branches/1.17/DESCRIPTION	2011-04-29 09:00:53 UTC (rev 1597)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.17-10
-Date: April 27, 2011
+Version: 1.17-11
+Date: April 29, 2011
 Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, 
    R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens, 
    Helene Wagner  

Copied: branches/1.17/R/nobs.R (from rev 1596, pkg/vegan/R/nobs.R)
===================================================================
--- branches/1.17/R/nobs.R	                        (rev 0)
+++ branches/1.17/R/nobs.R	2011-04-29 09:00:53 UTC (rev 1597)
@@ -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: branches/1.17/inst/ChangeLog
===================================================================
--- branches/1.17/inst/ChangeLog	2011-04-27 18:19:47 UTC (rev 1596)
+++ branches/1.17/inst/ChangeLog	2011-04-29 09:00:53 UTC (rev 1597)
@@ -2,8 +2,12 @@
 
 VEGAN RELEASE VERSIONS at http://cran.r-project.org/
 
-Version 1.17-10 (opened April 10, 2011)
+Version 1.17-11 (opened April 29, 2011)
 
+	* nobs: copied nobs() methods for vegan from r1596.
+	
+Version 1.17-10 (released April 27, 2011)
+
 	* merged 1591:R 2.14.0 test warnings in decision-vegan.Rnw.
 
 	* merged r1590: capscale failed in rank-deficit cases with option

Copied: branches/1.17/man/nobs.adonis.Rd (from rev 1596, pkg/vegan/man/nobs.adonis.Rd)
===================================================================
--- branches/1.17/man/nobs.adonis.Rd	                        (rev 0)
+++ branches/1.17/man/nobs.adonis.Rd	2011-04-29 09:00:53 UTC (rev 1597)
@@ -0,0 +1,49 @@
+\name{nobs.adonis}
+\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{
+  Extract the Number of Observations from a vegan Fit.
+}
+\description{
+  Extract the number of \sQuote{observations} from a \pkg{vegan} model fit.
+}
+\usage{
+\method{nobs}{adonis}(object, ...)
+}
+
+\arguments{
+  \item{object}{
+    A fitted model object.
+}
+  \item{\dots}{
+   Further arguments to be passed to methods.
+}
+}
+
+\details{ Function \code{nobs} is generic in \R version 2.13.0, and
+  \pkg{vegan} provides methods for objects from \code{\link{adonis}},
+  \code{\link{betadisper}}, \code{\link{cca}} and other related
+  methods, \code{\link{CCorA}}, \code{\link{decorana}},
+  \code{\link{isomap}}, \code{\link{metaMDS}}, \code{\link{pcnm}},
+  \code{\link{procrustes}}, \code{\link{radfit}},
+  \code{\link{varpart}} and \code{\link{wcmdscale}}.  } \value{ A
+  single number, normally an interger, giving the number of
+  observations.  }
+
+\author{
+  Jari Oksanen
+}
+
+\keyword{models}
+



More information about the Vegan-commits mailing list