[Vegan-commits] r2872 - in pkg/ordiconsensus: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 6 12:21:43 CEST 2014


Author: gblanchet
Date: 2014-06-06 12:21:42 +0200 (Fri, 06 Jun 2014)
New Revision: 2872

Modified:
   pkg/ordiconsensus/DESCRIPTION
   pkg/ordiconsensus/man/coeffCompare.Rd
   pkg/ordiconsensus/man/consensusRDA.Rd
   pkg/ordiconsensus/man/simulSADcomm.Rd
Log:
ordiconsensus is now CRAN ready... I hope

Modified: pkg/ordiconsensus/DESCRIPTION
===================================================================
--- pkg/ordiconsensus/DESCRIPTION	2014-06-06 06:48:05 UTC (rev 2871)
+++ pkg/ordiconsensus/DESCRIPTION	2014-06-06 10:21:42 UTC (rev 2872)
@@ -1,11 +1,13 @@
 Package: ordiconsensus
 Type: Package
 Title: Consensus of canonical ordinations through the canonical redundancy analysis
-Version: 0.4
+Version: 1.0
 Date: 2012-11-09
 Author: F. Guillaume Blanchet
 Maintainer: F. Guillaume Blanchet <guillaume.blanchet at helsinki.fi>
-Description: This package include function to calculate a consensus of canonical redundancy analyses performed using different association coefficients
 Depends: vegan
 Suggests: FactoMineR
-License: GPL-2
+Description: This package include function to calculate a consensus of canonical redundancy analyses performed using different association coefficients
+License: GPL (>= 2)
+Repository/R-Forge/Project: vegan
+NeedsCompilation: no

Modified: pkg/ordiconsensus/man/coeffCompare.Rd
===================================================================
--- pkg/ordiconsensus/man/coeffCompare.Rd	2014-06-06 06:48:05 UTC (rev 2871)
+++ pkg/ordiconsensus/man/coeffCompare.Rd	2014-06-06 10:21:42 UTC (rev 2872)
@@ -67,22 +67,31 @@
 ordiRes[[4]]<-rda(chisq~.,data=beetle.expl)
 
 ### db-RDA Bray-Curtis
-ordiRes[[5]]<-capscale(sqrt(vegdist(beetle,method="bray"))~.,data=beetle.expl,comm=beetle)
+bray<-sqrt(vegdist(beetle,method="bray"))
+ordiRes[[5]]<-capscale(bray~.,data=beetle.expl,comm=beetle)
 	
 ### db-RDA square-root Bray-Curtis
-ordiRes[[6]]<-capscale(sqrt(vegdist(beetle^0.5,method="bray"))~.,data=beetle.expl,comm=beetle)
+bray.sqrt<-sqrt(vegdist(beetle^0.5,method="bray"))
+ordiRes[[6]]<-capscale(bray.sqrt~.,data=beetle.expl,comm=beetle^0.5)
 	
 ### db-RDA fourth-root Bray-Curtis
-ordiRes[[7]]<-capscale(sqrt(vegdist(beetle^0.25,method="bray"))~.,data=beetle.expl,comm=beetle)
+bray.fort<-sqrt(vegdist(beetle^0.25,method="bray"))
+ordiRes[[7]]<-capscale(bray.fort~.,data=beetle.expl,comm=beetle^0.25)
 	
 ### db-RDA modified Gower log 2
-ordiRes[[8]]<-capscale(vegdist(decostand(beetle, "log",logbase=2), "altGower")~.,data=beetle.expl,comm=beetle) ### Warning message stem from log transformation of 0
+beetleLog2<-decostand(beetle, "log",logbase=2)
+mGowerLog2<-vegdist(beetleLog2, "altGower")
+ordiRes[[8]]<-capscale(mGowerLog2~.,data=beetle.expl,comm=beetleLog2)
 	
 ### db-RDA modified Gower log 5
-ordiRes[[9]]<-capscale(vegdist(decostand(beetle, "log",logbase=5), "altGower")~.,data=beetle.expl,comm=beetle) ### Warning message stem from log transformation of 0
+beetleLog5<-decostand(beetle, "log",logbase=5)
+mGowerLog5<-vegdist(beetleLog5, "altGower")
+ordiRes[[9]]<-capscale(mGowerLog5~.,data=beetle.expl,comm=beetleLog5)
 	
 ### db-RDA modified Gower log 10
