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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 23 15:14:09 CEST 2009


Author: jarioksa
Date: 2009-08-23 15:14:07 +0200 (Sun, 23 Aug 2009)
New Revision: 942

Modified:
   pkg/vegan/DESCRIPTION
   pkg/vegan/R/mantel.correlog.R
   pkg/vegan/R/plot.mantel.correlog.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/mantel.correlog.Rd
Log:
Pierre Legendre's update 1.4 of mantel.corelog incorporated into vegan

Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION	2009-08-23 06:25:16 UTC (rev 941)
+++ pkg/vegan/DESCRIPTION	2009-08-23 13:14:07 UTC (rev 942)
@@ -1,7 +1,7 @@
 Package: vegan
 Title: Community Ecology Package
-Version: 1.16-24
-Date: August 17, 2009
+Version: 1.16-25
+Date: August 23, 2009
 Author: Jari Oksanen, Roeland Kindt, Pierre Legendre, Bob O'Hara, Gavin L. Simpson, 
    Peter Solymos, M. Henry H. Stevens, Helene Wagner  
 Maintainer: Jari Oksanen <jari.oksanen at oulu.fi>

Modified: pkg/vegan/R/mantel.correlog.R
===================================================================
--- pkg/vegan/R/mantel.correlog.R	2009-08-23 06:25:16 UTC (rev 941)
+++ pkg/vegan/R/mantel.correlog.R	2009-08-23 13:14:07 UTC (rev 942)
@@ -47,7 +47,8 @@
 	}
 half.cl = n.class %/% 2
 
-# Move the first breakpoint a little bit to the leftepsilon <- .Machine$double.eps
+# Move the first breakpoint a little bit to the left
+epsilon <- .Machine$double.eps
 break.pts[1] = break.pts[1] - epsilon   
 
 # Find the break points and the class indices
@@ -105,7 +106,7 @@
 n.tests = length(which(mantel.p != "NA"))
 
 if(mult=="none") {
-	colnames(mantel.res) = c("class.index", "n.dist", "Mantel.r", "Pr(Mantel)")
+	colnames(mantel.res) = c("class.index", "n.dist", "Mantel.cor", "Pr(Mantel)")
 	} else {	
 	## Correct P-values for multiple testing
 		if(progressive) {
@@ -128,7 +129,7 @@
 	    	}
 	temp = c(p.corr, rep(NA,(n.class-n.tests)))
 	mantel.res = cbind(mantel.res, temp)
-	colnames(mantel.res) = c("class.index", "n.dist", "Mantel.r", "Pr(Mantel)", "Pr(corrected)")
+	colnames(mantel.res) = c("class.index", "n.dist", "Mantel.cor", "Pr(Mantel)", "Pr(corrected)")
 	}
 rownames(mantel.res) = rownames(mantel.res,do.NULL = FALSE, prefix = "D.cl.")
 

Modified: pkg/vegan/R/plot.mantel.correlog.R
===================================================================
--- pkg/vegan/R/plot.mantel.correlog.R	2009-08-23 06:25:16 UTC (rev 941)
+++ pkg/vegan/R/plot.mantel.correlog.R	2009-08-23 13:14:07 UTC (rev 942)
@@ -1,7 +1,7 @@
 'plot.mantel.correlog' <- function(x, alpha=0.05, ...)
 {
 lim = max(x$n.tests)
-plot(x$mantel.res[1:lim,1],x$mantel.res[1:lim,3], xlab="Distance class index", ylab="Mantel r", pch=22)
+plot(x$mantel.res[1:lim,1],x$mantel.res[1:lim,3], xlab="Distance class index", ylab="Mantel correlation", pch=22)
 if(x$mult=="none") {
 	signif = which((x$mantel.res[1:lim,4] <= alpha))
 	} else {

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-08-23 06:25:16 UTC (rev 941)
+++ pkg/vegan/inst/ChangeLog	2009-08-23 13:14:07 UTC (rev 942)
@@ -2,6 +2,11 @@
 
 VEGAN DEVEL VERSIONS at http://r-forge.r-project.org/
 
+Version 1.16-25 (opened August 23, 2009)
+
+	* mantel.correlog: updated to the version 1.4 of Pierre Legendre's
+	package. 
+
 Version 1.16-24 (opened August 17, 2009)
 
 	* ordiellipse & ordihull: gained new argument 'label' to put the

Modified: pkg/vegan/man/mantel.correlog.Rd
===================================================================
--- pkg/vegan/man/mantel.correlog.Rd	2009-08-23 06:25:16 UTC (rev 941)
+++ pkg/vegan/man/mantel.correlog.Rd	2009-08-23 13:14:07 UTC (rev 942)
@@ -30,16 +30,17 @@
 }
 
 \details{
-The Mantel tests are computed by \code{vegan}'s function \code{\link{mantel}}. 
+A correlogram is a graph in which spatial correlation values are plotted, on the
+ordinate, as a function of the geographic distance classes among the study sites along the abscissa. In a Mantel correlogram, a Mantel correlation (Mantel 1967) is computed between a multivariate (e.g. multi-species) distance matrix of the user's choice and a design matrix representing each of the geographic distance classes in turn. The Mantel statistic is tested through a permutational Mantel test performed by \code{vegan}'s \code{\link{mantel}} function. 
 
 When a correction for multiple testing is applied, more permutations are necessary than in the no-correction case, to obtain significant p-values in the higher correlogram classes.
 
-The \code{print.mantel.correlog} function prints out the correlogram. See example.
+The \code{print.mantel.correlog} function prints out the correlogram. See examples.
 }
 
 \value{ 
 
-  \item{mantel.res }{A table with the distance classes as rows and the class indices, number of distances per class, Mantel statistics, and p-values as columns. A positive Mantel statistic indicates positive spatial correlation. }
+  \item{mantel.res }{A table with the distance classes as rows and the class indices, number of distances per class, Mantel statistics (computed using Pearson's r, Spearman's r, or Kendall's tau), and p-values as columns. A positive Mantel statistic indicates positive spatial correlation. An additional column with p-values corrected for multiple testing is added unless \code{mult="none"}. }
   \item{n.class }{The number of distance classes. }  
   \item{break.pts }{The break points provided by the user or computed by the program. }  
   \item{mult }{The name of the correction for multiple testing. No correction: \code{mult="none"}. }  
@@ -53,6 +54,8 @@
 \references{ 
 Legendre, P. and L. Legendre. 1998. Numerical ecology, 2nd English edition. Elsevier Science BV, Amsterdam.
 
+Mantel, N. 1967. The detection of disease clustering and a generalized regression approach. Cancer Res. 27: 209-220.
+
 Oden, N. L. and R. R. Sokal. 1986. Directional autocorrelation: an extension of spatial correlograms to two dimensions. Syst. Zool. 35: 608-617.
 
 Sokal, R. R. 1986. Spatial data analysis and historical processes. 29-43 in: E. Diday et al. [eds.] Data analysis and informatics, IV. North-Holland, Amsterdam.
@@ -78,6 +81,12 @@
 mite.correlog2
 plot(mite.correlog2)
 
+# Mite correlogram after spatially detrending the mite data
+mite.h.det <- resid(lm(as.matrix(mite.hel.D) ~ ., data=mite.xy))
+mite.correlog3 = mantel.correlog(mite.h.det, XY=mite.xy, nperm=99)
+mite.correlog3
+plot(mite.correlog3)
+
 }
 
 \keyword{ multivariate }
\ No newline at end of file



More information about the Vegan-commits mailing list