[Vegan-commits] r1743 - in pkg: permute permute/R vegan

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 23 15:10:26 CEST 2011


Author: jarioksa
Date: 2011-08-23 15:10:25 +0200 (Tue, 23 Aug 2011)
New Revision: 1743

Modified:
   pkg/permute/NAMESPACE
   pkg/permute/R/nobs-methods.R
   pkg/vegan/NAMESPACE
Log:
make work with R < 2.13.0

Modified: pkg/permute/NAMESPACE
===================================================================
--- pkg/permute/NAMESPACE	2011-08-23 13:09:35 UTC (rev 1742)
+++ pkg/permute/NAMESPACE	2011-08-23 13:10:25 UTC (rev 1743)
@@ -5,8 +5,13 @@
        `getBlocks`, `getWithin`, `getStrata`,
        `shuffleSet`)
 
-### Imports
-importFrom(`stats`, `nobs`)
+### Imports: nobs() only exists in R 2.13.0 for import. We define the
+### same nobs() generic in permute for export in older R.
+if (getRversion() >= "2.13.0") {
+    importFrom(`stats`, `nobs`)
+} else {
+    export(nobs)
+}
 
 ### S3 Methods
 ## print methods

Modified: pkg/permute/R/nobs-methods.R
===================================================================
--- pkg/permute/R/nobs-methods.R	2011-08-23 13:09:35 UTC (rev 1742)
+++ pkg/permute/R/nobs-methods.R	2011-08-23 13:10:25 UTC (rev 1743)
@@ -1,3 +1,7 @@
+## nobs generic is defined only in R 2.13.0: define here for older R
+if (getRversion() < "2.13.0")
+    nobs <- function(object, ...) UseMethod("nobs")
+
 ## add some nobs() methods - need to be documented
 `nobs.numeric` <- function(object, ...) {
     length(object)

Modified: pkg/vegan/NAMESPACE
===================================================================
--- pkg/vegan/NAMESPACE	2011-08-23 13:09:35 UTC (rev 1742)
+++ pkg/vegan/NAMESPACE	2011-08-23 13:10:25 UTC (rev 1743)
@@ -60,6 +60,10 @@
 import(graphics)
 importFrom(utils, head, tail)
 importFrom(lattice, densityplot)
+## nobs only exists in R 2.13.0 -- import from permute with older R
+if (getRversion() < "2.13.0") {
+    importFrom(permute, nobs)
+}
 # AIC: stats
 S3method(AIC, radfit)
 # RsquareAdj: vegan



More information about the Vegan-commits mailing list