-ordiRes[[10]]<-capscale(vegdist(decostand(beetle, "log",logbase=10), "altGower")~.,data=beetle.expl,comm=beetle) ### Warning message stem from log transformation of 0
+beetleLog10<-decostand(beetle, "log",logbase=10)
+mGowerLog10<-vegdist(beetleLog10, "altGower")
+ordiRes[[10]]<-capscale(mGowerLog10~.,data=beetle.expl,comm=beetleLog10)
 
 ### Compare association coefficients
 AssoComp<-coeffCompare(ordiRes,rep(7,ndis))
@@ -91,7 +100,8 @@
 ### Draw a graphic to visualize the comparison
 #---------------------------------------------
 ### Name of association coefficient compared
-name<-c("Species profiles","Chord","Hellinger","Chi2","Bray-Curtis","(Bray-Curtis)^0.5","(Bray-Curtis)^0.25","mGowerlog2","mGowerlog5","mGowerlog10")
+name<-c("Species profiles","Chord","Hellinger","Chi2","Bray-Curtis",
+"(Bray-Curtis)^0.5","(Bray-Curtis)^0.25","mGowerlog2","mGowerlog5","mGowerlog10")
 
 plot(AssoComp$mst,type="t",labels=name,xlab="",ylab="",main="MST Sites scores")
 

Modified: pkg/ordiconsensus/man/consensusRDA.Rd
===================================================================
--- pkg/ordiconsensus/man/consensusRDA.Rd	2014-06-06 06:48:05 UTC (rev 2871)
+++ pkg/ordiconsensus/man/consensusRDA.Rd	2014-06-06 10:21:42 UTC (rev 2872)
@@ -71,44 +71,61 @@
 ordiRes[[3]]<-rda(hell~.,data=beetle.expl)
 
 ### db-RDA Bray-Curtis
-ordiRes[[4]]<-capscale(sqrt(vegdist(beetle,method="bray"))~.,data=beetle.expl,comm=beetle)
+bray<-sqrt(vegdist(beetle,method="bray"))
+ordiRes[[4]]<-capscale(bray~.,data=beetle.expl,comm=beetle)
 	
 ### db-RDA square-root Bray-Curtis
-ordiRes[[5]]<-capscale(sqrt(vegdist(beetle^0.5,method="bray"))~.,data=beetle.expl,comm=beetle^0.5)
+bray.sqrt<-sqrt(vegdist(beetle^0.5,method="bray"))
+ordiRes[[5]]<-capscale(bray.sqrt~.,data=beetle.expl,comm=beetle^0.5)
 	
 ### db-RDA fourth-root Bray-Curtis
-ordiRes[[6]]<-capscale(sqrt(vegdist(beetle^0.25,method="bray"))~.,data=beetle.expl,comm=beetle^0.25)
+bray.fort<-sqrt(vegdist(beetle^0.25,method="bray"))
+ordiRes[[6]]<-capscale(bray.fort~.,data=beetle.expl,comm=beetle^0.25)
 	
 ### db-RDA modified Gower log 2
-ordiRes[[7]]<-capscale(vegdist(decostand(beetle, "log",logbase=2), "altGower")~.,data=beetle.expl,comm=decostand(beetle, "log",logbase=2)) ### Warning message stem from log transformation of 0
+beetleLog2<-decostand(beetle, "log",logbase=2)
+mGowerLog2<-vegdist(beetleLog2, "altGower")
+ordiRes[[7]]<-capscale(mGowerLog2~.,data=beetle.expl,comm=beetleLog2)
 	
 ### db-RDA modified Gower log 5
-ordiRes[[8]]<-capscale(vegdist(decostand(beetle, "log",logbase=5), "altGower")~.,data=beetle.expl,comm=decostand(beetle, "log",logbase=5)) ### Warning message stem from log transformation of 0
+beetleLog5<-decostand(beetle, "log",logbase=5)
+mGowerLog5<-vegdist(beetleLog5, "altGower")
+ordiRes[[8]]<-capscale(mGowerLog5~.,data=beetle.expl,comm=beetleLog5)
 	
 ### db-RDA modified Gower log 10
