450 lines
1.3 MiB
HTML
450 lines
1.3 MiB
HTML
|
<!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="date" content="2014-09-08" />
|
|||
|
|
|||
|
<title>Example with a TCGA dataset</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 { 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">Example with a TCGA dataset</h1>
|
|||
|
<h4 class="date">8 September 2014</h4>
|
|||
|
|
|||
|
|
|||
|
<div id="TOC">
|
|||
|
<ul>
|
|||
|
<li><a href="#dendsort" id="toc-dendsort">dendsort</a></li>
|
|||
|
<li><a href="#dendrograms" id="toc-dendrograms">dendrograms</a></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
|
|||
|
<p>This is an R Markdown document, which demonstrates the use of
|
|||
|
<strong>gapmap</strong> and <strong>dendsort</strong> packages to
|
|||
|
generate a gapped cluster heatmap visualization.</p>
|
|||
|
<p>Let’s start by loading the data file from the package, and creating
|
|||
|
two color palettes.</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>(gapmap)</span>
|
|||
|
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="fu">data</span>(<span class="st">"sample_tcga"</span>)</span>
|
|||
|
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a><span class="fu">library</span>(RColorBrewer)</span></code></pre></div>
|
|||
|
<pre><code>## Warning: package 'RColorBrewer' was built under R version 4.1.2</code></pre>
|
|||
|
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a>RdBu <span class="ot">=</span> <span class="fu">rev</span>(<span class="fu">brewer.pal</span>(<span class="dv">11</span>, <span class="at">name=</span><span class="st">"RdBu"</span>))</span>
|
|||
|
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a>RdYlBu <span class="ot">=</span> <span class="fu">rev</span>(<span class="fu">brewer.pal</span>(<span class="dv">11</span>, <span class="at">name=</span><span class="st">"RdYlBu"</span>))</span></code></pre></div>
|
|||
|
<p>Now you have the data matrix loaded, let’s calculate
|
|||
|
correlation-based distance and perform hierarchical clustering. In this
|
|||
|
example, we use the correlation-based dissimilarity (Pearson
|
|||
|
Correlation) and the complete linkage for hierarchical clustering.</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="co">#transpose</span></span>
|
|||
|
<span id="cb4-2"><a href="#cb4-2" tabindex="-1"></a>dataTable <span class="ot"><-</span> <span class="fu">t</span>(sample_tcga)</span>
|
|||
|
<span id="cb4-3"><a href="#cb4-3" tabindex="-1"></a><span class="co">#calculate the correlation based distance</span></span>
|
|||
|
<span id="cb4-4"><a href="#cb4-4" tabindex="-1"></a>row_dist <span class="ot"><-</span> <span class="fu">as.dist</span>(<span class="dv">1</span><span class="sc">-</span><span class="fu">cor</span>(<span class="fu">t</span>(dataTable), <span class="at">method =</span> <span class="st">"pearson"</span>))</span>
|
|||
|
<span id="cb4-5"><a href="#cb4-5" tabindex="-1"></a>col_dist <span class="ot"><-</span> <span class="fu">as.dist</span>(<span class="dv">1</span><span class="sc">-</span><span class="fu">cor</span>(dataTable, <span class="at">method =</span> <span class="st">"pearson"</span>))</span>
|
|||
|
<span id="cb4-6"><a href="#cb4-6" tabindex="-1"></a><span class="co">#hierarchical clustering</span></span>
|
|||
|
<span id="cb4-7"><a href="#cb4-7" tabindex="-1"></a>col_hc <span class="ot"><-</span> <span class="fu">hclust</span>(col_dist, <span class="at">method =</span> <span class="st">"complete"</span>)</span>
|
|||
|
<span id="cb4-8"><a href="#cb4-8" tabindex="-1"></a>row_hc <span class="ot"><-</span> <span class="fu">hclust</span>(row_dist, <span class="at">method =</span> <span class="st">"complete"</span>)</span>
|
|||
|
<span id="cb4-9"><a href="#cb4-9" tabindex="-1"></a>col_d <span class="ot"><-</span> <span class="fu">as.dendrogram</span>(col_hc)</span>
|
|||
|
<span id="cb4-10"><a href="#cb4-10" tabindex="-1"></a>row_d <span class="ot"><-</span> <span class="fu">as.dendrogram</span>(row_hc)</span></code></pre></div>
|
|||
|
<p>Now you are ready to plot the data. First, we will plot a cluster
|
|||
|
heatmap without any gaps.</p>
|
|||
|
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">gapmap</span>(<span class="at">m =</span> <span class="fu">as.matrix</span>(dataTable), <span class="at">d_row =</span> <span class="fu">rev</span>(row_d), <span class="at">d_col =</span> col_d, <span class="at">ratio =</span> <span class="dv">0</span>, <span class="at">verbose=</span><span class="cn">FALSE</span>, <span class="at">col=</span>RdBu,</span>
|
|||
|
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a> <span class="at">label_size=</span><span class="dv">2</span>, <span class="at">v_ratio=</span> <span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>), <span class="at">h_ratio=</span><span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPY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By4IKjQH2mADupsataIjWeVN8jko39999fSb529FbCLKqR/jnOeaqf6s+rPQdAf17P292to0C1KACn45///Ge16tiFX3755dDtRadMmeKhnvDEE0/YxVW8c+fO3oEHHlgl3SU4CtRFCjCOf//73yt/nHWxf7XR
|
|||
|
<p>This <code>gapmap</code> package was designed to encode the
|
|||
|
similarity between two nodes by adjusting the position of each leaves.
|
|||
|
In the traditional representation, all the information about the
|
|||
|
similarity two adjacent nodes is in the height of the branch in a
|
|||
|
dendrogram. By positioning leaves based on the similarity, we introduce
|
|||
|
gaps in both dendrograms and heat map visualization. In the figure
|
|||
|
below, we exponentially map a distance (dissimilarity) of two nodes to a
|
|||
|
scale of gap size.</p>
|
|||
|
<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">gapmap</span>(<span class="at">m =</span> <span class="fu">as.matrix</span>(dataTable), <span class="at">d_row =</span> <span class="fu">rev</span>(row_d), <span class="at">d_col =</span> col_d, <span class="at">mode =</span> <span class="st">"quantitative"</span>, <span class="at">mapping=</span><span class="st">"exponential"</span>, <span class="at">col=</span>RdBu,</span>
|
|||
|
<span id="cb6-2"><a href="#cb6-2" tabindex="-1"></a> <span class="at">ratio =</span> <span class="fl">0.3</span>, <span class="at">verbose=</span><span class="cn">FALSE</span>, <span class="at">scale =</span> <span class="fl">0.5</span>, <span class="at">label_size=</span><span class="dv">2</span>, <span class="at">v_ratio=</span> <span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>), <span class="at">h_ratio=</span><span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzo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rWIiWfI9vLCwsNOI938aHDh0a3XzzzWsUATpw4MDoqaeesnPa88VXRfOzHuyzzz7GkWa+rixg08axn7fffvvKaiLUGzAQMLCGYSAQoJV84L/88kvEmexYFq5qq8KKEE+VHFbWYhyHedppp0XPPPNM9Ne//jVrnqqMhAN49913V2WVlaqrd+/edgzoX/7yl7zLV5ZQo6G//e1vdhznZZddlne7+RRgfLvuums+RSzvnDlzouOPPz4aPXp0hcv+8MMPZiHctWvXCpchL47vOfmrJgJrBFz2l156qSZ2v1SfOZkL1YsAVYeBCy+8cKVyx5M95eS31157bZW22adPn0qtMcm+h/vVEwOBAF3B57rHHntE+++//wrWUr2LiwCt3r2s+t5BCHfq1Mk2GVVfe+4a//73v+dOrAYpDz74oBHIbEbAUUUBrn0+4mi4bXBNzznnnIo2EfIFDNQIDJxxxhnRLbfcYtKsVdXhDTfcMPrss8+icePGrZImedfvuOMOc/3EZjdAwEASA4EATWIk3AcMBAxUCAPXXXddBKd3RQAVB7ij2YCPF7rA//nPf7IlR3Dl1lprraxpITJgoDpjYPz48RHcwdWBO54LzxC6G220UYTBY4CAgWwYWLGvR7YaQ1zAQMBATgwMHz48+u2333Kmk4CoDE7FAw88UGY+dFk33XTT
|
|||
|
<p>Since the background is white, we can use another color scale where
|
|||
|
the value 0 is encoded in yellow.</p>
|
|||
|
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a><span class="fu">gapmap</span>(<span class="at">m =</span> <span class="fu">as.matrix</span>(dataTable), <span class="at">d_row =</span> <span class="fu">rev</span>(row_d), <span class="at">d_col =</span> col_d, <span class="at">mode =</span> <span class="st">"quantitative"</span>, <span class="at">mapping=</span><span class="st">"exponential"</span>, <span class="at">col=</span>RdYlBu,</span>
|
|||
|
<span id="cb7-2"><a href="#cb7-2" tabindex="-1"></a> <span class="at">ratio =</span> <span class="fl">0.3</span>, <span class="at">verbose=</span><span class="cn">FALSE</span>, <span class="at">scale =</span> <span class="fl">0.5</span>, <span class="at">label_size=</span><span class="dv">2</span>, <span class="at">v_ratio=</span> <span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>), <span class="at">h_ratio=</span><span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+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/gcIpPkMBkhoyCSJ8lT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Y5UKMwsHTpUnPyySebTz/9dJ21a8aMGWKtuu2221b4jNWrV1eYJ1uG5s2by5F8jRo1ypZcbhy+QOvXr19unrVJ5LSW4447TgwS8q0HK9rbbrtNfvmWfeSRR8xhhx2Wb7FanX/UqFGmqnOoMh3XE9Fwi9WiRYvKFKlSHkTff/nLX6pUNhQKGAgYCBjIhoFAgGbDSiXiVqxYYTge8k9/+tN65eqg5A5RU1hYWIlWVl+WAQMGmH/+85+mQ4cO1VdplppGjx5t7r33XvPrX/86S2r1RG255Zambt26Brcp5cH06dPNf//73/Ky5EwrLi42rVu3zpleXkLnzp3Nv/71L9OnT5/yslU5DR+jWMNCtOR7fGNRUZEQ7/k+/MorrzS33377RkWAjhw50jzzzDNyTnu++KpsftaDgw46SDjSzNd1BWzaOPbzr3/967p6RKg3YCBgYCPDQCBAqzjg8+fPN5zJjmXh+rYqrAzxVMVuZS3GcZinn366efbZZ82JJ56YNU91RsIBvOeee6qzyirVtd1228kxoP/3f/+Xd/mqEmo86KyzzpLjOK+55pq8n5tPAfq3995751NE8i5atMj89re/Ne+//36ly3733XdiIdyzZ89KlyEvju85+as2AmsEXPYXX3yxNja/TJs5mQvViwDVh4HLL798nXLHky3l5LdXX311vT5z4MCBVVpjkm0P9xsmBgIBupbjut9++5lDDjlkLWup2cWVAK3Zraz+1kEId+/eXTYZ1V977hovvvji3Ik1IOWhhx4SApnNCDiqLMC1z0ccDbcNrul5551X2UeEfAEDtQIDZ555prnjjjtEmrW+Grz55pub//3vf2bixInr5ZG863fddZe4fmKzGyBgIImBQIAmMRLuAwYCBiqFgVtuucXA6V0bQMUB7mg24OOFLvA//vGPbMkGrtymm26aNS1EBgzUZAx89dVXBu7ghsAdz4VnCN1evXoZDB4DBAxkw8DafT2y1RjiAgYCBnJi4OmnnzaLFy/OmU4CojI4FQ8++GC5+dBl7du3b7l5/ET0lhEL6znz
|
|||
|
<div id="dendsort" class="section level2">
|
|||
|
<h2>dendsort</h2>
|
|||
|
<p>This package works well with the <strong>dendsort</strong> package to
|
|||
|
reorder the structure of dendrograms. For further information for the
|
|||
|
<strong>dendsort</strong>, please see the <a href="https://f1000research.com/articles/3-177/v1">paper</a>.</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">library</span>(dendsort)</span>
|
|||
|
<span id="cb8-2"><a href="#cb8-2" tabindex="-1"></a><span class="fu">gapmap</span>(<span class="at">m =</span> <span class="fu">as.matrix</span>(dataTable), <span class="at">d_row =</span> <span class="fu">rev</span>(<span class="fu">dendsort</span>(row_d, <span class="at">type =</span> <span class="st">"average"</span>)), <span class="at">d_col =</span> <span class="fu">dendsort</span>(col_d, <span class="at">type =</span> <span class="st">"average"</span>), </span>
|
|||
|
<span id="cb8-3"><a href="#cb8-3" tabindex="-1"></a> <span class="at">mode =</span> <span class="st">"quantitative"</span>, <span class="at">mapping=</span><span class="st">"exponential"</span>, <span class="at">ratio =</span> <span class="fl">0.3</span>, <span class="at">verbose=</span><span class="cn">FALSE</span>, <span class="at">scale =</span> <span class="fl">0.5</span>, <span class="at">v_ratio=</span> <span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>), </span>
|
|||
|
<span id="cb8-4"><a href="#cb8-4" tabindex="-1"></a> <span class="at">h_ratio=</span><span class="fu">c</span>(<span class="fl">0.1</span>,<span class="fl">0.8</span>,<span class="fl">0.1</span>), <span class="at">label_size=</span><span class="dv">2</span>, <span class="at">show_legend=</span><span class="cn">TRUE</span>, <span class="at">col=</span>RdBu)</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQR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c4ziI9uH5MUFWBNRBEETiD7OE2yB9cLz0QPmurET4rTHpVhTFVlYHQWWHSqoK0YGvCcyY8rq2sNB4BbcGO56v2HGgvHMjPzxchtL2017fTc6C9cODhhx9uL0317fQcaFUOBECqJ88BzwHPAc8BzwHPAc8BzwHPgdbjgBdAW4/X/kqeA54DngOeA54DngOeA54DAQe8Ct53A8+BJBy49tprzaeffprkbMdJfvfdd83GjRvN6aef3nFuqp474bn269evnhz+lOeA54DnQMty4IY/PCW2ny15lZItlWbWF2sC29CWFfWwc8UmNPhrFLVsqxrVFJ/Zc6DtcOC2224z119/vdlll13aTqNaqCWZgRfmlClTzMcff9xCV2g71S5btsy89tprZu7cuW2nUb4lngOeA54DOyAHvAC6Az50f8sNc2DLli2G8Cmvv/56w5l9jnbDgR/+8Ifm3nvvbTft3VEaikf/j370ow55uyUlJWbmzJmGvtfRaNSoUea0007raLfl76eVOOAF0FZitL+M54DngOeA50BiDhAC7P777zdFRUWJM7Tj1OLiYomz29EmPkRwZKJOBI1p06a14yfkm769OOAF0O3FeX9dzwHPAc8BzwHhwMKFC81BBx1kHnvsMc+RBBx46aWXzFlnndWmgtkjgK5du9Z873vfM1dddVWCVm970o5gFrTtXGq/NXgBtP0+O99yzwHPAc8Bz4EdgAMnn3yy6dmzp5k4cWKbuttu3bqZNWvWtKk2+ca0Hw54AbT9PKsO1dJNmzYZ/tsq4RWOXdqKFSvaahOlXb169WrT7fON8xzwHNh2DrCM59SpU82NN9647ZX5GjwH2ggHvADaRh7EjtSML7/80px55pnmP//5T5u+bWb3vXv3btNtfOaZZ8whhxzSptvoG+c54DngOeA54DkQ5YAXQKMc8cctzgFiayJ83nzzzQYD/bZKWVlZpjJYr7atEvEsf/nLX3oBtK0+IN8uzwHPAc8Bz4GkHPACaFLW+BMtzQFUSmPHjm3py3TY+v/4xz922HvzN+Y54DngOeA50LE54Jfi7NjP19+d54DngOeA54DngOeA50Cb44AXQNvcI/EN8hzwHPAc8BzwHPAcaEkOlJeXm5/85CcSo7Ulr+PrTs4Br4JPzht/xnPAc2A7c4DlUD///PNma8Ubb7xhWJnm7LPPbrY6qeiGG24wOK158hxQDqxfv94cfPDBerhN23Xr1pm//e1v5n//+1+sHuJwEqmjMUSZ/fffXwSvnJycxhQ12dnZBrv41qKVK1dK6KmWul5ZWZmZPn262ND379+/pS7j662HA14ArYc5/pTngOfA9uPAr371K3PdddeZwYMHN1sj+ADvtdde5q233mq2Ollf/oMPPjCzZ89utjrbc0WLFi2SlXHefvvtlG+D5wIRbigVIv++++5rHnjgAdOvX79UirR6ntNPP90sX77cfOUrX9nma++3335mw4YNdep57733zLvvvlsnLZUDJnS33357Klnr5Dn++OPN73//+1abaC1YsKBFBdA6N7cdDrp32cms3VDRoldOTzMmLyvDNG6a0qJNqlO5F0DrsKPjHzArv+WWW7brjfKBgn7zm9+Y7R3HkvWnc3Nztys//MUTc4BYrGlpaeadd95JnKGNpJ5//vnm+eefbyOt2f7N+Oc//ykCPhEaUiWeswqhqZSprq42F198sUTT+Pa3v51Kke2S
|
|||
|
</div>
|
|||
|
<div id="dendrograms" class="section level2">
|
|||
|
<h2>dendrograms</h2>
|
|||
|
<p>You can also plot gapped dendrogram. First you need to create a
|
|||
|
<code>gapdata</code> class object by calling <code>gap_data()</code>. To
|
|||
|
bring the text labels closer to the dendrogram, we set a negative value
|
|||
|
to <code>axis.tick.margin</code>. This value should be adjusted
|
|||
|
depending on your plot size. If anyone has a better solution to adjust
|
|||
|
the position of the axis labels, please let me know.</p>
|
|||
|
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" tabindex="-1"></a>row_data <span class="ot"><-</span> <span class="fu">gap_data</span>(<span class="at">d=</span> row_d, <span class="at">mode =</span> <span class="st">"quantitative"</span>, <span class="at">mapping=</span><span class="st">"exponential"</span>, <span class="at">ratio=</span><span class="fl">0.3</span>, <span class="at">scale=</span> <span class="fl">0.5</span>)</span>
|
|||
|
<span id="cb9-2"><a href="#cb9-2" tabindex="-1"></a>dend <span class="ot"><-</span> <span class="fu">gap_dendrogram</span>(<span class="at">data =</span> row_data, <span class="at">leaf_labels =</span> <span class="cn">TRUE</span>, <span class="at">rotate_label =</span> <span class="cn">TRUE</span>)</span>
|
|||
|
<span id="cb9-3"><a href="#cb9-3" tabindex="-1"></a>dend <span class="sc">+</span> <span class="fu">theme</span>(<span class="at">axis.ticks.length=</span> grid<span class="sc">::</span><span class="fu">unit</span>(<span class="dv">0</span>,<span class="st">"lines"</span>) )<span class="sc">+</span> <span class="fu">theme</span>(<span class="at">axis.ticks.margin =</span> grid<span class="sc">::</span><span class="fu">unit</span>(<span class="sc">-</span><span class="fl">0.8</span>, <span class="st">"lines"</span>))</span></code></pre></div>
|
|||
|
<pre><code>## Warning: The `axis.ticks.margin` argument of `theme()` is deprecated as of ggplot2
|
|||
|
## 2.0.0.
|
|||
|
## ℹ Please set `margin` property of `axis.text` instead
|
|||
|
## This warning is displayed once every 8 hours.
|
|||
|
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
|
|||
|
## generated.</code></pre>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1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wAAEAASURBVHgB7J0HmBzF8fYbEBlEENkgkgAhMkZkEQQWmJyDhTEYDBhEtgEBRiIKySaDSTYgMgiQMAabjIgiR5ODSAKJDBLReL/61Z/ab25u725Pt3u3e/fW82yYmZ4Ob1dXV1dXd09TMEoVoFNOOSUNHz48ffHFFxWITVEIASEgBISAEBACQkAIdFYEpu2sBVO5hIAQEAJCQAgIASEgBGoTASmgtVkvypUQEAJCQAgIASEgBDotAlJAO23VqmBCQAgIASEgBISAEKhNBKSA1ma9KFdCQAgIASEgBISAEOi0CBQV0Oeeey7dcMMNacqUKU0W9ttvv0233HJLuvXWW9P333/fZDg9EAJCQAgIASEgBISAEBACTSHgCugmm2ySBg8enJ544om00korpTvuuKNReBTTFVdc0ZXUYcOGpc033zxVaAF9o7R0QwgIASEgBISAEBACQqDzItDtkUceSe+//3564YUXvJSrrbZaOu2009KAAQMalPr0009Pm266aTr77LP9/lprrZVuv/12v9cgoC6EgBAQAkJACAgBISAEhEAzCHRbY4010qOPPloM8vHHH5echn/22WfTwIEDi+E23HDDNG7cOCmgRUT0RwhUF4H//e9/6YQTTqhuIoq9rhGYbbbZ0uTJk+u6DMp8dRFYe+21GxmYqpuiYhcCpRHoNu2006ZZZ53Vn7733nuJDeUvuuiiRqHHjx+fevToUbw/99xzp9dff714rT9CQAhUF4FBgwalyy67rNheq5uaYq9HBJZZZpn0yiuv1GPWled2QODHH39MF198cRozZkzq27dvO6SoJIRA0wh0i0cvvvhi2mKLLdKQIUNKWjWnn3769N///jeCpx9++CEx2hYJASHQPgi89tpr6Re/+EW6+eab2ydBpSIEhECnQuDll19Oyy67bPryyy87VblUmPpEwBXQxx9/PG2zzTbpnHPOSdttt13Jkiy00ELpww8/LD7j/9JLL1281h8hIASEgBAQAkJACAgBIVAOAtNOmDDBLZ9XX311I+WTZx988IHHg4I6cuTI9PXXXyfusxUTfqAiISAEhIAQEAJCQAgIASHQGgSmPfPMM9OkSZNS//7903TTTecfrJ3Q8ccfn9hyCdpll11S9+7d3erJCvgDDzww9enTx5/pSwgIASEgBISAEBACQkAIlItAtxEjRiQ+pejCCy8s3sYHdNSoUenzzz93389u3Yruo8Uw+iMEhIAQEAJCQAgIASEgBFpCoNVa5JxzztlSnHouBISAEBACQkAICAEhIASaRKB4FGeTIfRACAgBISAEhIAQEAJCQAhUEAEpoBUEU1EJASEgBISAEBACQkAItIyAFNCWMVIIISAEhIAQEAJCQAgIgQoiIAW0gmAqKiEgBISAEBACQkAICIGWEZAC2jJGCiEEhIAQEAJCQAgIASFQQQSkgFYQTEUlBISAEBACQkAICAEh0DICUkBbxkghhIAQEAJCQAgIASEgBCqIgBTQCoKpqISAEBACQkAICAEhIARaRkAKaMsYKYQQEAJCQAgIASEgBIRABRGQAlpBMBWVEBACQkAICAEhIASEQMsISAFtGSOFEAJCQAgIASEgBISAEKggAlJAKwimohICQkAICAEhIASEgBBoGQEpoC1jpBBCQAgIASEgBISAEBACFURACmgFwVRUQkAICAEhIASEgBAQAi0jIAW0ZYwUQggIASEgBISAEBACQqCCCEgBrSCYikoICAEhIASEgBAQAkKgZQSkgLaMkUIIASEgBISAEBACQkAIVBABKaAVBFNRCQEhIASEgBAQAkJACLSMQLeWgyiEEBACQkAICIHaQ+D7779PN9xwQ+1lrEZzNGHCBM/Z3XffnSZOnFijuay9bG2++eZpjjnmqL2M1XmOpIDWeQUq+0JACAiBrorAcccdl4YPH95Viz9V5e7du3caNmzYVL3bVV8aOHBguvLKK7tq8atWbimgVYNWEQsBISAEhEA1EbjvvvvSDjvskC688MJqJtOp4p5mmmlSoVDoVGWqZmGGDh2aRo8eXc0kumzcUkC7bNWr4EJACAiB+kYAZWrGGWdMc889d30XRLmvWQRmnnnmBJ+JKo+AFiFVHlPFKASEgBAQAkJACAgBIdAMAlJAmwFHj4SAEBACQkAICAEhIAQqj4AU0MpjqhiFgBAQAkJACAgBISAEmkFACmgz4OiREBACQkAICAEhIASEQOURkAJaeUwVoxAQAkJACAgBISAEhEAzCEgBbQYcPRICQkAICAEhIASEgBCoPAJSQCuPqWIUAkJACAgBISAEhIAQaAYBKaDNgKNHQkAICAEhIASEgBAQApVHQApo5TFVjEJACAgBISAEhIAQEALNICAFtBlw9EgICAEhIASEgBAQAkKg8ghIAa08popRCAgBISAEhIAQEAJCoBkEpIA2A44eCQEhIASEgBAQAkJACFQeASmglcdUMQoBISAEhIAQEAJCQAg0g0C37LMnnngizTrrrGnZZZfN3i7+Hzt2bPrmm2+K
|
|||
|
<p>Here, we can also apply <code>dendsort</code>.</p>
|
|||
|
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" tabindex="-1"></a>row_data <span class="ot"><-</span> <span class="fu">gap_data</span>(<span class="at">d=</span> <span class="fu">dendsort</span>(row_d, <span class="at">type =</span> <span class="st">"average"</span>), <span class="at">mode =</span> <span class="st">"quantitative"</span>, <span class="at">mapping=</span><span class="st">"exponential"</span>, <span class="at">ratio=</span><span class="fl">0.3</span>, <span class="at">scale=</span> <span class="fl">0.5</span>)</span>
|
|||
|
<span id="cb11-2"><a href="#cb11-2" tabindex="-1"></a>dend <span class="ot"><-</span> <span class="fu">gap_dendrogram</span>(<span class="at">data =</span> row_data, <span class="at">leaf_labels =</span> <span class="cn">TRUE</span>, <span class="at">rotate_label =</span> <span class="cn">TRUE</span>)</span>
|
|||
|
<span id="cb11-3"><a href="#cb11-3" tabindex="-1"></a>dend <span class="sc">+</span> <span class="fu">theme</span>(<span class="at">axis.ticks.length=</span> grid<span class="sc">::</span><span class="fu">unit</span>(<span class="dv">0</span>,<span class="st">"lines"</span>) )<span class="sc">+</span> <span class="fu">theme</span>(<span class="at">axis.ticks.margin =</span> grid<span class="sc">::</span><span class="fu">unit</span>(<span class="sc">-</span><span class="fl">0.8</span>, <span class="st">"lines"</span>))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqAAAAHgCAYAAAB6jN80AAAEDmlDQ1BrQ0dDb2xvcl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hL3p2N6sTjRdduwbHsG9kq32sgBepc+xurLPW4T9URpYGJ3ym4+8zA05u44QjST8ZIoVtu3qE7fWmdn5LPdqvgcZz8Ww8BWJ8X3w0PhQ/wnCDGd+LvlHs8dRy6bLLDuKMaZ20tZrqisPJ5ONiCq8yKhYM5cCgKOu66Lsc0aYOtZdo5QCwezI4wm9J/v0X23mlZXOfBjj8Jzv3WrY5D+CsA9D7aMs2gGfjve8ArD6mePZSeCfEYt8CONWDw8FXTxrPqx/r9Vt4biXeANh8vV7/+/16ffMD1N8AuKD/A/8leAvFY9bLAAAAOGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAACoAIABAAAAAEAAAKgoAMABAAAAAEAAAHgAAAAABJf29wAAEAASURBVHgB7J0FnBxF9seLEDQkQJDg7u4QPMgR3OV/4dDD7YAj+KEHlxx2yOESJBAcQnDXAMHtDgIEDW7BCcz/fd/dm+vtnd2dyc7uzuz+3uezO9M93dVV36p69arqVfVEBZNUBTnppJPSoEGD0tdff12F0BSECIiACIiACIiACIhAZyXQrbMmTOkSAREQAREQAREQARGoTQIyQGszXxQrERABERABERABEei0BGSAdtqsVcJEQAREQAREQAREoDYJyACtzXxRrERABERABERABESg0xIoGqAvvvhiuv7669N3333XZGJ//PHHNHz48DRixIj0888/N3mdfhABERABERABERABERCBpgi4Abreeuulww8/PI0aNSotueSS6e677250PYbpEkss4UbqySefnDbccMNUpQX0jZ6lEyIgAiIgAiIgAiIgAp2XQPcnnngiffDBB+nll1/2VC633HLp1FNPTb/73e8apPq0005L/fv3T2eeeaaf79u3b7rrrrv8XIMLdSACIiACIiACIiACIiACzRDovuKKK6Ynn3yyeMlnn31Wchr+hRdeSAMGDChe169fvzRy5EgZoEUi+iICIgAB9gI+/fTTBUMEnED37t3T+PHjRUMEnMDEE0+cjj76aNEQgdS9W7duqUePHo7i/fffT2wof8EFFzRCM2bMmDTddNMVz/fu3TuNHj26eKwvIiACIgCBHXbYId17771pyimnFBARSD179kzjxo0TCRFwAt9//713Uk855RQR6eIEukf6X3311bTRRhulY445puSo5iSTTNKgF/vLL7+kqaaaKm7XpwiIgAg4gTfffNON0HPPPVdEREAERKABAdz73njjjQbndNA1CbgB+vTTT6fNNtssnXXWWWmLLbYoSWKWWWZJH330UfE3vi+wwALFY30RAREQAREQAREQAREQgXIIdPvwww995HPo0KGNjE9+Gzt2rIeDgTpkyJDE8Dnn2YoJP1CJCIiACIiACIiACIiACFRCoNsZZ5yRPvnkk7TWWmslnIP5Y7QTOe644xJbLiHbbbdd6tWrl496sgJ+v/32S4sssoj/pn8iIAIiIAIiIAIiIAIiUC6B7oMHD078lZLzzz+/eBof0Ouuuy599dVX7vvJykaJCIiACIiACIiACIiACFRKoGIrcppppqn0GbpeBERABERABERABERABIoEiq/iLJ7RFxEQAREQAREQAREQARFoQwIyQNsQroIWAREQAREQAREQARFoTEAGaGMmOiMCIiACIiACIiACItCGBGSAtiFcBS0CIiACIiACIiACItCYgAzQxkx0RgREQAREQAREQAREoA0JyABtQ7gKWgREQAREQAREQAREoDEBGaCNmeiMCIiACIiACIiACIhAGxKQAdqGcBW0CIiACIiACIiACIhAYwIyQBsz0RkREAEREAEREAEREIE2JCADtA3hKmgREAEREAEREAEREIHGBGSANmaiMyIgAiIgAiIgAiIgAm1IQAZoG8JV0CIgAiIgAiIgAiIgAo0JyABtzERnREAEREAEREAEREAE2pCADNA2hKugRUAEREAEREAEREAEGhOQAdqYic6IgAiIgAiIgAiIgAi0IQEZoG0IV0GLgAiIgAiIgAiIgAg0JiADtDETnREBERABERABERABEWhDAjJA2xCughYBERABERABERABEWhMoHvjUzojAiIgAiIgAiJQiwReffXV9Pzzz9di1MqK09ixY9Okk06ahg4dWtb1tXjRsssumxZccMFajFpdxUkGaF1llyIrAiIgAiLQVQm89957acCAAXVtgE400USpUCh4Ouo1HzFAR4wYkfr06VOvSaiJeMsArYlsUCREQAREQAREoHkCX375pRuft912W+rbt2/zF9for2GA1mj0WozW/fffn7beeuv0zTffyABtkVbzF8gAbZ6PfhUBERABERCBmiLQq1ev1Lt375qKU1eJDOwl1SGgRUjV4ahQREAEREAEREAEREAEyiQgA7RMULpMBERABERABERABESgOgRkgFaHo0IRAREQAREQAREQAREok4AM0DJB6TIREAEREAEREAEREIHqEJABWh2OCkUEREAEREAEREAERKBMAjJAywSly0RABERABERABERABKpDQAZodTgqFBEQAREQAREQAREQgTIJyAAtE5QuEwEREAEREAEREAERqA4BGaDV4ahQREAEREAEREAEREAEyiQgA7RMULpMBERABERABERABESgOgRkgFaHo0IRAREQAREQAREQAREok4AM0DJB6TIREAEREAEREAEREIHqEJABWh2OCkUEREAEREAEREAERKBMAt2z140aNSr16NEjLbzwwtnTxe8PPfRQ+uGHH4rHSy+9dOrTp0/xWF9EQAREQAREQAREQAREoCUCRQP01VdfTf3790+nnnpqSQP0l19+SRtssEFaa621imEefvjhMkCLNPRFBERABERABERABESgHAJugJ5//vnp+OOPT9NNN12T92Cgzj///Gn48OFN
|
|||
|
</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>
|