430 lines
111 KiB
HTML
Raw Normal View History

2025-01-12 00:52:51 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Tal Galili" />
<meta name="date" content="2024-11-15" />
<title>Quick Introduction</title>
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
</script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; }
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.at { color: #7d9029; }
code span.bn { color: #40a070; }
code span.bu { color: #008000; }
code span.cf { color: #007020; font-weight: bold; }
code span.ch { color: #4070a0; }
code span.cn { color: #880000; }
code span.co { color: #60a0b0; font-style: italic; }
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.do { color: #ba2121; font-style: italic; }
code span.dt { color: #902000; }
code span.dv { color: #40a070; }
code span.er { color: #ff0000; font-weight: bold; }
code span.ex { }
code span.fl { color: #40a070; }
code span.fu { color: #06287e; }
code span.im { color: #008000; font-weight: bold; }
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.kw { color: #007020; font-weight: bold; }
code span.op { color: #666666; }
code span.ot { color: #007020; }
code span.pp { color: #bc7a00; }
code span.sc { color: #4070a0; }
code span.ss { color: #bb6688; }
code span.st { color: #4070a0; }
code span.va { color: #19177c; }
code span.vs { color: #4070a0; }
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Quick Introduction</h1>
<h4 class="author">Tal Galili</h4>
<h4 class="date">2024-11-15</h4>
<div id="TOC">
<ul>
<li><a href="#start" id="toc-start">Start</a></li>
</ul>
</div>
<!--
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{A quick introduction to dendextend (start here)}
-->
<div id="start" class="section level2">
<h2>Start</h2>
<p>Load:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="fu">library</span>(dendextend) <span class="co">#</span></span></code></pre></div>
<p>Create a dendrogram (if you dont know what <code>%&gt;%</code> is,
read about it <a href="https://CRAN.R-project.org/package=magrittr/vignettes/magrittr.html">here</a>
) :</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a>dend <span class="ot">&lt;-</span> <span class="fu">c</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>) <span class="sc">%&gt;%</span> dist <span class="sc">%&gt;%</span> <span class="fu">hclust</span>(<span class="st">&quot;ave&quot;</span>) <span class="sc">%&gt;%</span> as.dendrogram</span></code></pre></div>
<p>Plot:</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="fu">plot</span>(dend)</span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCCAYAAAB8GMlFAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH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CRAgQKByAoKwci1VEAECBAg0IiAIG9EylgABAgQqJyAIK9dSBREgQIBAIwKCsBEtYwkQIECgcgKCsHItV
<p>Get/set labels</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" tabindex="-1"></a><span class="fu">labels</span>(dend)</span></code></pre></div>
<pre><code>## [1] 1 2 5 3 4</code></pre>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a><span class="fu">labels</span>(dend) <span class="ot">&lt;-</span> <span class="fu">c</span>(<span class="st">&quot;A&quot;</span>, <span class="st">&quot;B&quot;</span>, <span class="st">&quot;extend&quot;</span>, <span class="st">&quot;dend&quot;</span>, <span class="st">&quot;C&quot;</span>)</span>
<span id="cb6-2"><a href="#cb6-2" tabindex="-1"></a><span class="fu">labels</span>(dend)</span></code></pre></div>
<pre><code>## [1] &quot;A&quot; &quot;B&quot; &quot;extend&quot; &quot;dend&quot; &quot;C&quot;</code></pre>
<p>Get/set labels colors</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" tabindex="-1"></a><span class="fu">labels_colors</span>(dend)</span></code></pre></div>
<pre><code>## NULL</code></pre>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a><span class="fu">labels_colors</span>(dend) <span class="ot">&lt;-</span> <span class="fu">rainbow</span>(<span class="dv">5</span>)</span>
<span id="cb10-2"><a href="#cb10-2" tabindex="-1"></a><span class="fu">labels_colors</span>(dend)</span></code></pre></div>
<pre><code>## A B extend dend C
## &quot;#FF0000&quot; &quot;#CCFF00&quot; &quot;#00FF66&quot; &quot;#0066FF&quot; &quot;#CC00FF&quot;</code></pre>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" tabindex="-1"></a><span class="fu">plot</span>(dend)</span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCCAYAAAB8GMlFAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkmOC0z8VKnzcQ2M/Yz2vKldduXjp9bleLu0ZWn7vWc+l0JGcaai10yNrUnXLP/8Jf59ewX+c3Wgz+B34Df+vbVrc16zTMVgp9um9bxEfzPU5kPqUtVWxhs6O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bNsxPgAhV79+/X48//niE32BRBOIVcOY8wiuVVVFREZxL2JEgrK2t1ZEjR9pcpT0qlSBsk6fdJ5599lldd911HfqDpN0VpfxJ+8fChx9+GHyikfJScy7vmWeeIQhzVmQFuQgkJgh3797d4TpHjhwp+9PWtH79+raeYv4VBK6//nrdc889wT7bKyzK0wh0SMB+ysCEwNUUcOqoUQthzxk8dOhQK5Oqqqrgo6ZWTzADAQQQQACBHAScCcILFy4El1IbM2aMbrrpJt13332yH3GG02OPPaaXXnopfMgtAggggAACsQg4E4Rbt24NrjNq96vYg13sZdbKysp0/vz5WAplJQgggAACCGQTcCYIn3/+ed17773q16+fhg4dqg0bNqhPnz7BFWUaGhqyjZ15CCCAAAII5CzgTBBOmjRJmzZtkv0WCjt1795da9as0QcffKAHH3ywaX7OFbMCBBBAAAEEmgk4E4TTpk3T0aNHZa8kE4Zh3759tXnzZtkjRl944YVmw+YuAggggAAC8Qg4c/qEDT17MIz9tgm7NRhO9sLb9vJr9tw/e6k1JgQQQAABBOIUcCYIw6Juv/328G7Trf2y3rlz5zY95g4CCCCAAAJxCTjz0WhcBbEeBBBAAAEEoggQhFG0WBYBBBBAIHUCBGHqWkpBCCCAAAJRBAjCKFosiwACCCCQOgGCMHUtpSAEEEAAgSgCBGEULZZFAAEEEEidAEGYupZSEAIIIIBAFAGCMIoWyyKAAAIIpE6AIExdSykIAQQQQCCKAEEYRYtlEUAAAQRSJ0AQpq6lFIQAAgggEEWAIIyixbIIIIAAAqkTIAhT11IKQgABBBCIIkAQRtFiWQQQQACB1AkQhKlrK
<p>Cut-tree, and color branches</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" tabindex="-1"></a><span class="fu">cutree</span>(dend, <span class="at">k =</span> <span class="dv">2</span>)</span></code></pre></div>
<pre><code>## A B dend C extend
## 1 1 2 2 2</code></pre>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" tabindex="-1"></a>dend <span class="ot">&lt;-</span> <span class="fu">color_branches</span>(dend, <span class="at">k =</span> <span class="dv">2</span>)</span>
<span id="cb15-2"><a href="#cb15-2" tabindex="-1"></a><span class="fu">plot</span>(dend)</span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCCAYAAAB8GMlFAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkmOC0z8VKnz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BevHFF/29xPR1eIwAAggggEAUAlYGYabC6urqVFlZqbKyskxPd1nW2Niol19+ucuy9Jm3335bS5YsSV/E414KHN/2gs6d/lg5Qwb18ifcXO2jc2e0O6dFeTde7yZAiKobThzV4qrbQ/wEqyIQrYA11xFeqqza2lr/WsLeBGFzc7MOHz7c4ya9s1IJwh55LvrE8e0v6aqifOUN+8xF13P9yd+2ndHhwS0afO1VrlNcsv66ffUE4SWVWKE/BWIThLt37+61w9ixY+V99TQ9/vjjPT3F8ksI5N5QqOu/PEnX3fLZS6zp9tPDTfm3uE3Q6+o3Nvyy1+uyIgL9IWDVWaNegd41gwcPHuxWa319vX9dYbcnWIAAAggggEAfBKwJwrNnz/q3UpswYYJuuukm3XPPPfLe4kxNDz30kJ599tnULN8RQAABBBCIRMCaINy6dat/n9H33ntP3sku3m3WqqurdebMmUgKZSMIIIAAAghkErAmCJ966indfffdGjJkiEaMGKEnnnhCgwYN8u8o097enmnsLEMAAQQQQKDPAtYEYVVVlTZt2iTvUyi8KTs7W+vWrdO7776r+++/v3N5nytmAwgggAACCKQJWBOEM2fO1JEjR+TdSSYVhoMHD9bmzZvlnTH69NNPpw2bhwgggAACCEQjYM3lE17oeSfDeJ824e0Npibvxtve7de8a/+8W60xIYAAAgggEKWANUGYKmrixImph53fvQ/rve+++zrneYAAAggggEBUAta8NRpVQWwHAQQQQACBMAIEYRgt1kUAAQQQSJwAQZi4llIQAggggEAYAYIwjBbrIoAAAggkToAgTFxLKQgBBBBAIIwAQRhGi3URQAABBBInQBAmrqUUhAACCCAQRoAgDKPFuggggAACiRMgCBPXUgpCAAEEEAgjQBCG0WJdBBBAAIHECRCEiWspBSGAAAIIhBEgCMNosS4CCCCAQOIECMLEtZSCEEAAAQTCCBCEY
<p>Sort</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" tabindex="-1"></a>dend2 <span class="ot">&lt;-</span> <span class="fu">sort</span>(dend)</span>
<span id="cb16-2"><a href="#cb16-2" tabindex="-1"></a><span class="fu">plot</span>(dend2)</span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCCAYAAAB8GMlFAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkmOC0z8VKnzcQ2M/Yz2vKldduXjp9bleLu0ZWn7vWc+l0JGcaai10yNrUnXLP/8Jf59ewX+c3Wgz+B34Df+vbVrc16zTMVgp9um9bxEf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dQiu+g2ccV2PvRKX048kYNuMaZq5w+binOv6/25DF9fcp0ZQ3A2vnO6oMV7De9XlVVlbiWMJUgrK+v15EjR7rlsmelEoTd8vQ448S2l3RNwRDlDPtkj+2Ymb7AiYZT+mXBQBOE16S/MJbQo8C/7H9Z/6H0c8qCukcnX2f2myDcvXt3yn0wduxY2Z/uhieffLK7WUy/jED2jfm64fMTdf1tn75MS2anK1CZ7gJ4f8oC//et15Q5wKlzB1NedxqmL+Bcz9trBg8dOtSlspqamsR1hV1mMAEBBBBAAIE0BJwJwgsXLiRupTZhwgTdcsstuv/++2V3cbYNjzzyiJ599tm2UX4jgAACCCDQKwLOBOGWLVsS9xl97733ZE92sbdZq6io0Pnz53ulUBaCAAIIIIBAMgFngvCZZ57Rfffdp9zcXI0YMUJPPfWUBg0alLijTEtLS7J1ZxoCCCCAAAJpCzgThOXl5dq4caPsUyjskJmZqbVr1+rdd9/VQw891D497YpZAAIIIIAAAh0EnAnCGTNm6OjRo7J3kmkLw8GDB2vTpk2yZ4xu3769w2rzEgEEEEAAgd4RcObyCRt69mQY+7QJuzXYNtgbb9vbr9lr/+yt1hgQQAABBBDoTQFngrCtqNtvv73tZftv+7DeBx98sH2cFwgggAACCPSWgDO7RnurIJaDAAIIIIBAHAGCMI4WbRFAAAEEvBMgCL3rUgpCAAEEEIgjQBDG0aItAggggIB3AgShd11KQQgggAACcQQIwjhatEUAAQQQ8E6AIPSuSykIAQQQQCCOAEEYR4u2CCCAAALeCRCE3nUpBSGAAAIIxBEgCONo0RYBBBBAwDsBgtC7LqUgBBBAAIE4AgRhHC3aIoAAAgh4J0AQe
<p>Compare</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" tabindex="-1"></a><span class="fu">tanglegram</span>( dend, dend2 )</span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAHCCAYAAAB8GMlFAAAEDmlDQ1BrQ0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ibKdWmm4O0j6ij5wh1gP13Zub5FAIJkCOREXySyQsjYLPD3mc1W47y7CtEdovV87VlrqjlLltZC2OdUlwm6bTZIxtfjtzzX+mj96RTXr0EZ7vHCvmrVvnYyiKSNBgdLlq2Xf2dohUYvt7r1C2xz2gwRLYXY/Cdge4SM/OkdtQ/Q9IXuEfloDA9KWljtIfa6Xel6R/CRoRLah7XzUvp5W6bJVmnTbwwGRy75umH0sCdqYkASzbwxpsTuZDwQEslFg4PDzVdilg9f0ZR9+o3nPv5WN3cjqNpu52VvYWNiYEAhkowCJMBtHjTaroFULDb3T/WAxJ3pSxfQ/PKv1sxYgkyYBszZzL9wY2FjYmBAIZKMAiTAbR402ewJtdxui3sPcL/ZdVG50p+8P/7Mqy/gtmQeSwv+ZsWftzC16//QE2VgQCGSrAIkwW0eOdnsCfS4+Wa2G9PWm106apRkPPIdMigXM2KwtzL7PRSd50/wPgWwVIBFm68jRbk8gtyBfQ+++XLlF0dPt5/79Da34egI6KRIwWzO2MHPP3o0BgUA2C5AIs3n0aLsn0Lx3Vw285ryohvs10MQbH1TZGnddNyKpAmZqttr0iyszN3sCgWwXIBFm+wjSfk+g24kHq+NBu3nTJYuWa/IdjyKTZAEzNVsLszZzAoEgCJAIgzCK9MET2Pbmi2Q/sLdY4n50v/C1971p/td0AbM0UwszNmsCgaAIk
<p>Cor</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" tabindex="-1"></a><span class="fu">cor_cophenetic</span>( dend, dend2 )</span></code></pre></div>
<pre><code>## [1] 1</code></pre>
<p>ggplot2</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" tabindex="-1"></a><span class="fu">library</span>(ggplot2)</span>
<span id="cb20-2"><a href="#cb20-2" tabindex="-1"></a><span class="fu">ggplot</span>(dend) </span></code></pre></div>
<p><img role="img" src="data:image/png;base64,iVBORw0KGgoAAAANSU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sCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAIMwwLAkQIECgPQFB2N7MdUyAAAECmYAgzDAsCRAgQKA9AUHY3sx1TIAAAQKZgCDMMCwJECBAoD0BQdjezHVMgAABApmAI
<p>Send to plot.ly</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" tabindex="-1"></a><span class="co"># library(plotly)</span></span>
<span id="cb21-2"><a href="#cb21-2" tabindex="-1"></a><span class="co"># set_credentials_file(...) </span></span>
<span id="cb21-3"><a href="#cb21-3" tabindex="-1"></a><span class="co"># you&#39;ll need to get it from here: https://plot.ly/ggplot2/getting-started/</span></span>
<span id="cb21-4"><a href="#cb21-4" tabindex="-1"></a></span>
<span id="cb21-5"><a href="#cb21-5" tabindex="-1"></a><span class="co"># ggplot(dend)</span></span>
<span id="cb21-6"><a href="#cb21-6" tabindex="-1"></a><span class="co"># py &lt;- plotly()</span></span>
<span id="cb21-7"><a href="#cb21-7" tabindex="-1"></a><span class="co"># py$ggplotly()</span></span></code></pre></div>
</div>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>