[Vegan-commits] r2678 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 8 11:40:12 CET 2013


Author: jarioksa
Date: 2013-11-08 11:40:12 +0100 (Fri, 08 Nov 2013)
New Revision: 2678

Modified:
   pkg/vegan/R/plot.renyiaccum.R
   pkg/vegan/inst/ChangeLog
Log:
fix plotting renyiaccum when only one index was used

Modified: pkg/vegan/R/plot.renyiaccum.R
===================================================================
--- pkg/vegan/R/plot.renyiaccum.R	2013-11-08 03:11:50 UTC (rev 2677)
+++ pkg/vegan/R/plot.renyiaccum.R	2013-11-08 10:40:12 UTC (rev 2678)
@@ -2,11 +2,12 @@
 function (x, what=c("mean", "Qnt 0.025", "Qnt 0.975"), type = "l", ...) 
 {
 	if (any(what %in% colnames(x[,1,])))
-	    x <- x[,,what]
+	    x <- x[,,what, drop = FALSE]
 	dm <- dim(x)
-	lin <- rep(colnames(x[,1,]), each=dm[1]*dm[2])
+        dnam <- dimnames(x)
+	lin <- rep(dnam[[3]], each=dm[1]*dm[2])
 	Sites <- rep(1:dm[1], len=prod(dm))
-	alp <- factor(rownames(x[1,,]), levels=rownames(x[1,,]))
+	alp <- factor(dnam[[2]], levels=dnam[[2]])
 	alpha <- rep(rep(alp, each=dm[1]), len=prod(dm))
 	Diversity <- as.vector(x)
 	xyplot(Diversity ~ Sites | alpha, groups=lin, type=type, ...)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2013-11-08 03:11:50 UTC (rev 2677)
+++ pkg/vegan/inst/ChangeLog	2013-11-08 10:40:12 UTC (rev 2678)
@@ -21,6 +21,9 @@
 	also retained, but it is planned to be deprecated in the future,
 	and it is recommended that users switch to defining 'blocks' in
 	how(). 
+
+	* renyiaccum: plot() works also when only one index ('scales') was
+	used.
 	
 Version 2.1-37 (closed November 5, 2013)
 



More information about the Vegan-commits mailing list