[Vegan-commits] r1640 - in pkg/permute: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Jun 18 00:55:34 CEST 2011
Author: gsimpson
Date: 2011-06-18 00:55:34 +0200 (Sat, 18 Jun 2011)
New Revision: 1640
Modified:
pkg/permute/R/getNumObs.R
pkg/permute/man/getNumObs.Rd
Log:
start adding nobs() methods
Modified: pkg/permute/R/getNumObs.R
===================================================================
--- pkg/permute/R/getNumObs.R 2011-06-17 22:54:49 UTC (rev 1639)
+++ pkg/permute/R/getNumObs.R 2011-06-17 22:55:34 UTC (rev 1640)
@@ -14,3 +14,20 @@
{
getNumObs.numeric(object)
}
+
+## add some nobs() methods - need to be documented
+`nobs.numeric` <- function(object, ...) {
+ length(object)
+}
+
+`nobs.integer` <- function(object, ...) {
+ nobs.numeric(object, ...)
+}
+
+`nobs.matrix` <- function(object, ...) {
+ NROW(object)
+}
+
+`nobs.cca` <- function(object, ...) {
+ NROW(scores(object, display = "sites"))
+}
Modified: pkg/permute/man/getNumObs.Rd
===================================================================
--- pkg/permute/man/getNumObs.Rd 2011-06-17 22:54:49 UTC (rev 1639)
+++ pkg/permute/man/getNumObs.Rd 2011-06-17 22:55:34 UTC (rev 1640)
@@ -3,6 +3,10 @@
\alias{getNumObs.default}
\alias{getNumObs.integer}
\alias{getNumObs.numeric}
+\alias{nobs.numeric}
+\alias{nobs.integer}
+\alias{nobs.matrix}
+\alias{nobs.cca}
\title{Number of observations in a given object}
\description{
More information about the Vegan-commits
mailing list