-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed filled/empty ellipses, added convex hulls
- Loading branch information
Showing
30 changed files
with
180 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
<head> | ||
|
||
<meta charset="utf-8"> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="generator" content="pandoc" /> | ||
|
||
|
@@ -152,38 +152,46 @@ <h4><em>Marcus W. Beck, <a href="mailto:[email protected]">[email protected] | |
<p><img src="README_files/figure-html/unnamed-chunk-3-4.png" /><!-- --></p> | ||
<pre class="r"><code>p + theme(legend.position = 'top')</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-5.png" /><!-- --></p> | ||
<pre class="r"><code># transparent ellipses | ||
p <- ggord(ord, iris$Species, poly = FALSE) | ||
p</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-6.png" /><!-- --></p> | ||
<pre class="r"><code># convex hulls | ||
p <- ggord(ord, iris$Species, ellipse = FALSE, hull = TRUE) | ||
p</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-7.png" /><!-- --></p> | ||
<pre class="r"><code># change the vector labels with vec_lab | ||
new_lab <- list(Sepal.Length = 'SL', Sepal.Width = 'SW', Petal.Width = 'PW', | ||
Petal.Length = 'PL') | ||
p <- ggord(ord, iris$Species, vec_lab = new_lab) | ||
p</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-6.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-8.png" /><!-- --></p> | ||
<pre class="r"><code># observations as labels from row names | ||
p <- ggord(ord, iris$Species, obslab = TRUE) | ||
p</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-7.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-9.png" /><!-- --></p> | ||
<pre class="r"><code># principal components analysis with the iris dataset | ||
# princomp | ||
ord <- princomp(iris[, 1:4]) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-8.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-10.png" /><!-- --></p> | ||
<pre class="r"><code># principal components analysis with the iris dataset | ||
# PCA | ||
library(FactoMineR) | ||
|
||
ord <- PCA(iris[, 1:4], graph = FALSE) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-9.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-11.png" /><!-- --></p> | ||
<pre class="r"><code># principal components analysis with the iris dataset | ||
# dudi.pca | ||
library(ade4) | ||
|
||
ord <- dudi.pca(iris[, 1:4], scannf = FALSE, nf = 4) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-10.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-12.png" /><!-- --></p> | ||
<pre class="r"><code># multiple correspondence analysis with the tea dataset | ||
# MCA | ||
data(tea, package = 'FactoMineR') | ||
|
@@ -192,47 +200,47 @@ <h4><em>Marcus W. Beck, <a href="mailto:[email protected]">[email protected] | |
ord <- MCA(tea[, -1], graph = FALSE) | ||
|
||
ggord(ord, tea$Tea)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-11.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-13.png" /><!-- --></p> | ||
<pre class="r"><code># multiple correspondence analysis with the tea dataset | ||
# mca | ||
library(MASS) | ||
|
||
ord <- mca(tea[, -1]) | ||
|
||
ggord(ord, tea$Tea)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-12.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-14.png" /><!-- --></p> | ||
<pre class="r"><code># multiple correspondence analysis with the tea dataset | ||
# acm | ||
ord <- dudi.acm(tea[, -1], scannf = FALSE) | ||
|
||
ggord(ord, tea$Tea)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-13.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-15.png" /><!-- --></p> | ||
<pre class="r"><code># nonmetric multidimensional scaling with the iris dataset | ||
# metaMDS | ||
library(vegan) | ||
ord <- metaMDS(iris[, 1:4]) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-14.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-16.png" /><!-- --></p> | ||
<pre class="r"><code># linear discriminant analysis | ||
# example from lda in MASS package | ||
ord <- lda(Species ~ ., iris, prior = rep(1, 3)/3) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-15.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-17.png" /><!-- --></p> | ||
<pre class="r"><code># correspondence analysis | ||
# dudi.coa | ||
ord <- dudi.coa(iris[, 1:4], scannf = FALSE, nf = 4) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-16.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-18.png" /><!-- --></p> | ||
<pre class="r"><code># correspondence analysis | ||
# ca | ||
library(ca) | ||
ord <- ca(iris[, 1:4]) | ||
|
||
ggord(ord, iris$Species)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-17.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-19.png" /><!-- --></p> | ||
<pre class="r"><code># double principle coordinate analysis (DPCoA) | ||
# dpcoa | ||
library(ade4) | ||
|
@@ -242,7 +250,7 @@ <h4><em>Marcus W. Beck, <a href="mailto:[email protected]">[email protected] | |
ord <- dpcoa(data.frame(t(ecomor$habitat)), dtaxo, scan = FALSE, nf = 2) | ||
|
||
ggord(ord, grp_in = grp, ellipse = FALSE, arrow = 0.2, txt = 3)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-18.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-20.png" /><!-- --></p> | ||
<pre class="r"><code>###### | ||
# triplots | ||
|
||
|
@@ -253,17 +261,17 @@ <h4><em>Marcus W. Beck, <a href="mailto:[email protected]">[email protected] | |
ord <- rda(varespec, varechem) | ||
|
||
ggord(ord)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-19.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-21.png" /><!-- --></p> | ||
<pre class="r"><code># canonical correspondence analysis | ||
# cca from vegan | ||
ord <- cca(varespec, varechem) | ||
|
||
ggord(ord)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-20.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-22.png" /><!-- --></p> | ||
<pre class="r"><code># species points as text | ||
# suppress site points | ||
ggord(ord, ptslab = TRUE, size = NA, addsize = 5)</code></pre> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-21.png" /><!-- --></p> | ||
<p><img src="README_files/figure-html/unnamed-chunk-3-23.png" /><!-- --></p> | ||
</div> | ||
</div> | ||
|
||
|
@@ -290,7 +298,7 @@ <h4><em>Marcus W. Beck, <a href="mailto:[email protected]">[email protected] | |
(function () { | ||
var script = document.createElement("script"); | ||
script.type = "text/javascript"; | ||
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; | ||
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; | ||
document.getElementsByTagName("head")[0].appendChild(script); | ||
})(); | ||
</script> | ||
|
Oops, something went wrong.