[Picante-commits] r185 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 25 01:19:24 CEST 2009


Author: skembel
Date: 2009-04-25 01:19:24 +0200 (Sat, 25 Apr 2009)
New Revision: 185

Modified:
   pkg/R/phylodiversity.R
   pkg/R/species.dist.R
Log:
Fix incomplete switch from roij to doij causing errors

Modified: pkg/R/phylodiversity.R
===================================================================
--- pkg/R/phylodiversity.R	2009-04-03 19:45:07 UTC (rev 184)
+++ pkg/R/phylodiversity.R	2009-04-24 23:19:24 UTC (rev 185)
@@ -1,5 +1,5 @@
 `comm.phylo.cor` <-
-function(samp,phylo,metric=c("cij","checkerboard","jaccard","roij"),
+function(samp,phylo,metric=c("cij","checkerboard","jaccard","doij"),
 		null.model=c("sample.taxa.labels","pool.taxa.labels",
 					"frequency","richness","independentswap","trialswap"),
 					runs=999, ...)

Modified: pkg/R/species.dist.R
===================================================================
--- pkg/R/species.dist.R	2009-04-03 19:45:07 UTC (rev 184)
+++ pkg/R/species.dist.R	2009-04-24 23:19:24 UTC (rev 185)
@@ -32,13 +32,13 @@
         Nsites <- dim(x)[1]
         P <- apply(x,2,sum) / Nsites
         N <- length(P)
-        roij <- matrix(nrow=N,ncol=N,dimnames=list(colnames(x),colnames(x)))
+        doij <- matrix(nrow=N,ncol=N,dimnames=list(colnames(x),colnames(x)))
         for (i in 1:N-1) {
             for (j in (i+1):N) {
                 Pij <- sum(x[,i]*x[,j])/Nsites
-                roij[i,j] <- ((Pij - (P[i]*P[j]))/(P[i]*P[j]))
+                doij[i,j] <- ((Pij - (P[i]*P[j]))/(P[i]*P[j]))
             }
         }
-        return(as.dist(t(roij)))
+        return(as.dist(t(doij)))
     }
 }



More information about the Picante-commits mailing list