-ordiRes[[9]]<-capscale(vegdist(decostand(beetle, "log",logbase=10), "altGower")~.,data=beetle.expl,comm=decostand(beetle, "log",logbase=10)) ### Warning message stem from log transformation of 0
+beetleLog10<-decostand(beetle, "log",logbase=10)
+mGowerLog10<-vegdist(beetleLog10, "altGower")
+ordiRes[[9]]<-capscale(mGowerLog10~.,data=beetle.expl,comm=beetleLog10)
 
 #----------------
 ### Test RDA axis 
 #----------------
 ordiResTest<-vector("list",length=ndis)
 
+\dontrun{
 for(i in 1:ndis){
-	ordiResTest[[i]]<-anova.cca(ordiRes[[i]],by="axis",cutoff=0.1)
+	ordiResTest[[i]]<-anova.cca(ordiRes[[i]],by="axis",cutoff=0.1,perm.max=100)
 }
+}
 
+ordiResTest<-c(3,3,4,4,4,4,3,4,4) ## This output is an alternative to the previous code
+
+
 ### Consensus RDA
 consRDA<-consensusRDA(ordiRes,ordiResTest,beetle,beetle.expl)
 summary(consRDA)
-axisLabels<-c(paste("Axis 1 - ",round(consRDA$values[1]/sum(consRDA$values),4)*100,sep=""),paste("Axis 2 - ",round(consRDA$values[2]/sum(consRDA$values),4)*100,sep=""))
+XaxisLabels<-paste("Axis 1 - ",round(consRDA$values[1]/sum(consRDA$values),4)*100,sep="")
+YaxisLabels<-paste("Axis 2 - ",round(consRDA$values[2]/sum(consRDA$values),4)*100,sep="")
 
-plot(consRDA$siteConsensus[,1:2],pch=19,xlab=axisLabels[1],ylab=axisLabels[2],las=1)
+plot(consRDA$siteConsensus[,1:2],pch=19,xlab=XaxisLabels,ylab=YaxisLabels,las=1)
 abline(h=0,v=0,lty=3)
 
-arrows(0,0,consRDA$spConsensus[,1]*10,consRDA$spConsensus[,2]*10,col="red",length=0.1,angle=12)
+arrows(0,0,consRDA$spConsensus[,1]*10,consRDA$spConsensus[,2]*10,
+       col="red",length=0.1,angle=12)
 text(consRDA$spConsensus[,1:2]*10,labels=rownames(consRDA$spConsensus),col="red")
 
-arrows(0,0,consRDA$descConsensus[,1]*0.4,consRDA$descConsensus[,2]*0.4,col="blue",length=0.1,angle=12)
+arrows(0,0,consRDA$descConsensus[,1]*0.4,consRDA$descConsensus[,2]*0.4,
+      col="blue",length=0.1,angle=12)
 text(consRDA$descConsensus[,1:2]*0.4,labels=rownames(consRDA$descConsensus),col="blue")
 
 }

Modified: pkg/ordiconsensus/man/simulSADcomm.Rd
===================================================================
--- pkg/ordiconsensus/man/simulSADcomm.Rd	2014-06-06 06:48:05 UTC (rev 2871)
+++ pkg/ordiconsensus/man/simulSADcomm.Rd	2014-06-06 10:21:42 UTC (rev 2872)
@@ -6,7 +6,9 @@
 \description{
 This function simulates community matrices with the same species abundance distribution following patterns defined by a set of explanatory variables. This function was used to simulate community matrices in Blanchet et al. (In press)}
 \usage{
-simulSADcomm(sp.abund, expl.var, expl.rand.sel = TRUE, nexpl.comb = 2, binary = FALSE, fix.expl = NULL, nsite = 50, weight = NULL, range.weight = c(0, 2), sd.expl = FALSE, norm = c(0, 1))
+simulSADcomm(sp.abund, expl.var, expl.rand.sel = TRUE, nexpl.comb = 2, 
+             binary = FALSE, fix.expl = NULL, nsite = 50, weight = NULL, 
+             range.weight = c(0, 2), sd.expl = FALSE, norm = c(0, 1))
 }
 \arguments{
   \item{sp.abund}{



More information about the Vegan-commits mailing list