[Vegan-commits] r2169 - branches/2.0/R branches/2.0/inst branches/2.0/man www
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat May 12 06:21:53 CEST 2012
Author: jarioksa
Date: 2012-05-12 06:21:53 +0200 (Sat, 12 May 2012)
New Revision: 2169
Modified:
branches/2.0/R/ordiplot3d.R
branches/2.0/inst/ChangeLog
branches/2.0/inst/NEWS.Rd
branches/2.0/man/betadisper.Rd
branches/2.0/man/ordiplot3d.Rd
www/NEWS.html
Log:
merge 2156 (betadisper example), 2162, 2167 (aspect ratio in ordiplot3d)
Modified: branches/2.0/R/ordiplot3d.R
===================================================================
--- branches/2.0/R/ordiplot3d.R 2012-05-11 08:26:48 UTC (rev 2168)
+++ branches/2.0/R/ordiplot3d.R 2012-05-12 04:21:53 UTC (rev 2169)
@@ -7,8 +7,17 @@
if (missing(xlab)) xlab <- colnames(x)[1]
if (missing(ylab)) ylab <- colnames(x)[2]
if (missing(zlab)) zlab <- colnames(x)[3]
+ ### scatterplot3d does not allow setting equal aspect ratio. We
+ ### try to compensate this by setting equal limits for all axes
+ ### and hoping the graph is more or less square so that the lines
+ ### come correctly out.
+ rnge <- apply(x, 2, range)
+ scl <- c(-0.5, 0.5) * max(apply(rnge, 2, diff))
pl <- ordiArgAbsorber(x[, 1], x[, 2], x[, 3],
- xlab = xlab, ylab = ylab, zlab = zlab,
+ xlab = xlab, ylab = ylab, zlab = zlab,
+ xlim = mean(rnge[,1]) + scl,
+ ylim = mean(rnge[,2]) + scl,
+ zlim = mean(rnge[,3]) + scl,
FUN = "scatterplot3d", ...)
pl$points3d(range(x[, 1]), c(0, 0), c(0, 0), type = "l",
col = ax.col)
Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog 2012-05-11 08:26:48 UTC (rev 2168)
+++ branches/2.0/inst/ChangeLog 2012-05-12 04:21:53 UTC (rev 2169)
@@ -4,6 +4,10 @@
Version 2.0-4 (opened March 9, 2012)
+ * merge r2167: warn about unequal aspect ratio in ordiplot3d.
+ * merge r2162: set equal axis scales for ordiplot3d.
+ * merge r2156: betadisper example adapted for default spatial
+ median.
* merge r2150: monoMDS checks that the number of dissimilarities
is sufficient for the requested analysis. The decostand.Rd fix of
r2150 was not yet merged.
Modified: branches/2.0/inst/NEWS.Rd
===================================================================
--- branches/2.0/inst/NEWS.Rd 2012-05-11 08:26:48 UTC (rev 2168)
+++ branches/2.0/inst/NEWS.Rd 2012-05-12 04:21:53 UTC (rev 2169)
@@ -23,6 +23,12 @@
et al. 2011 and \pkg{vegan} help page.
\item \code{envfit} failed with unused factor levels.
+
+ \item Equal aspect ratio cannot be forced to \code{ordiplot3d}
+ because underlying core routines do not allow this. Now
+ \code{ordiplot3d} sets equal axis ranges, and the documents
+ urge users to verify that the results the aspect ratio is
+ reasonably equal and the graph looks like a cube.
}
}% end bug fixes
Modified: branches/2.0/man/betadisper.Rd
===================================================================
--- branches/2.0/man/betadisper.Rd 2012-05-11 08:26:48 UTC (rev 2168)
+++ branches/2.0/man/betadisper.Rd 2012-05-12 04:21:53 UTC (rev 2169)
@@ -230,6 +230,7 @@
boxplot(mod)
## simulate missing values in 'd' and 'group'
+## using spatial medians
groups[c(2,20)] <- NA
dis[c(2, 20)] <- NA
mod2 <- betadisper(dis, groups) ## warnings
@@ -240,8 +241,8 @@
boxplot(mod2)
plot(TukeyHSD(mod2))
-## Using spatial median
-mod3 <- betadisper(dis, groups, type = "median")
+## Using group centroids
+mod3 <- betadisper(dis, groups, type = "centroid")
mod3
permutest(mod3, control = permControl(nperm = 100))
anova(mod3)
Modified: branches/2.0/man/ordiplot3d.Rd
===================================================================
--- branches/2.0/man/ordiplot3d.Rd 2012-05-11 08:26:48 UTC (rev 2168)
+++ branches/2.0/man/ordiplot3d.Rd 2012-05-12 04:21:53 UTC (rev 2169)
@@ -155,6 +155,20 @@
that \code{\link[rgl]{rgl.texts}} does not always position the text
like supposed, and it may be safe to verify text location with
corresponding points.
+
+ Function \code{ordiplot3d} is based on
+ \code{\link[scatterplot3d]{scatterplot3d}} which does not allow
+ exactly setting equal aspect ratio for axes. The function tries to
+ circumvent this by setting equal plotting ranges for all axes so that
+ the plot should be a cube. Depending on the dimensions of plotting
+ device, this may fail, and the user should verify that the axes are
+ approximately equal.
+
+ Please note that \code{\link[scatterplot3d]{scatterplot3d}} sets
+ internally some graphical parameters (such as \code{mar} for margins)
+ and does not honour default settings. It is advisable to study
+ carefully the documentation and examples of
+ \code{\link[scatterplot3d]{scatterplot3d}}.
}
\note{The user interface of \pkg{rgl} changed in version 0.65, but
Modified: www/NEWS.html
===================================================================
--- www/NEWS.html 2012-05-11 08:26:48 UTC (rev 2168)
+++ www/NEWS.html 2012-05-12 04:21:53 UTC (rev 2169)
@@ -38,7 +38,14 @@
</li>
<li> <p><code>envfit</code> failed with unused factor levels.
</p>
-</ul>
+</li>
+<li><p> Equal aspect ratio cannot be forced to <code>ordiplot3d</code>
+because underlying core routines do not allow this. Now
+<code>ordiplot3d</code> sets equal axis ranges, and the documents
+urge users to verify that the results the aspect ratio is
+reasonably equal and the graph looks like a cube.
+</p>
+</li></ul>
@@ -60,7 +67,7 @@
<li> <p><code>msoplot</code> is more configurable, and allows, for
instance, setting y-axis limits.
</p>
-</ul>
+</li></ul>
@@ -97,7 +104,7 @@
<a href="https://github.com/jarioksa/vegan">GitHub</a>
by Eduard Szöcs (Uni Landau, Germany).
</p>
-</ul>
+</li></ul>
@@ -129,7 +136,7 @@
was reported as an error in <code>ordiplot</code> in
<a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2012-February/002768.html">R-sig-ecology</a> mailing list.
</p>
-</ul>
+</li></ul>
@@ -170,7 +177,7 @@
intensity. Thanks to consultation to Yong Cao (Univ Illinois,
USA).
</p>
-</ul>
+</li></ul>
@@ -212,7 +219,7 @@
speed-up in the internal f.test() function is fully
realised. Reported by Nicholas Lewin-Koh.
</p>
-</ul>
+</li></ul>
@@ -232,7 +239,7 @@
are class centroids of each point, but for constrained ordination
with no <code>groups</code> they are the LC scores.
</p>
-</ul>
+</li></ul>
@@ -273,7 +280,7 @@
[<a href="http://www.esajournals.org/doi/abs/10.1890/ES10-00117.1">doi:10.1890/ES10-00117.1</a>],
and was developed with the consultation of Brian Inouye.
</p>
-</ul>
+</li></ul>
@@ -312,7 +319,7 @@
results but you probably wish to upgrade <span class="pkg">vegan</span> to avoid
annoying warnings.
</p>
-</ul>
+</li></ul>
@@ -327,7 +334,7 @@
showed that in most cases an improved ordering was found rather
early in tries, and the results are equally good in most cases.
</p>
-</ul>
+</li></ul>
@@ -363,7 +370,7 @@
<span class="pkg">permute</span>, but currently only <code>betadisper</code> uses the new
feature.
</p>
-</ul>
+</li></ul>
@@ -419,7 +426,7 @@
were implemented because they were found good for species-area
models by Dengler (<EM>J. Biogeogr.</EM> 36, 728-744; 2009).
</p>
-</ul>
+</li></ul>
@@ -461,7 +468,7 @@
the length of the <code>pool</code> matches the number of
observations.
</p>
-</ul>
+</li></ul>
@@ -480,7 +487,7 @@
was not intended for normal use, but packages depending on that
code in <span class="pkg">vegan</span> should instead depend on <span class="pkg">permute</span>.
</p>
-</ul>
+</li></ul>
@@ -493,7 +500,7 @@
<li> <p><code>treeheight</code> uses much snappier code. The results
should be unchanged.
</p>
-</ul>
+</li></ul>
More information about the Vegan-commits
mailing list