Spaces:
Running
Running
aepstar
commited on
Commit
·
c136045
1
Parent(s):
f7de11f
add html page
Browse files- 001-reducegrow.html +498 -0
- intro.html +484 -0
- references.html +428 -0
- summary.html +448 -0
001-reducegrow.html
ADDED
@@ -0,0 +1,498 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
3 |
+
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="generator" content="quarto-1.3.433">
|
6 |
+
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
8 |
+
|
9 |
+
|
10 |
+
<title>Codewars Challenge 2024 Using R and RStudio - 1 Beginner - Reduce but Grow</title>
|
11 |
+
<style>
|
12 |
+
code{white-space: pre-wrap;}
|
13 |
+
span.smallcaps{font-variant: small-caps;}
|
14 |
+
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
15 |
+
div.column{flex: auto; overflow-x: auto;}
|
16 |
+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
17 |
+
ul.task-list{list-style: none;}
|
18 |
+
ul.task-list li input[type="checkbox"] {
|
19 |
+
width: 0.8em;
|
20 |
+
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
21 |
+
vertical-align: middle;
|
22 |
+
}
|
23 |
+
/* CSS for syntax highlighting */
|
24 |
+
pre > code.sourceCode { white-space: pre; position: relative; }
|
25 |
+
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
26 |
+
pre > code.sourceCode > span:empty { height: 1.2em; }
|
27 |
+
.sourceCode { overflow: visible; }
|
28 |
+
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
29 |
+
div.sourceCode { margin: 1em 0; }
|
30 |
+
pre.sourceCode { margin: 0; }
|
31 |
+
@media screen {
|
32 |
+
div.sourceCode { overflow: auto; }
|
33 |
+
}
|
34 |
+
@media print {
|
35 |
+
pre > code.sourceCode { white-space: pre-wrap; }
|
36 |
+
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
37 |
+
}
|
38 |
+
pre.numberSource code
|
39 |
+
{ counter-reset: source-line 0; }
|
40 |
+
pre.numberSource code > span
|
41 |
+
{ position: relative; left: -4em; counter-increment: source-line; }
|
42 |
+
pre.numberSource code > span > a:first-child::before
|
43 |
+
{ content: counter(source-line);
|
44 |
+
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
45 |
+
border: none; display: inline-block;
|
46 |
+
-webkit-touch-callout: none; -webkit-user-select: none;
|
47 |
+
-khtml-user-select: none; -moz-user-select: none;
|
48 |
+
-ms-user-select: none; user-select: none;
|
49 |
+
padding: 0 4px; width: 4em;
|
50 |
+
}
|
51 |
+
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
52 |
+
div.sourceCode
|
53 |
+
{ }
|
54 |
+
@media screen {
|
55 |
+
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
56 |
+
}
|
57 |
+
</style>
|
58 |
+
|
59 |
+
|
60 |
+
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
61 |
+
<script src="site_libs/quarto-nav/headroom.min.js"></script>
|
62 |
+
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
63 |
+
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
64 |
+
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
65 |
+
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
66 |
+
<meta name="quarto:offset" content="./">
|
67 |
+
<link href="./references.html" rel="next">
|
68 |
+
<link href="./intro.html" rel="prev">
|
69 |
+
<script src="site_libs/quarto-html/quarto.js"></script>
|
70 |
+
<script src="site_libs/quarto-html/popper.min.js"></script>
|
71 |
+
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
72 |
+
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
73 |
+
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
74 |
+
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
75 |
+
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
+
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
+
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
78 |
+
<script id="quarto-search-options" type="application/json">{
|
79 |
+
"location": "sidebar",
|
80 |
+
"copy-button": false,
|
81 |
+
"collapse-after": 3,
|
82 |
+
"panel-placement": "start",
|
83 |
+
"type": "textbox",
|
84 |
+
"limit": 20,
|
85 |
+
"language": {
|
86 |
+
"search-no-results-text": "No results",
|
87 |
+
"search-matching-documents-text": "matching documents",
|
88 |
+
"search-copy-link-title": "Copy link to search",
|
89 |
+
"search-hide-matches-text": "Hide additional matches",
|
90 |
+
"search-more-match-text": "more match in this document",
|
91 |
+
"search-more-matches-text": "more matches in this document",
|
92 |
+
"search-clear-button-title": "Clear",
|
93 |
+
"search-detached-cancel-button-title": "Cancel",
|
94 |
+
"search-submit-button-title": "Submit",
|
95 |
+
"search-label": "Search"
|
96 |
+
}
|
97 |
+
}</script>
|
98 |
+
|
99 |
+
|
100 |
+
</head>
|
101 |
+
|
102 |
+
<body class="nav-sidebar floating">
|
103 |
+
|
104 |
+
<div id="quarto-search-results"></div>
|
105 |
+
<header id="quarto-header" class="headroom fixed-top">
|
106 |
+
<nav class="quarto-secondary-nav">
|
107 |
+
<div class="container-fluid d-flex">
|
108 |
+
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
109 |
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
110 |
+
</button>
|
111 |
+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./001-reducegrow.html"><span class="chapter-number">1</span> <span class="chapter-title">Beginner - Reduce but Grow</span></a></li></ol></nav>
|
112 |
+
<a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
113 |
+
</a>
|
114 |
+
<button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
|
115 |
+
<i class="bi bi-search"></i>
|
116 |
+
</button>
|
117 |
+
</div>
|
118 |
+
</nav>
|
119 |
+
</header>
|
120 |
+
<!-- content -->
|
121 |
+
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
|
122 |
+
<!-- sidebar -->
|
123 |
+
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal sidebar-navigation floating overflow-auto">
|
124 |
+
<div class="pt-lg-2 mt-2 text-left sidebar-header">
|
125 |
+
<div class="sidebar-title mb-0 py-0">
|
126 |
+
<a href="./">Codewars Challenge 2024 Using R and RStudio</a>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
<div class="mt-2 flex-shrink-0 align-items-center">
|
130 |
+
<div class="sidebar-search">
|
131 |
+
<div id="quarto-search" class="" title="Search"></div>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="sidebar-menu-container">
|
135 |
+
<ul class="list-unstyled mt-1">
|
136 |
+
<li class="sidebar-item">
|
137 |
+
<div class="sidebar-item-container">
|
138 |
+
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
139 |
+
<span class="menu-text">Preface</span></a>
|
140 |
+
</div>
|
141 |
+
</li>
|
142 |
+
<li class="sidebar-item">
|
143 |
+
<div class="sidebar-item-container">
|
144 |
+
<a href="./intro.html" class="sidebar-item-text sidebar-link">
|
145 |
+
<span class="menu-text">Introduction</span></a>
|
146 |
+
</div>
|
147 |
+
</li>
|
148 |
+
<li class="sidebar-item">
|
149 |
+
<div class="sidebar-item-container">
|
150 |
+
<a href="./001-reducegrow.html" class="sidebar-item-text sidebar-link active">
|
151 |
+
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
152 |
+
</div>
|
153 |
+
</li>
|
154 |
+
<li class="sidebar-item">
|
155 |
+
<div class="sidebar-item-container">
|
156 |
+
<a href="./references.html" class="sidebar-item-text sidebar-link">
|
157 |
+
<span class="menu-text">References</span></a>
|
158 |
+
</div>
|
159 |
+
</li>
|
160 |
+
</ul>
|
161 |
+
</div>
|
162 |
+
</nav>
|
163 |
+
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
|
164 |
+
<!-- margin-sidebar -->
|
165 |
+
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
166 |
+
<nav id="TOC" role="doc-toc" class="toc-active">
|
167 |
+
<h2 id="toc-title">Table of contents</h2>
|
168 |
+
|
169 |
+
<ul>
|
170 |
+
<li><a href="#youtube-video" id="toc-youtube-video" class="nav-link active" data-scroll-target="#youtube-video"><span class="header-section-number">1.1</span> YouTube Video</a></li>
|
171 |
+
<li><a href="#solution-code" id="toc-solution-code" class="nav-link" data-scroll-target="#solution-code"><span class="header-section-number">1.2</span> Solution Code</a></li>
|
172 |
+
<li><a href="#test" id="toc-test" class="nav-link" data-scroll-target="#test"><span class="header-section-number">1.3</span> Test</a></li>
|
173 |
+
<li><a href="#supported-by" id="toc-supported-by" class="nav-link" data-scroll-target="#supported-by"><span class="header-section-number">1.4</span> Supported by</a></li>
|
174 |
+
</ul>
|
175 |
+
</nav>
|
176 |
+
</div>
|
177 |
+
<!-- main -->
|
178 |
+
<main class="content" id="quarto-document-content">
|
179 |
+
|
180 |
+
<header id="title-block-header" class="quarto-title-block default">
|
181 |
+
<div class="quarto-title">
|
182 |
+
<h1 class="title"><span id="reducegrow" class="quarto-section-identifier"><span class="chapter-number">1</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></h1>
|
183 |
+
</div>
|
184 |
+
|
185 |
+
|
186 |
+
|
187 |
+
<div class="quarto-title-meta">
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
</div>
|
193 |
+
|
194 |
+
|
195 |
+
</header>
|
196 |
+
|
197 |
+
<p><a href="https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r" class="uri">https://www.codewars.com/kata/57f780909f7e8e3183000078/train/r</a></p>
|
198 |
+
<p>Given a non-empty array of integers, return the result of multiplying the values together in order. Example:</p>
|
199 |
+
<pre><code>[1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24</code></pre>
|
200 |
+
<section id="youtube-video" class="level2" data-number="1.1">
|
201 |
+
<h2 data-number="1.1" class="anchored" data-anchor-id="youtube-video"><span class="header-section-number">1.1</span> YouTube Video</h2>
|
202 |
+
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/xCvHwR52p4k?si=yoLfpHfcIBYk0j9c" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
|
203 |
+
</section>
|
204 |
+
<section id="solution-code" class="level2" data-number="1.2">
|
205 |
+
<h2 data-number="1.2" class="anchored" data-anchor-id="solution-code"><span class="header-section-number">1.2</span> Solution Code</h2>
|
206 |
+
<p>Solusi bar-bar</p>
|
207 |
+
<div class="cell">
|
208 |
+
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> <span class="cf">function</span>(arr) {</span>
|
209 |
+
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> result <span class="ot"><-</span> <span class="dv">1</span></span>
|
210 |
+
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span>(i <span class="cf">in</span> arr){</span>
|
211 |
+
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> result <span class="ot"><-</span> result <span class="sc">*</span> i</span>
|
212 |
+
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> }</span>
|
213 |
+
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(result)</span>
|
214 |
+
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
215 |
+
</div>
|
216 |
+
<p>Solusi simple</p>
|
217 |
+
<div class="cell">
|
218 |
+
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># grow <- function(arr) prod(arr)</span></span>
|
219 |
+
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>grow <span class="ot"><-</span> prod</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
220 |
+
</div>
|
221 |
+
</section>
|
222 |
+
<section id="test" class="level2" data-number="1.3">
|
223 |
+
<h2 data-number="1.3" class="anchored" data-anchor-id="test"><span class="header-section-number">1.3</span> Test</h2>
|
224 |
+
<div class="cell">
|
225 |
+
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(testthat)</span>
|
226 |
+
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="fu">test_that</span>(<span class="st">"basic tests"</span>, {</span>
|
227 |
+
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">grow</span>(<span class="fu">c</span>(<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span>)), <span class="dv">6</span>)</span>
|
228 |
+
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">grow</span>(<span class="fu">c</span>(<span class="dv">4</span>, <span class="dv">1</span>, <span class="dv">1</span>, <span class="dv">1</span>, <span class="dv">4</span>)), <span class="dv">16</span>)</span>
|
229 |
+
<span id="cb4-5"><a href="#cb4-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">expect_equal</span>(<span class="fu">grow</span>(<span class="fu">c</span>(<span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">2</span>)), <span class="dv">64</span>)</span>
|
230 |
+
<span id="cb4-6"><a href="#cb4-6" aria-hidden="true" tabindex="-1"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
231 |
+
<div class="cell-output cell-output-stdout">
|
232 |
+
<pre><code>Test passed 😀</code></pre>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
</section>
|
236 |
+
<section id="supported-by" class="level2" data-number="1.4">
|
237 |
+
<h2 data-number="1.4" class="anchored" data-anchor-id="supported-by"><span class="header-section-number">1.4</span> Supported by</h2>
|
238 |
+
<div class="quarto-figure quarto-figure-center">
|
239 |
+
<figure class="figure">
|
240 |
+
<p><a href="https://www.starcore.co"><img src="new_starcore_logo.png" class="img-fluid figure-img"></a></p>
|
241 |
+
<figcaption class="figure-caption">StarCore Analytics</figcaption>
|
242 |
+
</figure>
|
243 |
+
</div>
|
244 |
+
|
245 |
+
|
246 |
+
</section>
|
247 |
+
|
248 |
+
</main> <!-- /main -->
|
249 |
+
<script id="quarto-html-after-body" type="application/javascript">
|
250 |
+
window.document.addEventListener("DOMContentLoaded", function (event) {
|
251 |
+
const toggleBodyColorMode = (bsSheetEl) => {
|
252 |
+
const mode = bsSheetEl.getAttribute("data-mode");
|
253 |
+
const bodyEl = window.document.querySelector("body");
|
254 |
+
if (mode === "dark") {
|
255 |
+
bodyEl.classList.add("quarto-dark");
|
256 |
+
bodyEl.classList.remove("quarto-light");
|
257 |
+
} else {
|
258 |
+
bodyEl.classList.add("quarto-light");
|
259 |
+
bodyEl.classList.remove("quarto-dark");
|
260 |
+
}
|
261 |
+
}
|
262 |
+
const toggleBodyColorPrimary = () => {
|
263 |
+
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
264 |
+
if (bsSheetEl) {
|
265 |
+
toggleBodyColorMode(bsSheetEl);
|
266 |
+
}
|
267 |
+
}
|
268 |
+
toggleBodyColorPrimary();
|
269 |
+
const icon = "";
|
270 |
+
const anchorJS = new window.AnchorJS();
|
271 |
+
anchorJS.options = {
|
272 |
+
placement: 'right',
|
273 |
+
icon: icon
|
274 |
+
};
|
275 |
+
anchorJS.add('.anchored');
|
276 |
+
const isCodeAnnotation = (el) => {
|
277 |
+
for (const clz of el.classList) {
|
278 |
+
if (clz.startsWith('code-annotation-')) {
|
279 |
+
return true;
|
280 |
+
}
|
281 |
+
}
|
282 |
+
return false;
|
283 |
+
}
|
284 |
+
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
285 |
+
text: function(trigger) {
|
286 |
+
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
287 |
+
for (const childEl of codeEl.children) {
|
288 |
+
if (isCodeAnnotation(childEl)) {
|
289 |
+
childEl.remove();
|
290 |
+
}
|
291 |
+
}
|
292 |
+
return codeEl.innerText;
|
293 |
+
}
|
294 |
+
});
|
295 |
+
clipboard.on('success', function(e) {
|
296 |
+
// button target
|
297 |
+
const button = e.trigger;
|
298 |
+
// don't keep focus
|
299 |
+
button.blur();
|
300 |
+
// flash "checked"
|
301 |
+
button.classList.add('code-copy-button-checked');
|
302 |
+
var currentTitle = button.getAttribute("title");
|
303 |
+
button.setAttribute("title", "Copied!");
|
304 |
+
let tooltip;
|
305 |
+
if (window.bootstrap) {
|
306 |
+
button.setAttribute("data-bs-toggle", "tooltip");
|
307 |
+
button.setAttribute("data-bs-placement", "left");
|
308 |
+
button.setAttribute("data-bs-title", "Copied!");
|
309 |
+
tooltip = new bootstrap.Tooltip(button,
|
310 |
+
{ trigger: "manual",
|
311 |
+
customClass: "code-copy-button-tooltip",
|
312 |
+
offset: [0, -8]});
|
313 |
+
tooltip.show();
|
314 |
+
}
|
315 |
+
setTimeout(function() {
|
316 |
+
if (tooltip) {
|
317 |
+
tooltip.hide();
|
318 |
+
button.removeAttribute("data-bs-title");
|
319 |
+
button.removeAttribute("data-bs-toggle");
|
320 |
+
button.removeAttribute("data-bs-placement");
|
321 |
+
}
|
322 |
+
button.setAttribute("title", currentTitle);
|
323 |
+
button.classList.remove('code-copy-button-checked');
|
324 |
+
}, 1000);
|
325 |
+
// clear code selection
|
326 |
+
e.clearSelection();
|
327 |
+
});
|
328 |
+
function tippyHover(el, contentFn) {
|
329 |
+
const config = {
|
330 |
+
allowHTML: true,
|
331 |
+
content: contentFn,
|
332 |
+
maxWidth: 500,
|
333 |
+
delay: 100,
|
334 |
+
arrow: false,
|
335 |
+
appendTo: function(el) {
|
336 |
+
return el.parentElement;
|
337 |
+
},
|
338 |
+
interactive: true,
|
339 |
+
interactiveBorder: 10,
|
340 |
+
theme: 'quarto',
|
341 |
+
placement: 'bottom-start'
|
342 |
+
};
|
343 |
+
window.tippy(el, config);
|
344 |
+
}
|
345 |
+
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
346 |
+
for (var i=0; i<noterefs.length; i++) {
|
347 |
+
const ref = noterefs[i];
|
348 |
+
tippyHover(ref, function() {
|
349 |
+
// use id or data attribute instead here
|
350 |
+
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
351 |
+
try { href = new URL(href).hash; } catch {}
|
352 |
+
const id = href.replace(/^#\/?/, "");
|
353 |
+
const note = window.document.getElementById(id);
|
354 |
+
return note.innerHTML;
|
355 |
+
});
|
356 |
+
}
|
357 |
+
let selectedAnnoteEl;
|
358 |
+
const selectorForAnnotation = ( cell, annotation) => {
|
359 |
+
let cellAttr = 'data-code-cell="' + cell + '"';
|
360 |
+
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
361 |
+
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
362 |
+
return selector;
|
363 |
+
}
|
364 |
+
const selectCodeLines = (annoteEl) => {
|
365 |
+
const doc = window.document;
|
366 |
+
const targetCell = annoteEl.getAttribute("data-target-cell");
|
367 |
+
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
368 |
+
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
369 |
+
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
370 |
+
const lineIds = lines.map((line) => {
|
371 |
+
return targetCell + "-" + line;
|
372 |
+
})
|
373 |
+
let top = null;
|
374 |
+
let height = null;
|
375 |
+
let parent = null;
|
376 |
+
if (lineIds.length > 0) {
|
377 |
+
//compute the position of the single el (top and bottom and make a div)
|
378 |
+
const el = window.document.getElementById(lineIds[0]);
|
379 |
+
top = el.offsetTop;
|
380 |
+
height = el.offsetHeight;
|
381 |
+
parent = el.parentElement.parentElement;
|
382 |
+
if (lineIds.length > 1) {
|
383 |
+
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
384 |
+
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
385 |
+
height = bottom - top;
|
386 |
+
}
|
387 |
+
if (top !== null && height !== null && parent !== null) {
|
388 |
+
// cook up a div (if necessary) and position it
|
389 |
+
let div = window.document.getElementById("code-annotation-line-highlight");
|
390 |
+
if (div === null) {
|
391 |
+
div = window.document.createElement("div");
|
392 |
+
div.setAttribute("id", "code-annotation-line-highlight");
|
393 |
+
div.style.position = 'absolute';
|
394 |
+
parent.appendChild(div);
|
395 |
+
}
|
396 |
+
div.style.top = top - 2 + "px";
|
397 |
+
div.style.height = height + 4 + "px";
|
398 |
+
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
399 |
+
if (gutterDiv === null) {
|
400 |
+
gutterDiv = window.document.createElement("div");
|
401 |
+
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
402 |
+
gutterDiv.style.position = 'absolute';
|
403 |
+
const codeCell = window.document.getElementById(targetCell);
|
404 |
+
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
405 |
+
gutter.appendChild(gutterDiv);
|
406 |
+
}
|
407 |
+
gutterDiv.style.top = top - 2 + "px";
|
408 |
+
gutterDiv.style.height = height + 4 + "px";
|
409 |
+
}
|
410 |
+
selectedAnnoteEl = annoteEl;
|
411 |
+
}
|
412 |
+
};
|
413 |
+
const unselectCodeLines = () => {
|
414 |
+
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
415 |
+
elementsIds.forEach((elId) => {
|
416 |
+
const div = window.document.getElementById(elId);
|
417 |
+
if (div) {
|
418 |
+
div.remove();
|
419 |
+
}
|
420 |
+
});
|
421 |
+
selectedAnnoteEl = undefined;
|
422 |
+
};
|
423 |
+
// Attach click handler to the DT
|
424 |
+
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
425 |
+
for (const annoteDlNode of annoteDls) {
|
426 |
+
annoteDlNode.addEventListener('click', (event) => {
|
427 |
+
const clickedEl = event.target;
|
428 |
+
if (clickedEl !== selectedAnnoteEl) {
|
429 |
+
unselectCodeLines();
|
430 |
+
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
431 |
+
if (activeEl) {
|
432 |
+
activeEl.classList.remove('code-annotation-active');
|
433 |
+
}
|
434 |
+
selectCodeLines(clickedEl);
|
435 |
+
clickedEl.classList.add('code-annotation-active');
|
436 |
+
} else {
|
437 |
+
// Unselect the line
|
438 |
+
unselectCodeLines();
|
439 |
+
clickedEl.classList.remove('code-annotation-active');
|
440 |
+
}
|
441 |
+
});
|
442 |
+
}
|
443 |
+
const findCites = (el) => {
|
444 |
+
const parentEl = el.parentElement;
|
445 |
+
if (parentEl) {
|
446 |
+
const cites = parentEl.dataset.cites;
|
447 |
+
if (cites) {
|
448 |
+
return {
|
449 |
+
el,
|
450 |
+
cites: cites.split(' ')
|
451 |
+
};
|
452 |
+
} else {
|
453 |
+
return findCites(el.parentElement)
|
454 |
+
}
|
455 |
+
} else {
|
456 |
+
return undefined;
|
457 |
+
}
|
458 |
+
};
|
459 |
+
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
460 |
+
for (var i=0; i<bibliorefs.length; i++) {
|
461 |
+
const ref = bibliorefs[i];
|
462 |
+
const citeInfo = findCites(ref);
|
463 |
+
if (citeInfo) {
|
464 |
+
tippyHover(citeInfo.el, function() {
|
465 |
+
var popup = window.document.createElement('div');
|
466 |
+
citeInfo.cites.forEach(function(cite) {
|
467 |
+
var citeDiv = window.document.createElement('div');
|
468 |
+
citeDiv.classList.add('hanging-indent');
|
469 |
+
citeDiv.classList.add('csl-entry');
|
470 |
+
var biblioDiv = window.document.getElementById('ref-' + cite);
|
471 |
+
if (biblioDiv) {
|
472 |
+
citeDiv.innerHTML = biblioDiv.innerHTML;
|
473 |
+
}
|
474 |
+
popup.appendChild(citeDiv);
|
475 |
+
});
|
476 |
+
return popup.innerHTML;
|
477 |
+
});
|
478 |
+
}
|
479 |
+
}
|
480 |
+
});
|
481 |
+
</script>
|
482 |
+
<nav class="page-navigation">
|
483 |
+
<div class="nav-page nav-page-previous">
|
484 |
+
<a href="./intro.html" class="pagination-link">
|
485 |
+
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Introduction</span>
|
486 |
+
</a>
|
487 |
+
</div>
|
488 |
+
<div class="nav-page nav-page-next">
|
489 |
+
<a href="./references.html" class="pagination-link">
|
490 |
+
<span class="nav-page-text">References</span> <i class="bi bi-arrow-right-short"></i>
|
491 |
+
</a>
|
492 |
+
</div>
|
493 |
+
</nav>
|
494 |
+
</div> <!-- /content -->
|
495 |
+
|
496 |
+
|
497 |
+
|
498 |
+
</body></html>
|
intro.html
ADDED
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
3 |
+
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="generator" content="quarto-1.3.433">
|
6 |
+
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
8 |
+
|
9 |
+
|
10 |
+
<title>Codewars Using R and RStudio - Introduction</title>
|
11 |
+
<style>
|
12 |
+
code{white-space: pre-wrap;}
|
13 |
+
span.smallcaps{font-variant: small-caps;}
|
14 |
+
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
15 |
+
div.column{flex: auto; overflow-x: auto;}
|
16 |
+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
17 |
+
ul.task-list{list-style: none;}
|
18 |
+
ul.task-list li input[type="checkbox"] {
|
19 |
+
width: 0.8em;
|
20 |
+
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
21 |
+
vertical-align: middle;
|
22 |
+
}
|
23 |
+
/* CSS for syntax highlighting */
|
24 |
+
pre > code.sourceCode { white-space: pre; position: relative; }
|
25 |
+
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
26 |
+
pre > code.sourceCode > span:empty { height: 1.2em; }
|
27 |
+
.sourceCode { overflow: visible; }
|
28 |
+
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
29 |
+
div.sourceCode { margin: 1em 0; }
|
30 |
+
pre.sourceCode { margin: 0; }
|
31 |
+
@media screen {
|
32 |
+
div.sourceCode { overflow: auto; }
|
33 |
+
}
|
34 |
+
@media print {
|
35 |
+
pre > code.sourceCode { white-space: pre-wrap; }
|
36 |
+
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
37 |
+
}
|
38 |
+
pre.numberSource code
|
39 |
+
{ counter-reset: source-line 0; }
|
40 |
+
pre.numberSource code > span
|
41 |
+
{ position: relative; left: -4em; counter-increment: source-line; }
|
42 |
+
pre.numberSource code > span > a:first-child::before
|
43 |
+
{ content: counter(source-line);
|
44 |
+
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
45 |
+
border: none; display: inline-block;
|
46 |
+
-webkit-touch-callout: none; -webkit-user-select: none;
|
47 |
+
-khtml-user-select: none; -moz-user-select: none;
|
48 |
+
-ms-user-select: none; user-select: none;
|
49 |
+
padding: 0 4px; width: 4em;
|
50 |
+
}
|
51 |
+
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
52 |
+
div.sourceCode
|
53 |
+
{ }
|
54 |
+
@media screen {
|
55 |
+
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
56 |
+
}
|
57 |
+
/* CSS for citations */
|
58 |
+
div.csl-bib-body { }
|
59 |
+
div.csl-entry {
|
60 |
+
clear: both;
|
61 |
+
}
|
62 |
+
.hanging-indent div.csl-entry {
|
63 |
+
margin-left:2em;
|
64 |
+
text-indent:-2em;
|
65 |
+
}
|
66 |
+
div.csl-left-margin {
|
67 |
+
min-width:2em;
|
68 |
+
float:left;
|
69 |
+
}
|
70 |
+
div.csl-right-inline {
|
71 |
+
margin-left:2em;
|
72 |
+
padding-left:1em;
|
73 |
+
}
|
74 |
+
div.csl-indent {
|
75 |
+
margin-left: 2em;
|
76 |
+
}</style>
|
77 |
+
|
78 |
+
|
79 |
+
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
80 |
+
<script src="site_libs/quarto-nav/headroom.min.js"></script>
|
81 |
+
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
82 |
+
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
83 |
+
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
84 |
+
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
85 |
+
<meta name="quarto:offset" content="./">
|
86 |
+
<link href="./001-reducegrow.html" rel="next">
|
87 |
+
<link href="./index.html" rel="prev">
|
88 |
+
<script src="site_libs/quarto-html/quarto.js"></script>
|
89 |
+
<script src="site_libs/quarto-html/popper.min.js"></script>
|
90 |
+
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
91 |
+
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
92 |
+
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
93 |
+
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
94 |
+
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
95 |
+
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
96 |
+
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
97 |
+
<script id="quarto-search-options" type="application/json">{
|
98 |
+
"location": "sidebar",
|
99 |
+
"copy-button": false,
|
100 |
+
"collapse-after": 3,
|
101 |
+
"panel-placement": "start",
|
102 |
+
"type": "textbox",
|
103 |
+
"limit": 20,
|
104 |
+
"language": {
|
105 |
+
"search-no-results-text": "No results",
|
106 |
+
"search-matching-documents-text": "matching documents",
|
107 |
+
"search-copy-link-title": "Copy link to search",
|
108 |
+
"search-hide-matches-text": "Hide additional matches",
|
109 |
+
"search-more-match-text": "more match in this document",
|
110 |
+
"search-more-matches-text": "more matches in this document",
|
111 |
+
"search-clear-button-title": "Clear",
|
112 |
+
"search-detached-cancel-button-title": "Cancel",
|
113 |
+
"search-submit-button-title": "Submit",
|
114 |
+
"search-label": "Search"
|
115 |
+
}
|
116 |
+
}</script>
|
117 |
+
|
118 |
+
|
119 |
+
</head>
|
120 |
+
|
121 |
+
<body class="nav-sidebar floating">
|
122 |
+
|
123 |
+
<div id="quarto-search-results"></div>
|
124 |
+
<header id="quarto-header" class="headroom fixed-top">
|
125 |
+
<nav class="quarto-secondary-nav">
|
126 |
+
<div class="container-fluid d-flex">
|
127 |
+
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
128 |
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
129 |
+
</button>
|
130 |
+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./intro.html">Introduction</a></li></ol></nav>
|
131 |
+
<a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
132 |
+
</a>
|
133 |
+
<button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
|
134 |
+
<i class="bi bi-search"></i>
|
135 |
+
</button>
|
136 |
+
</div>
|
137 |
+
</nav>
|
138 |
+
</header>
|
139 |
+
<!-- content -->
|
140 |
+
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
|
141 |
+
<!-- sidebar -->
|
142 |
+
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal sidebar-navigation floating overflow-auto">
|
143 |
+
<div class="pt-lg-2 mt-2 text-left sidebar-header">
|
144 |
+
<div class="sidebar-title mb-0 py-0">
|
145 |
+
<a href="./">Codewars Using R and RStudio</a>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<div class="mt-2 flex-shrink-0 align-items-center">
|
149 |
+
<div class="sidebar-search">
|
150 |
+
<div id="quarto-search" class="" title="Search"></div>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
<div class="sidebar-menu-container">
|
154 |
+
<ul class="list-unstyled mt-1">
|
155 |
+
<li class="sidebar-item">
|
156 |
+
<div class="sidebar-item-container">
|
157 |
+
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
158 |
+
<span class="menu-text">Preface</span></a>
|
159 |
+
</div>
|
160 |
+
</li>
|
161 |
+
<li class="sidebar-item">
|
162 |
+
<div class="sidebar-item-container">
|
163 |
+
<a href="./intro.html" class="sidebar-item-text sidebar-link active">
|
164 |
+
<span class="menu-text">Introduction</span></a>
|
165 |
+
</div>
|
166 |
+
</li>
|
167 |
+
<li class="sidebar-item sidebar-item-section">
|
168 |
+
<div class="sidebar-item-container">
|
169 |
+
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
|
170 |
+
<span class="menu-text">codewars2024.qmd</span></a>
|
171 |
+
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="Toggle section">
|
172 |
+
<i class="bi bi-chevron-right ms-2"></i>
|
173 |
+
</a>
|
174 |
+
</div>
|
175 |
+
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
|
176 |
+
<li class="sidebar-item">
|
177 |
+
<div class="sidebar-item-container">
|
178 |
+
<a href="./001-reducegrow.html" class="sidebar-item-text sidebar-link">
|
179 |
+
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span></a>
|
180 |
+
</div>
|
181 |
+
</li>
|
182 |
+
</ul>
|
183 |
+
</li>
|
184 |
+
<li class="sidebar-item">
|
185 |
+
<div class="sidebar-item-container">
|
186 |
+
<a href="./references.html" class="sidebar-item-text sidebar-link">
|
187 |
+
<span class="menu-text">References</span></a>
|
188 |
+
</div>
|
189 |
+
</li>
|
190 |
+
</ul>
|
191 |
+
</div>
|
192 |
+
</nav>
|
193 |
+
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
|
194 |
+
<!-- margin-sidebar -->
|
195 |
+
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
196 |
+
|
197 |
+
</div>
|
198 |
+
<!-- main -->
|
199 |
+
<main class="content" id="quarto-document-content">
|
200 |
+
|
201 |
+
<header id="title-block-header" class="quarto-title-block default">
|
202 |
+
<div class="quarto-title">
|
203 |
+
<h1 class="title">Introduction</h1>
|
204 |
+
</div>
|
205 |
+
|
206 |
+
|
207 |
+
|
208 |
+
<div class="quarto-title-meta">
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
</div>
|
214 |
+
|
215 |
+
|
216 |
+
</header>
|
217 |
+
|
218 |
+
<p>This is a book created from markdown and executable code.</p>
|
219 |
+
<p>See <span class="citation" data-cites="knuth84">Knuth (<a href="references.html#ref-knuth84" role="doc-biblioref">1984</a>)</span> for additional discussion of literate programming.</p>
|
220 |
+
<div class="cell">
|
221 |
+
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="dv">1</span> <span class="sc">+</span> <span class="dv">1</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
222 |
+
<div class="cell-output cell-output-stdout">
|
223 |
+
<pre><code>[1] 2</code></pre>
|
224 |
+
</div>
|
225 |
+
</div>
|
226 |
+
|
227 |
+
|
228 |
+
<div id="refs" class="references csl-bib-body hanging-indent" role="list" style="display: none">
|
229 |
+
<div id="ref-knuth84" class="csl-entry" role="listitem">
|
230 |
+
Knuth, Donald E. 1984. <span>“Literate Programming.”</span> <em>Comput. J.</em> 27 (2): 97–111. <a href="https://doi.org/10.1093/comjnl/27.2.97">https://doi.org/10.1093/comjnl/27.2.97</a>.
|
231 |
+
</div>
|
232 |
+
</div>
|
233 |
+
|
234 |
+
</main> <!-- /main -->
|
235 |
+
<script id="quarto-html-after-body" type="application/javascript">
|
236 |
+
window.document.addEventListener("DOMContentLoaded", function (event) {
|
237 |
+
const toggleBodyColorMode = (bsSheetEl) => {
|
238 |
+
const mode = bsSheetEl.getAttribute("data-mode");
|
239 |
+
const bodyEl = window.document.querySelector("body");
|
240 |
+
if (mode === "dark") {
|
241 |
+
bodyEl.classList.add("quarto-dark");
|
242 |
+
bodyEl.classList.remove("quarto-light");
|
243 |
+
} else {
|
244 |
+
bodyEl.classList.add("quarto-light");
|
245 |
+
bodyEl.classList.remove("quarto-dark");
|
246 |
+
}
|
247 |
+
}
|
248 |
+
const toggleBodyColorPrimary = () => {
|
249 |
+
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
250 |
+
if (bsSheetEl) {
|
251 |
+
toggleBodyColorMode(bsSheetEl);
|
252 |
+
}
|
253 |
+
}
|
254 |
+
toggleBodyColorPrimary();
|
255 |
+
const icon = "";
|
256 |
+
const anchorJS = new window.AnchorJS();
|
257 |
+
anchorJS.options = {
|
258 |
+
placement: 'right',
|
259 |
+
icon: icon
|
260 |
+
};
|
261 |
+
anchorJS.add('.anchored');
|
262 |
+
const isCodeAnnotation = (el) => {
|
263 |
+
for (const clz of el.classList) {
|
264 |
+
if (clz.startsWith('code-annotation-')) {
|
265 |
+
return true;
|
266 |
+
}
|
267 |
+
}
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
271 |
+
text: function(trigger) {
|
272 |
+
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
273 |
+
for (const childEl of codeEl.children) {
|
274 |
+
if (isCodeAnnotation(childEl)) {
|
275 |
+
childEl.remove();
|
276 |
+
}
|
277 |
+
}
|
278 |
+
return codeEl.innerText;
|
279 |
+
}
|
280 |
+
});
|
281 |
+
clipboard.on('success', function(e) {
|
282 |
+
// button target
|
283 |
+
const button = e.trigger;
|
284 |
+
// don't keep focus
|
285 |
+
button.blur();
|
286 |
+
// flash "checked"
|
287 |
+
button.classList.add('code-copy-button-checked');
|
288 |
+
var currentTitle = button.getAttribute("title");
|
289 |
+
button.setAttribute("title", "Copied!");
|
290 |
+
let tooltip;
|
291 |
+
if (window.bootstrap) {
|
292 |
+
button.setAttribute("data-bs-toggle", "tooltip");
|
293 |
+
button.setAttribute("data-bs-placement", "left");
|
294 |
+
button.setAttribute("data-bs-title", "Copied!");
|
295 |
+
tooltip = new bootstrap.Tooltip(button,
|
296 |
+
{ trigger: "manual",
|
297 |
+
customClass: "code-copy-button-tooltip",
|
298 |
+
offset: [0, -8]});
|
299 |
+
tooltip.show();
|
300 |
+
}
|
301 |
+
setTimeout(function() {
|
302 |
+
if (tooltip) {
|
303 |
+
tooltip.hide();
|
304 |
+
button.removeAttribute("data-bs-title");
|
305 |
+
button.removeAttribute("data-bs-toggle");
|
306 |
+
button.removeAttribute("data-bs-placement");
|
307 |
+
}
|
308 |
+
button.setAttribute("title", currentTitle);
|
309 |
+
button.classList.remove('code-copy-button-checked');
|
310 |
+
}, 1000);
|
311 |
+
// clear code selection
|
312 |
+
e.clearSelection();
|
313 |
+
});
|
314 |
+
function tippyHover(el, contentFn) {
|
315 |
+
const config = {
|
316 |
+
allowHTML: true,
|
317 |
+
content: contentFn,
|
318 |
+
maxWidth: 500,
|
319 |
+
delay: 100,
|
320 |
+
arrow: false,
|
321 |
+
appendTo: function(el) {
|
322 |
+
return el.parentElement;
|
323 |
+
},
|
324 |
+
interactive: true,
|
325 |
+
interactiveBorder: 10,
|
326 |
+
theme: 'quarto',
|
327 |
+
placement: 'bottom-start'
|
328 |
+
};
|
329 |
+
window.tippy(el, config);
|
330 |
+
}
|
331 |
+
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
332 |
+
for (var i=0; i<noterefs.length; i++) {
|
333 |
+
const ref = noterefs[i];
|
334 |
+
tippyHover(ref, function() {
|
335 |
+
// use id or data attribute instead here
|
336 |
+
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
337 |
+
try { href = new URL(href).hash; } catch {}
|
338 |
+
const id = href.replace(/^#\/?/, "");
|
339 |
+
const note = window.document.getElementById(id);
|
340 |
+
return note.innerHTML;
|
341 |
+
});
|
342 |
+
}
|
343 |
+
let selectedAnnoteEl;
|
344 |
+
const selectorForAnnotation = ( cell, annotation) => {
|
345 |
+
let cellAttr = 'data-code-cell="' + cell + '"';
|
346 |
+
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
347 |
+
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
348 |
+
return selector;
|
349 |
+
}
|
350 |
+
const selectCodeLines = (annoteEl) => {
|
351 |
+
const doc = window.document;
|
352 |
+
const targetCell = annoteEl.getAttribute("data-target-cell");
|
353 |
+
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
354 |
+
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
355 |
+
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
356 |
+
const lineIds = lines.map((line) => {
|
357 |
+
return targetCell + "-" + line;
|
358 |
+
})
|
359 |
+
let top = null;
|
360 |
+
let height = null;
|
361 |
+
let parent = null;
|
362 |
+
if (lineIds.length > 0) {
|
363 |
+
//compute the position of the single el (top and bottom and make a div)
|
364 |
+
const el = window.document.getElementById(lineIds[0]);
|
365 |
+
top = el.offsetTop;
|
366 |
+
height = el.offsetHeight;
|
367 |
+
parent = el.parentElement.parentElement;
|
368 |
+
if (lineIds.length > 1) {
|
369 |
+
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
370 |
+
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
371 |
+
height = bottom - top;
|
372 |
+
}
|
373 |
+
if (top !== null && height !== null && parent !== null) {
|
374 |
+
// cook up a div (if necessary) and position it
|
375 |
+
let div = window.document.getElementById("code-annotation-line-highlight");
|
376 |
+
if (div === null) {
|
377 |
+
div = window.document.createElement("div");
|
378 |
+
div.setAttribute("id", "code-annotation-line-highlight");
|
379 |
+
div.style.position = 'absolute';
|
380 |
+
parent.appendChild(div);
|
381 |
+
}
|
382 |
+
div.style.top = top - 2 + "px";
|
383 |
+
div.style.height = height + 4 + "px";
|
384 |
+
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
385 |
+
if (gutterDiv === null) {
|
386 |
+
gutterDiv = window.document.createElement("div");
|
387 |
+
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
388 |
+
gutterDiv.style.position = 'absolute';
|
389 |
+
const codeCell = window.document.getElementById(targetCell);
|
390 |
+
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
391 |
+
gutter.appendChild(gutterDiv);
|
392 |
+
}
|
393 |
+
gutterDiv.style.top = top - 2 + "px";
|
394 |
+
gutterDiv.style.height = height + 4 + "px";
|
395 |
+
}
|
396 |
+
selectedAnnoteEl = annoteEl;
|
397 |
+
}
|
398 |
+
};
|
399 |
+
const unselectCodeLines = () => {
|
400 |
+
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
401 |
+
elementsIds.forEach((elId) => {
|
402 |
+
const div = window.document.getElementById(elId);
|
403 |
+
if (div) {
|
404 |
+
div.remove();
|
405 |
+
}
|
406 |
+
});
|
407 |
+
selectedAnnoteEl = undefined;
|
408 |
+
};
|
409 |
+
// Attach click handler to the DT
|
410 |
+
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
411 |
+
for (const annoteDlNode of annoteDls) {
|
412 |
+
annoteDlNode.addEventListener('click', (event) => {
|
413 |
+
const clickedEl = event.target;
|
414 |
+
if (clickedEl !== selectedAnnoteEl) {
|
415 |
+
unselectCodeLines();
|
416 |
+
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
417 |
+
if (activeEl) {
|
418 |
+
activeEl.classList.remove('code-annotation-active');
|
419 |
+
}
|
420 |
+
selectCodeLines(clickedEl);
|
421 |
+
clickedEl.classList.add('code-annotation-active');
|
422 |
+
} else {
|
423 |
+
// Unselect the line
|
424 |
+
unselectCodeLines();
|
425 |
+
clickedEl.classList.remove('code-annotation-active');
|
426 |
+
}
|
427 |
+
});
|
428 |
+
}
|
429 |
+
const findCites = (el) => {
|
430 |
+
const parentEl = el.parentElement;
|
431 |
+
if (parentEl) {
|
432 |
+
const cites = parentEl.dataset.cites;
|
433 |
+
if (cites) {
|
434 |
+
return {
|
435 |
+
el,
|
436 |
+
cites: cites.split(' ')
|
437 |
+
};
|
438 |
+
} else {
|
439 |
+
return findCites(el.parentElement)
|
440 |
+
}
|
441 |
+
} else {
|
442 |
+
return undefined;
|
443 |
+
}
|
444 |
+
};
|
445 |
+
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
446 |
+
for (var i=0; i<bibliorefs.length; i++) {
|
447 |
+
const ref = bibliorefs[i];
|
448 |
+
const citeInfo = findCites(ref);
|
449 |
+
if (citeInfo) {
|
450 |
+
tippyHover(citeInfo.el, function() {
|
451 |
+
var popup = window.document.createElement('div');
|
452 |
+
citeInfo.cites.forEach(function(cite) {
|
453 |
+
var citeDiv = window.document.createElement('div');
|
454 |
+
citeDiv.classList.add('hanging-indent');
|
455 |
+
citeDiv.classList.add('csl-entry');
|
456 |
+
var biblioDiv = window.document.getElementById('ref-' + cite);
|
457 |
+
if (biblioDiv) {
|
458 |
+
citeDiv.innerHTML = biblioDiv.innerHTML;
|
459 |
+
}
|
460 |
+
popup.appendChild(citeDiv);
|
461 |
+
});
|
462 |
+
return popup.innerHTML;
|
463 |
+
});
|
464 |
+
}
|
465 |
+
}
|
466 |
+
});
|
467 |
+
</script>
|
468 |
+
<nav class="page-navigation">
|
469 |
+
<div class="nav-page nav-page-previous">
|
470 |
+
<a href="./index.html" class="pagination-link">
|
471 |
+
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Preface</span>
|
472 |
+
</a>
|
473 |
+
</div>
|
474 |
+
<div class="nav-page nav-page-next">
|
475 |
+
<a href="./001-reducegrow.html" class="pagination-link">
|
476 |
+
<span class="nav-page-text"><span class="chapter-number">1</span> <span class="chapter-title">Beginner - Reduce but Grow</span></span> <i class="bi bi-arrow-right-short"></i>
|
477 |
+
</a>
|
478 |
+
</div>
|
479 |
+
</nav>
|
480 |
+
</div> <!-- /content -->
|
481 |
+
|
482 |
+
|
483 |
+
|
484 |
+
</body></html>
|
references.html
ADDED
@@ -0,0 +1,428 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
3 |
+
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="generator" content="quarto-1.3.433">
|
6 |
+
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
8 |
+
|
9 |
+
|
10 |
+
<title>Codewars Using R and RStudio - References</title>
|
11 |
+
<style>
|
12 |
+
code{white-space: pre-wrap;}
|
13 |
+
span.smallcaps{font-variant: small-caps;}
|
14 |
+
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
15 |
+
div.column{flex: auto; overflow-x: auto;}
|
16 |
+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
17 |
+
ul.task-list{list-style: none;}
|
18 |
+
ul.task-list li input[type="checkbox"] {
|
19 |
+
width: 0.8em;
|
20 |
+
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
21 |
+
vertical-align: middle;
|
22 |
+
}
|
23 |
+
/* CSS for citations */
|
24 |
+
div.csl-bib-body { }
|
25 |
+
div.csl-entry {
|
26 |
+
clear: both;
|
27 |
+
}
|
28 |
+
.hanging-indent div.csl-entry {
|
29 |
+
margin-left:2em;
|
30 |
+
text-indent:-2em;
|
31 |
+
}
|
32 |
+
div.csl-left-margin {
|
33 |
+
min-width:2em;
|
34 |
+
float:left;
|
35 |
+
}
|
36 |
+
div.csl-right-inline {
|
37 |
+
margin-left:2em;
|
38 |
+
padding-left:1em;
|
39 |
+
}
|
40 |
+
div.csl-indent {
|
41 |
+
margin-left: 2em;
|
42 |
+
}</style>
|
43 |
+
|
44 |
+
|
45 |
+
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
46 |
+
<script src="site_libs/quarto-nav/headroom.min.js"></script>
|
47 |
+
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
48 |
+
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
49 |
+
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
50 |
+
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
51 |
+
<meta name="quarto:offset" content="./">
|
52 |
+
<link href="./summary.html" rel="prev">
|
53 |
+
<script src="site_libs/quarto-html/quarto.js"></script>
|
54 |
+
<script src="site_libs/quarto-html/popper.min.js"></script>
|
55 |
+
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
56 |
+
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
57 |
+
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
58 |
+
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
59 |
+
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
60 |
+
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
61 |
+
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
62 |
+
<script id="quarto-search-options" type="application/json">{
|
63 |
+
"location": "sidebar",
|
64 |
+
"copy-button": false,
|
65 |
+
"collapse-after": 3,
|
66 |
+
"panel-placement": "start",
|
67 |
+
"type": "textbox",
|
68 |
+
"limit": 20,
|
69 |
+
"language": {
|
70 |
+
"search-no-results-text": "No results",
|
71 |
+
"search-matching-documents-text": "matching documents",
|
72 |
+
"search-copy-link-title": "Copy link to search",
|
73 |
+
"search-hide-matches-text": "Hide additional matches",
|
74 |
+
"search-more-match-text": "more match in this document",
|
75 |
+
"search-more-matches-text": "more matches in this document",
|
76 |
+
"search-clear-button-title": "Clear",
|
77 |
+
"search-detached-cancel-button-title": "Cancel",
|
78 |
+
"search-submit-button-title": "Submit",
|
79 |
+
"search-label": "Search"
|
80 |
+
}
|
81 |
+
}</script>
|
82 |
+
|
83 |
+
|
84 |
+
</head>
|
85 |
+
|
86 |
+
<body class="nav-sidebar floating">
|
87 |
+
|
88 |
+
<div id="quarto-search-results"></div>
|
89 |
+
<header id="quarto-header" class="headroom fixed-top">
|
90 |
+
<nav class="quarto-secondary-nav">
|
91 |
+
<div class="container-fluid d-flex">
|
92 |
+
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
93 |
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
94 |
+
</button>
|
95 |
+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./references.html">References</a></li></ol></nav>
|
96 |
+
<a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
97 |
+
</a>
|
98 |
+
<button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
|
99 |
+
<i class="bi bi-search"></i>
|
100 |
+
</button>
|
101 |
+
</div>
|
102 |
+
</nav>
|
103 |
+
</header>
|
104 |
+
<!-- content -->
|
105 |
+
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
|
106 |
+
<!-- sidebar -->
|
107 |
+
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal sidebar-navigation floating overflow-auto">
|
108 |
+
<div class="pt-lg-2 mt-2 text-left sidebar-header">
|
109 |
+
<div class="sidebar-title mb-0 py-0">
|
110 |
+
<a href="./">Codewars Using R and RStudio</a>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
<div class="mt-2 flex-shrink-0 align-items-center">
|
114 |
+
<div class="sidebar-search">
|
115 |
+
<div id="quarto-search" class="" title="Search"></div>
|
116 |
+
</div>
|
117 |
+
</div>
|
118 |
+
<div class="sidebar-menu-container">
|
119 |
+
<ul class="list-unstyled mt-1">
|
120 |
+
<li class="sidebar-item">
|
121 |
+
<div class="sidebar-item-container">
|
122 |
+
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
123 |
+
<span class="menu-text">Preface</span></a>
|
124 |
+
</div>
|
125 |
+
</li>
|
126 |
+
<li class="sidebar-item">
|
127 |
+
<div class="sidebar-item-container">
|
128 |
+
<a href="./intro.html" class="sidebar-item-text sidebar-link">
|
129 |
+
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Introduction</span></span></a>
|
130 |
+
</div>
|
131 |
+
</li>
|
132 |
+
<li class="sidebar-item">
|
133 |
+
<div class="sidebar-item-container">
|
134 |
+
<a href="./summary.html" class="sidebar-item-text sidebar-link">
|
135 |
+
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Summary</span></span></a>
|
136 |
+
</div>
|
137 |
+
</li>
|
138 |
+
<li class="sidebar-item">
|
139 |
+
<div class="sidebar-item-container">
|
140 |
+
<a href="./references.html" class="sidebar-item-text sidebar-link active">
|
141 |
+
<span class="menu-text">References</span></a>
|
142 |
+
</div>
|
143 |
+
</li>
|
144 |
+
</ul>
|
145 |
+
</div>
|
146 |
+
</nav>
|
147 |
+
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
|
148 |
+
<!-- margin-sidebar -->
|
149 |
+
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
150 |
+
|
151 |
+
</div>
|
152 |
+
<!-- main -->
|
153 |
+
<main class="content" id="quarto-document-content">
|
154 |
+
|
155 |
+
<header id="title-block-header" class="quarto-title-block default">
|
156 |
+
<div class="quarto-title">
|
157 |
+
<h1 class="title">References</h1>
|
158 |
+
</div>
|
159 |
+
|
160 |
+
|
161 |
+
|
162 |
+
<div class="quarto-title-meta">
|
163 |
+
|
164 |
+
|
165 |
+
|
166 |
+
|
167 |
+
</div>
|
168 |
+
|
169 |
+
|
170 |
+
</header>
|
171 |
+
|
172 |
+
<div id="refs" class="references csl-bib-body hanging-indent" role="list">
|
173 |
+
<div id="ref-knuth84" class="csl-entry" role="listitem">
|
174 |
+
Knuth, Donald E. 1984. <span>“Literate Programming.”</span> <em>Comput.
|
175 |
+
J.</em> 27 (2): 97–111. <a href="https://doi.org/10.1093/comjnl/27.2.97">https://doi.org/10.1093/comjnl/27.2.97</a>.
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
</main> <!-- /main -->
|
182 |
+
<script id="quarto-html-after-body" type="application/javascript">
|
183 |
+
window.document.addEventListener("DOMContentLoaded", function (event) {
|
184 |
+
const toggleBodyColorMode = (bsSheetEl) => {
|
185 |
+
const mode = bsSheetEl.getAttribute("data-mode");
|
186 |
+
const bodyEl = window.document.querySelector("body");
|
187 |
+
if (mode === "dark") {
|
188 |
+
bodyEl.classList.add("quarto-dark");
|
189 |
+
bodyEl.classList.remove("quarto-light");
|
190 |
+
} else {
|
191 |
+
bodyEl.classList.add("quarto-light");
|
192 |
+
bodyEl.classList.remove("quarto-dark");
|
193 |
+
}
|
194 |
+
}
|
195 |
+
const toggleBodyColorPrimary = () => {
|
196 |
+
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
197 |
+
if (bsSheetEl) {
|
198 |
+
toggleBodyColorMode(bsSheetEl);
|
199 |
+
}
|
200 |
+
}
|
201 |
+
toggleBodyColorPrimary();
|
202 |
+
const icon = "";
|
203 |
+
const anchorJS = new window.AnchorJS();
|
204 |
+
anchorJS.options = {
|
205 |
+
placement: 'right',
|
206 |
+
icon: icon
|
207 |
+
};
|
208 |
+
anchorJS.add('.anchored');
|
209 |
+
const isCodeAnnotation = (el) => {
|
210 |
+
for (const clz of el.classList) {
|
211 |
+
if (clz.startsWith('code-annotation-')) {
|
212 |
+
return true;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
return false;
|
216 |
+
}
|
217 |
+
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
218 |
+
text: function(trigger) {
|
219 |
+
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
220 |
+
for (const childEl of codeEl.children) {
|
221 |
+
if (isCodeAnnotation(childEl)) {
|
222 |
+
childEl.remove();
|
223 |
+
}
|
224 |
+
}
|
225 |
+
return codeEl.innerText;
|
226 |
+
}
|
227 |
+
});
|
228 |
+
clipboard.on('success', function(e) {
|
229 |
+
// button target
|
230 |
+
const button = e.trigger;
|
231 |
+
// don't keep focus
|
232 |
+
button.blur();
|
233 |
+
// flash "checked"
|
234 |
+
button.classList.add('code-copy-button-checked');
|
235 |
+
var currentTitle = button.getAttribute("title");
|
236 |
+
button.setAttribute("title", "Copied!");
|
237 |
+
let tooltip;
|
238 |
+
if (window.bootstrap) {
|
239 |
+
button.setAttribute("data-bs-toggle", "tooltip");
|
240 |
+
button.setAttribute("data-bs-placement", "left");
|
241 |
+
button.setAttribute("data-bs-title", "Copied!");
|
242 |
+
tooltip = new bootstrap.Tooltip(button,
|
243 |
+
{ trigger: "manual",
|
244 |
+
customClass: "code-copy-button-tooltip",
|
245 |
+
offset: [0, -8]});
|
246 |
+
tooltip.show();
|
247 |
+
}
|
248 |
+
setTimeout(function() {
|
249 |
+
if (tooltip) {
|
250 |
+
tooltip.hide();
|
251 |
+
button.removeAttribute("data-bs-title");
|
252 |
+
button.removeAttribute("data-bs-toggle");
|
253 |
+
button.removeAttribute("data-bs-placement");
|
254 |
+
}
|
255 |
+
button.setAttribute("title", currentTitle);
|
256 |
+
button.classList.remove('code-copy-button-checked');
|
257 |
+
}, 1000);
|
258 |
+
// clear code selection
|
259 |
+
e.clearSelection();
|
260 |
+
});
|
261 |
+
function tippyHover(el, contentFn) {
|
262 |
+
const config = {
|
263 |
+
allowHTML: true,
|
264 |
+
content: contentFn,
|
265 |
+
maxWidth: 500,
|
266 |
+
delay: 100,
|
267 |
+
arrow: false,
|
268 |
+
appendTo: function(el) {
|
269 |
+
return el.parentElement;
|
270 |
+
},
|
271 |
+
interactive: true,
|
272 |
+
interactiveBorder: 10,
|
273 |
+
theme: 'quarto',
|
274 |
+
placement: 'bottom-start'
|
275 |
+
};
|
276 |
+
window.tippy(el, config);
|
277 |
+
}
|
278 |
+
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
279 |
+
for (var i=0; i<noterefs.length; i++) {
|
280 |
+
const ref = noterefs[i];
|
281 |
+
tippyHover(ref, function() {
|
282 |
+
// use id or data attribute instead here
|
283 |
+
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
284 |
+
try { href = new URL(href).hash; } catch {}
|
285 |
+
const id = href.replace(/^#\/?/, "");
|
286 |
+
const note = window.document.getElementById(id);
|
287 |
+
return note.innerHTML;
|
288 |
+
});
|
289 |
+
}
|
290 |
+
let selectedAnnoteEl;
|
291 |
+
const selectorForAnnotation = ( cell, annotation) => {
|
292 |
+
let cellAttr = 'data-code-cell="' + cell + '"';
|
293 |
+
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
294 |
+
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
295 |
+
return selector;
|
296 |
+
}
|
297 |
+
const selectCodeLines = (annoteEl) => {
|
298 |
+
const doc = window.document;
|
299 |
+
const targetCell = annoteEl.getAttribute("data-target-cell");
|
300 |
+
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
301 |
+
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
302 |
+
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
303 |
+
const lineIds = lines.map((line) => {
|
304 |
+
return targetCell + "-" + line;
|
305 |
+
})
|
306 |
+
let top = null;
|
307 |
+
let height = null;
|
308 |
+
let parent = null;
|
309 |
+
if (lineIds.length > 0) {
|
310 |
+
//compute the position of the single el (top and bottom and make a div)
|
311 |
+
const el = window.document.getElementById(lineIds[0]);
|
312 |
+
top = el.offsetTop;
|
313 |
+
height = el.offsetHeight;
|
314 |
+
parent = el.parentElement.parentElement;
|
315 |
+
if (lineIds.length > 1) {
|
316 |
+
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
317 |
+
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
318 |
+
height = bottom - top;
|
319 |
+
}
|
320 |
+
if (top !== null && height !== null && parent !== null) {
|
321 |
+
// cook up a div (if necessary) and position it
|
322 |
+
let div = window.document.getElementById("code-annotation-line-highlight");
|
323 |
+
if (div === null) {
|
324 |
+
div = window.document.createElement("div");
|
325 |
+
div.setAttribute("id", "code-annotation-line-highlight");
|
326 |
+
div.style.position = 'absolute';
|
327 |
+
parent.appendChild(div);
|
328 |
+
}
|
329 |
+
div.style.top = top - 2 + "px";
|
330 |
+
div.style.height = height + 4 + "px";
|
331 |
+
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
332 |
+
if (gutterDiv === null) {
|
333 |
+
gutterDiv = window.document.createElement("div");
|
334 |
+
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
335 |
+
gutterDiv.style.position = 'absolute';
|
336 |
+
const codeCell = window.document.getElementById(targetCell);
|
337 |
+
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
338 |
+
gutter.appendChild(gutterDiv);
|
339 |
+
}
|
340 |
+
gutterDiv.style.top = top - 2 + "px";
|
341 |
+
gutterDiv.style.height = height + 4 + "px";
|
342 |
+
}
|
343 |
+
selectedAnnoteEl = annoteEl;
|
344 |
+
}
|
345 |
+
};
|
346 |
+
const unselectCodeLines = () => {
|
347 |
+
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
348 |
+
elementsIds.forEach((elId) => {
|
349 |
+
const div = window.document.getElementById(elId);
|
350 |
+
if (div) {
|
351 |
+
div.remove();
|
352 |
+
}
|
353 |
+
});
|
354 |
+
selectedAnnoteEl = undefined;
|
355 |
+
};
|
356 |
+
// Attach click handler to the DT
|
357 |
+
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
358 |
+
for (const annoteDlNode of annoteDls) {
|
359 |
+
annoteDlNode.addEventListener('click', (event) => {
|
360 |
+
const clickedEl = event.target;
|
361 |
+
if (clickedEl !== selectedAnnoteEl) {
|
362 |
+
unselectCodeLines();
|
363 |
+
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
364 |
+
if (activeEl) {
|
365 |
+
activeEl.classList.remove('code-annotation-active');
|
366 |
+
}
|
367 |
+
selectCodeLines(clickedEl);
|
368 |
+
clickedEl.classList.add('code-annotation-active');
|
369 |
+
} else {
|
370 |
+
// Unselect the line
|
371 |
+
unselectCodeLines();
|
372 |
+
clickedEl.classList.remove('code-annotation-active');
|
373 |
+
}
|
374 |
+
});
|
375 |
+
}
|
376 |
+
const findCites = (el) => {
|
377 |
+
const parentEl = el.parentElement;
|
378 |
+
if (parentEl) {
|
379 |
+
const cites = parentEl.dataset.cites;
|
380 |
+
if (cites) {
|
381 |
+
return {
|
382 |
+
el,
|
383 |
+
cites: cites.split(' ')
|
384 |
+
};
|
385 |
+
} else {
|
386 |
+
return findCites(el.parentElement)
|
387 |
+
}
|
388 |
+
} else {
|
389 |
+
return undefined;
|
390 |
+
}
|
391 |
+
};
|
392 |
+
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
393 |
+
for (var i=0; i<bibliorefs.length; i++) {
|
394 |
+
const ref = bibliorefs[i];
|
395 |
+
const citeInfo = findCites(ref);
|
396 |
+
if (citeInfo) {
|
397 |
+
tippyHover(citeInfo.el, function() {
|
398 |
+
var popup = window.document.createElement('div');
|
399 |
+
citeInfo.cites.forEach(function(cite) {
|
400 |
+
var citeDiv = window.document.createElement('div');
|
401 |
+
citeDiv.classList.add('hanging-indent');
|
402 |
+
citeDiv.classList.add('csl-entry');
|
403 |
+
var biblioDiv = window.document.getElementById('ref-' + cite);
|
404 |
+
if (biblioDiv) {
|
405 |
+
citeDiv.innerHTML = biblioDiv.innerHTML;
|
406 |
+
}
|
407 |
+
popup.appendChild(citeDiv);
|
408 |
+
});
|
409 |
+
return popup.innerHTML;
|
410 |
+
});
|
411 |
+
}
|
412 |
+
}
|
413 |
+
});
|
414 |
+
</script>
|
415 |
+
<nav class="page-navigation">
|
416 |
+
<div class="nav-page nav-page-previous">
|
417 |
+
<a href="./summary.html" class="pagination-link">
|
418 |
+
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">2</span> <span class="chapter-title">Summary</span></span>
|
419 |
+
</a>
|
420 |
+
</div>
|
421 |
+
<div class="nav-page nav-page-next">
|
422 |
+
</div>
|
423 |
+
</nav>
|
424 |
+
</div> <!-- /content -->
|
425 |
+
|
426 |
+
|
427 |
+
|
428 |
+
</body></html>
|
summary.html
ADDED
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
3 |
+
|
4 |
+
<meta charset="utf-8">
|
5 |
+
<meta name="generator" content="quarto-1.3.433">
|
6 |
+
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
8 |
+
|
9 |
+
|
10 |
+
<title>Codewars Using R and RStudio - 2 Summary</title>
|
11 |
+
<style>
|
12 |
+
code{white-space: pre-wrap;}
|
13 |
+
span.smallcaps{font-variant: small-caps;}
|
14 |
+
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
15 |
+
div.column{flex: auto; overflow-x: auto;}
|
16 |
+
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
17 |
+
ul.task-list{list-style: none;}
|
18 |
+
ul.task-list li input[type="checkbox"] {
|
19 |
+
width: 0.8em;
|
20 |
+
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
21 |
+
vertical-align: middle;
|
22 |
+
}
|
23 |
+
/* CSS for syntax highlighting */
|
24 |
+
pre > code.sourceCode { white-space: pre; position: relative; }
|
25 |
+
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
26 |
+
pre > code.sourceCode > span:empty { height: 1.2em; }
|
27 |
+
.sourceCode { overflow: visible; }
|
28 |
+
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
29 |
+
div.sourceCode { margin: 1em 0; }
|
30 |
+
pre.sourceCode { margin: 0; }
|
31 |
+
@media screen {
|
32 |
+
div.sourceCode { overflow: auto; }
|
33 |
+
}
|
34 |
+
@media print {
|
35 |
+
pre > code.sourceCode { white-space: pre-wrap; }
|
36 |
+
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
37 |
+
}
|
38 |
+
pre.numberSource code
|
39 |
+
{ counter-reset: source-line 0; }
|
40 |
+
pre.numberSource code > span
|
41 |
+
{ position: relative; left: -4em; counter-increment: source-line; }
|
42 |
+
pre.numberSource code > span > a:first-child::before
|
43 |
+
{ content: counter(source-line);
|
44 |
+
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
45 |
+
border: none; display: inline-block;
|
46 |
+
-webkit-touch-callout: none; -webkit-user-select: none;
|
47 |
+
-khtml-user-select: none; -moz-user-select: none;
|
48 |
+
-ms-user-select: none; user-select: none;
|
49 |
+
padding: 0 4px; width: 4em;
|
50 |
+
}
|
51 |
+
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
52 |
+
div.sourceCode
|
53 |
+
{ }
|
54 |
+
@media screen {
|
55 |
+
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
56 |
+
}
|
57 |
+
</style>
|
58 |
+
|
59 |
+
|
60 |
+
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
61 |
+
<script src="site_libs/quarto-nav/headroom.min.js"></script>
|
62 |
+
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
63 |
+
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
64 |
+
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
65 |
+
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
66 |
+
<meta name="quarto:offset" content="./">
|
67 |
+
<link href="./references.html" rel="next">
|
68 |
+
<link href="./intro.html" rel="prev">
|
69 |
+
<script src="site_libs/quarto-html/quarto.js"></script>
|
70 |
+
<script src="site_libs/quarto-html/popper.min.js"></script>
|
71 |
+
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
72 |
+
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
73 |
+
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
74 |
+
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
75 |
+
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
76 |
+
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
77 |
+
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
|
78 |
+
<script id="quarto-search-options" type="application/json">{
|
79 |
+
"location": "sidebar",
|
80 |
+
"copy-button": false,
|
81 |
+
"collapse-after": 3,
|
82 |
+
"panel-placement": "start",
|
83 |
+
"type": "textbox",
|
84 |
+
"limit": 20,
|
85 |
+
"language": {
|
86 |
+
"search-no-results-text": "No results",
|
87 |
+
"search-matching-documents-text": "matching documents",
|
88 |
+
"search-copy-link-title": "Copy link to search",
|
89 |
+
"search-hide-matches-text": "Hide additional matches",
|
90 |
+
"search-more-match-text": "more match in this document",
|
91 |
+
"search-more-matches-text": "more matches in this document",
|
92 |
+
"search-clear-button-title": "Clear",
|
93 |
+
"search-detached-cancel-button-title": "Cancel",
|
94 |
+
"search-submit-button-title": "Submit",
|
95 |
+
"search-label": "Search"
|
96 |
+
}
|
97 |
+
}</script>
|
98 |
+
|
99 |
+
|
100 |
+
</head>
|
101 |
+
|
102 |
+
<body class="nav-sidebar floating">
|
103 |
+
|
104 |
+
<div id="quarto-search-results"></div>
|
105 |
+
<header id="quarto-header" class="headroom fixed-top">
|
106 |
+
<nav class="quarto-secondary-nav">
|
107 |
+
<div class="container-fluid d-flex">
|
108 |
+
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
109 |
+
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
110 |
+
</button>
|
111 |
+
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./summary.html"><span class="chapter-number">2</span> <span class="chapter-title">Summary</span></a></li></ol></nav>
|
112 |
+
<a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
113 |
+
</a>
|
114 |
+
<button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
|
115 |
+
<i class="bi bi-search"></i>
|
116 |
+
</button>
|
117 |
+
</div>
|
118 |
+
</nav>
|
119 |
+
</header>
|
120 |
+
<!-- content -->
|
121 |
+
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
|
122 |
+
<!-- sidebar -->
|
123 |
+
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal sidebar-navigation floating overflow-auto">
|
124 |
+
<div class="pt-lg-2 mt-2 text-left sidebar-header">
|
125 |
+
<div class="sidebar-title mb-0 py-0">
|
126 |
+
<a href="./">Codewars Using R and RStudio</a>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
<div class="mt-2 flex-shrink-0 align-items-center">
|
130 |
+
<div class="sidebar-search">
|
131 |
+
<div id="quarto-search" class="" title="Search"></div>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="sidebar-menu-container">
|
135 |
+
<ul class="list-unstyled mt-1">
|
136 |
+
<li class="sidebar-item">
|
137 |
+
<div class="sidebar-item-container">
|
138 |
+
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
139 |
+
<span class="menu-text">Preface</span></a>
|
140 |
+
</div>
|
141 |
+
</li>
|
142 |
+
<li class="sidebar-item">
|
143 |
+
<div class="sidebar-item-container">
|
144 |
+
<a href="./intro.html" class="sidebar-item-text sidebar-link">
|
145 |
+
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Introduction</span></span></a>
|
146 |
+
</div>
|
147 |
+
</li>
|
148 |
+
<li class="sidebar-item">
|
149 |
+
<div class="sidebar-item-container">
|
150 |
+
<a href="./summary.html" class="sidebar-item-text sidebar-link active">
|
151 |
+
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Summary</span></span></a>
|
152 |
+
</div>
|
153 |
+
</li>
|
154 |
+
<li class="sidebar-item">
|
155 |
+
<div class="sidebar-item-container">
|
156 |
+
<a href="./references.html" class="sidebar-item-text sidebar-link">
|
157 |
+
<span class="menu-text">References</span></a>
|
158 |
+
</div>
|
159 |
+
</li>
|
160 |
+
</ul>
|
161 |
+
</div>
|
162 |
+
</nav>
|
163 |
+
<div id="quarto-sidebar-glass" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar,#quarto-sidebar-glass"></div>
|
164 |
+
<!-- margin-sidebar -->
|
165 |
+
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
166 |
+
|
167 |
+
</div>
|
168 |
+
<!-- main -->
|
169 |
+
<main class="content" id="quarto-document-content">
|
170 |
+
|
171 |
+
<header id="title-block-header" class="quarto-title-block default">
|
172 |
+
<div class="quarto-title">
|
173 |
+
<h1 class="title"><span class="chapter-number">2</span> <span class="chapter-title">Summary</span></h1>
|
174 |
+
</div>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
<div class="quarto-title-meta">
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
</div>
|
184 |
+
|
185 |
+
|
186 |
+
</header>
|
187 |
+
|
188 |
+
<p>In summary, this book has no content whatsoever.</p>
|
189 |
+
<div class="cell">
|
190 |
+
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="dv">1</span> <span class="sc">+</span> <span class="dv">1</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
191 |
+
<div class="cell-output cell-output-stdout">
|
192 |
+
<pre><code>[1] 2</code></pre>
|
193 |
+
</div>
|
194 |
+
</div>
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
</main> <!-- /main -->
|
199 |
+
<script id="quarto-html-after-body" type="application/javascript">
|
200 |
+
window.document.addEventListener("DOMContentLoaded", function (event) {
|
201 |
+
const toggleBodyColorMode = (bsSheetEl) => {
|
202 |
+
const mode = bsSheetEl.getAttribute("data-mode");
|
203 |
+
const bodyEl = window.document.querySelector("body");
|
204 |
+
if (mode === "dark") {
|
205 |
+
bodyEl.classList.add("quarto-dark");
|
206 |
+
bodyEl.classList.remove("quarto-light");
|
207 |
+
} else {
|
208 |
+
bodyEl.classList.add("quarto-light");
|
209 |
+
bodyEl.classList.remove("quarto-dark");
|
210 |
+
}
|
211 |
+
}
|
212 |
+
const toggleBodyColorPrimary = () => {
|
213 |
+
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
214 |
+
if (bsSheetEl) {
|
215 |
+
toggleBodyColorMode(bsSheetEl);
|
216 |
+
}
|
217 |
+
}
|
218 |
+
toggleBodyColorPrimary();
|
219 |
+
const icon = "";
|
220 |
+
const anchorJS = new window.AnchorJS();
|
221 |
+
anchorJS.options = {
|
222 |
+
placement: 'right',
|
223 |
+
icon: icon
|
224 |
+
};
|
225 |
+
anchorJS.add('.anchored');
|
226 |
+
const isCodeAnnotation = (el) => {
|
227 |
+
for (const clz of el.classList) {
|
228 |
+
if (clz.startsWith('code-annotation-')) {
|
229 |
+
return true;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
return false;
|
233 |
+
}
|
234 |
+
const clipboard = new window.ClipboardJS('.code-copy-button', {
|
235 |
+
text: function(trigger) {
|
236 |
+
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
237 |
+
for (const childEl of codeEl.children) {
|
238 |
+
if (isCodeAnnotation(childEl)) {
|
239 |
+
childEl.remove();
|
240 |
+
}
|
241 |
+
}
|
242 |
+
return codeEl.innerText;
|
243 |
+
}
|
244 |
+
});
|
245 |
+
clipboard.on('success', function(e) {
|
246 |
+
// button target
|
247 |
+
const button = e.trigger;
|
248 |
+
// don't keep focus
|
249 |
+
button.blur();
|
250 |
+
// flash "checked"
|
251 |
+
button.classList.add('code-copy-button-checked');
|
252 |
+
var currentTitle = button.getAttribute("title");
|
253 |
+
button.setAttribute("title", "Copied!");
|
254 |
+
let tooltip;
|
255 |
+
if (window.bootstrap) {
|
256 |
+
button.setAttribute("data-bs-toggle", "tooltip");
|
257 |
+
button.setAttribute("data-bs-placement", "left");
|
258 |
+
button.setAttribute("data-bs-title", "Copied!");
|
259 |
+
tooltip = new bootstrap.Tooltip(button,
|
260 |
+
{ trigger: "manual",
|
261 |
+
customClass: "code-copy-button-tooltip",
|
262 |
+
offset: [0, -8]});
|
263 |
+
tooltip.show();
|
264 |
+
}
|
265 |
+
setTimeout(function() {
|
266 |
+
if (tooltip) {
|
267 |
+
tooltip.hide();
|
268 |
+
button.removeAttribute("data-bs-title");
|
269 |
+
button.removeAttribute("data-bs-toggle");
|
270 |
+
button.removeAttribute("data-bs-placement");
|
271 |
+
}
|
272 |
+
button.setAttribute("title", currentTitle);
|
273 |
+
button.classList.remove('code-copy-button-checked');
|
274 |
+
}, 1000);
|
275 |
+
// clear code selection
|
276 |
+
e.clearSelection();
|
277 |
+
});
|
278 |
+
function tippyHover(el, contentFn) {
|
279 |
+
const config = {
|
280 |
+
allowHTML: true,
|
281 |
+
content: contentFn,
|
282 |
+
maxWidth: 500,
|
283 |
+
delay: 100,
|
284 |
+
arrow: false,
|
285 |
+
appendTo: function(el) {
|
286 |
+
return el.parentElement;
|
287 |
+
},
|
288 |
+
interactive: true,
|
289 |
+
interactiveBorder: 10,
|
290 |
+
theme: 'quarto',
|
291 |
+
placement: 'bottom-start'
|
292 |
+
};
|
293 |
+
window.tippy(el, config);
|
294 |
+
}
|
295 |
+
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
296 |
+
for (var i=0; i<noterefs.length; i++) {
|
297 |
+
const ref = noterefs[i];
|
298 |
+
tippyHover(ref, function() {
|
299 |
+
// use id or data attribute instead here
|
300 |
+
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
301 |
+
try { href = new URL(href).hash; } catch {}
|
302 |
+
const id = href.replace(/^#\/?/, "");
|
303 |
+
const note = window.document.getElementById(id);
|
304 |
+
return note.innerHTML;
|
305 |
+
});
|
306 |
+
}
|
307 |
+
let selectedAnnoteEl;
|
308 |
+
const selectorForAnnotation = ( cell, annotation) => {
|
309 |
+
let cellAttr = 'data-code-cell="' + cell + '"';
|
310 |
+
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
311 |
+
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
312 |
+
return selector;
|
313 |
+
}
|
314 |
+
const selectCodeLines = (annoteEl) => {
|
315 |
+
const doc = window.document;
|
316 |
+
const targetCell = annoteEl.getAttribute("data-target-cell");
|
317 |
+
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
318 |
+
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
319 |
+
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
320 |
+
const lineIds = lines.map((line) => {
|
321 |
+
return targetCell + "-" + line;
|
322 |
+
})
|
323 |
+
let top = null;
|
324 |
+
let height = null;
|
325 |
+
let parent = null;
|
326 |
+
if (lineIds.length > 0) {
|
327 |
+
//compute the position of the single el (top and bottom and make a div)
|
328 |
+
const el = window.document.getElementById(lineIds[0]);
|
329 |
+
top = el.offsetTop;
|
330 |
+
height = el.offsetHeight;
|
331 |
+
parent = el.parentElement.parentElement;
|
332 |
+
if (lineIds.length > 1) {
|
333 |
+
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
334 |
+
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
335 |
+
height = bottom - top;
|
336 |
+
}
|
337 |
+
if (top !== null && height !== null && parent !== null) {
|
338 |
+
// cook up a div (if necessary) and position it
|
339 |
+
let div = window.document.getElementById("code-annotation-line-highlight");
|
340 |
+
if (div === null) {
|
341 |
+
div = window.document.createElement("div");
|
342 |
+
div.setAttribute("id", "code-annotation-line-highlight");
|
343 |
+
div.style.position = 'absolute';
|
344 |
+
parent.appendChild(div);
|
345 |
+
}
|
346 |
+
div.style.top = top - 2 + "px";
|
347 |
+
div.style.height = height + 4 + "px";
|
348 |
+
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
349 |
+
if (gutterDiv === null) {
|
350 |
+
gutterDiv = window.document.createElement("div");
|
351 |
+
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
352 |
+
gutterDiv.style.position = 'absolute';
|
353 |
+
const codeCell = window.document.getElementById(targetCell);
|
354 |
+
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
355 |
+
gutter.appendChild(gutterDiv);
|
356 |
+
}
|
357 |
+
gutterDiv.style.top = top - 2 + "px";
|
358 |
+
gutterDiv.style.height = height + 4 + "px";
|
359 |
+
}
|
360 |
+
selectedAnnoteEl = annoteEl;
|
361 |
+
}
|
362 |
+
};
|
363 |
+
const unselectCodeLines = () => {
|
364 |
+
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
365 |
+
elementsIds.forEach((elId) => {
|
366 |
+
const div = window.document.getElementById(elId);
|
367 |
+
if (div) {
|
368 |
+
div.remove();
|
369 |
+
}
|
370 |
+
});
|
371 |
+
selectedAnnoteEl = undefined;
|
372 |
+
};
|
373 |
+
// Attach click handler to the DT
|
374 |
+
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
375 |
+
for (const annoteDlNode of annoteDls) {
|
376 |
+
annoteDlNode.addEventListener('click', (event) => {
|
377 |
+
const clickedEl = event.target;
|
378 |
+
if (clickedEl !== selectedAnnoteEl) {
|
379 |
+
unselectCodeLines();
|
380 |
+
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
381 |
+
if (activeEl) {
|
382 |
+
activeEl.classList.remove('code-annotation-active');
|
383 |
+
}
|
384 |
+
selectCodeLines(clickedEl);
|
385 |
+
clickedEl.classList.add('code-annotation-active');
|
386 |
+
} else {
|
387 |
+
// Unselect the line
|
388 |
+
unselectCodeLines();
|
389 |
+
clickedEl.classList.remove('code-annotation-active');
|
390 |
+
}
|
391 |
+
});
|
392 |
+
}
|
393 |
+
const findCites = (el) => {
|
394 |
+
const parentEl = el.parentElement;
|
395 |
+
if (parentEl) {
|
396 |
+
const cites = parentEl.dataset.cites;
|
397 |
+
if (cites) {
|
398 |
+
return {
|
399 |
+
el,
|
400 |
+
cites: cites.split(' ')
|
401 |
+
};
|
402 |
+
} else {
|
403 |
+
return findCites(el.parentElement)
|
404 |
+
}
|
405 |
+
} else {
|
406 |
+
return undefined;
|
407 |
+
}
|
408 |
+
};
|
409 |
+
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
410 |
+
for (var i=0; i<bibliorefs.length; i++) {
|
411 |
+
const ref = bibliorefs[i];
|
412 |
+
const citeInfo = findCites(ref);
|
413 |
+
if (citeInfo) {
|
414 |
+
tippyHover(citeInfo.el, function() {
|
415 |
+
var popup = window.document.createElement('div');
|
416 |
+
citeInfo.cites.forEach(function(cite) {
|
417 |
+
var citeDiv = window.document.createElement('div');
|
418 |
+
citeDiv.classList.add('hanging-indent');
|
419 |
+
citeDiv.classList.add('csl-entry');
|
420 |
+
var biblioDiv = window.document.getElementById('ref-' + cite);
|
421 |
+
if (biblioDiv) {
|
422 |
+
citeDiv.innerHTML = biblioDiv.innerHTML;
|
423 |
+
}
|
424 |
+
popup.appendChild(citeDiv);
|
425 |
+
});
|
426 |
+
return popup.innerHTML;
|
427 |
+
});
|
428 |
+
}
|
429 |
+
}
|
430 |
+
});
|
431 |
+
</script>
|
432 |
+
<nav class="page-navigation">
|
433 |
+
<div class="nav-page nav-page-previous">
|
434 |
+
<a href="./intro.html" class="pagination-link">
|
435 |
+
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span> <span class="chapter-title">Introduction</span></span>
|
436 |
+
</a>
|
437 |
+
</div>
|
438 |
+
<div class="nav-page nav-page-next">
|
439 |
+
<a href="./references.html" class="pagination-link">
|
440 |
+
<span class="nav-page-text">References</span> <i class="bi bi-arrow-right-short"></i>
|
441 |
+
</a>
|
442 |
+
</div>
|
443 |
+
</nav>
|
444 |
+
</div> <!-- /content -->
|
445 |
+
|
446 |
+
|
447 |
+
|
448 |
+
</body></html>
|