[Esm-commits] r47 - in pkg/ESM: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 11 19:50:33 CEST 2011


Author: timotheepoisot
Date: 2011-06-11 19:50:33 +0200 (Sat, 11 Jun 2011)
New Revision: 47

Modified:
   pkg/ESM/DESCRIPTION
   pkg/ESM/R/graphics.r
Log:


Modified: pkg/ESM/DESCRIPTION
===================================================================
--- pkg/ESM/DESCRIPTION	2011-05-29 17:24:36 UTC (rev 46)
+++ pkg/ESM/DESCRIPTION	2011-06-11 17:50:33 UTC (rev 47)
@@ -1,6 +1,6 @@
 Package: ESM
-Version: 2.0.3-01
-Date: 2011-01-17
+Version: 2.0.3-02
+Date: 2011-06-11
 Title: Ecological Specificity Measures
 Author: Timothee Poisot <tpoisot at um2.fr>
 Maintainer: Timothee Poisot <tpoisot at um2.fr>

Modified: pkg/ESM/R/graphics.r
===================================================================
--- pkg/ESM/R/graphics.r	2011-05-29 17:24:36 UTC (rev 46)
+++ pkg/ESM/R/graphics.r	2011-06-11 17:50:33 UTC (rev 47)
@@ -92,4 +92,22 @@
 	axis(1,at=c(1:nc)-0.5,labels=colnames(web),tick=FALSE,crt=45,cex=1)
 	axis(2,at=c(1:nr)-0.5,labels=rownames(web),tick=FALSE,crt=45,cex=0.2)
 	par(op)
+}
+
+plotspe = function(x,...,palette=rainbow)
+{
+	spe <- getspe(x,...)
+	xs <- scale(c(1:ncol(x))/ncol(x),0,1)
+	
+	Colors <- palette(21)
+	spe <- round(spe*20,0)+1
+	
+	par(xaxs='i',yaxs='i')
+	plot(0,pch=NA,ylim=c(0,1),xlim=range(xs))
+	polygon(x=c(0,1,0),y=c(0,0,1),border=NA,col='lightgrey')
+	for(i in 1:nrow(x))
+	{
+		lines(xs,sort(x[i,]/max(x[i,]),decreasing=TRUE),lwd=2,col=Colors[spe[i]])
+	}
+	par(xaxs='r',yaxs='r')
 }
\ No newline at end of file



More information about the Esm-commits mailing list