mirror of
https://github.com/kidwellj/hacking_religion_textbook.git
synced 2025-06-15 16:54:10 +00:00
fixing structure
This commit is contained in:
parent
a7109b28a8
commit
876d9ee193
17 changed files with 428 additions and 778 deletions
|
@ -84,7 +84,7 @@ div.csl-indent {
|
|||
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
||||
<meta name="quarto:offset" content="./">
|
||||
<link href="./chapter_2.html" rel="next">
|
||||
<link href="./intro.html" rel="prev">
|
||||
<link href="./index.html" rel="prev">
|
||||
<script src="site_libs/quarto-html/quarto.js"></script>
|
||||
<script src="site_libs/quarto-html/popper.min.js"></script>
|
||||
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
||||
|
@ -155,12 +155,6 @@ div.csl-indent {
|
|||
<li class="sidebar-item">
|
||||
<div class="sidebar-item-container">
|
||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
||||
<span class="menu-text">Preface</span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
<div class="sidebar-item-container">
|
||||
<a href="./intro.html" class="sidebar-item-text sidebar-link">
|
||||
<span class="menu-text">Introduction: Hacking Religion</span></a>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -227,7 +221,6 @@ div.csl-indent {
|
|||
<li><a href="#is-your-chart-accurate-telling-the-truth-in-data-science" id="toc-is-your-chart-accurate-telling-the-truth-in-data-science" class="nav-link" data-scroll-target="#is-your-chart-accurate-telling-the-truth-in-data-science"><span class="header-section-number">1.5</span> Is your chart accurate? Telling the truth in data science</a></li>
|
||||
<li><a href="#making-our-script-reproducible" id="toc-making-our-script-reproducible" class="nav-link" data-scroll-target="#making-our-script-reproducible"><span class="header-section-number">1.6</span> Making our script reproducible</a></li>
|
||||
<li><a href="#multifactor-visualisation" id="toc-multifactor-visualisation" class="nav-link" data-scroll-target="#multifactor-visualisation"><span class="header-section-number">1.7</span> Multifactor Visualisation</a></li>
|
||||
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
@ -579,7 +572,7 @@ div.csl-indent {
|
|||
<dl class="code-annotation-container-grid">
|
||||
<dt data-target-cell="annotated-cell-10" data-target-annotation="2">2</dt>
|
||||
<dd>
|
||||
<span data-code-cell="annotated-cell-10" data-code-annotation="2" data-code-lines="1">We’ll re-order the column by size.</span>
|
||||
<span data-code-lines="1" data-code-cell="annotated-cell-10" data-code-annotation="2">We’ll re-order the column by size.</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
@ -602,19 +595,19 @@ div.csl-indent {
|
|||
<dl class="code-annotation-container-grid">
|
||||
<dt data-target-cell="annotated-cell-11" data-target-annotation="1">1</dt>
|
||||
<dd>
|
||||
<span data-code-cell="annotated-cell-11" data-code-annotation="1" data-code-lines="1">First, remove the column with region names and the totals for the regions as we want just integer data.</span>
|
||||
<span data-code-lines="1" data-code-cell="annotated-cell-11" data-code-annotation="1">First, remove the column with region names and the totals for the regions as we want just integer data.</span>
|
||||
</dd>
|
||||
<dt data-target-cell="annotated-cell-11" data-target-annotation="2">2</dt>
|
||||
<dd>
|
||||
<span data-code-cell="annotated-cell-11" data-code-annotation="2" data-code-lines="3">Second calculate the totals. In this example we use the tidyverse library <code>dplyr()</code>, but you can also do this using base R with <code>colsums()</code> like this: <code>uk_census_2021_religion_totals <- colSums(uk_census_2021_religion_totals, na.rm = TRUE)</code>. The downside with base R is that you’ll also need to convert the result into a dataframe for <code>ggplot</code> like this: <code>uk_census_2021_religion_totals <- as.data.frame(uk_census_2021_religion_totals)</code></span>
|
||||
<span data-code-lines="3" data-code-cell="annotated-cell-11" data-code-annotation="2">Second calculate the totals. In this example we use the tidyverse library <code>dplyr()</code>, but you can also do this using base R with <code>colsums()</code> like this: <code>uk_census_2021_religion_totals <- colSums(uk_census_2021_religion_totals, na.rm = TRUE)</code>. The downside with base R is that you’ll also need to convert the result into a dataframe for <code>ggplot</code> like this: <code>uk_census_2021_religion_totals <- as.data.frame(uk_census_2021_religion_totals)</code></span>
|
||||
</dd>
|
||||
<dt data-target-cell="annotated-cell-11" data-target-annotation="3">3</dt>
|
||||
<dd>
|
||||
<span data-code-cell="annotated-cell-11" data-code-annotation="3" data-code-lines="4">In order to visualise this data using ggplot, we need to shift this data from wide to long format. This is a quick job using gather()</span>
|
||||
<span data-code-lines="4" data-code-cell="annotated-cell-11" data-code-annotation="3">In order to visualise this data using ggplot, we need to shift this data from wide to long format. This is a quick job using gather()</span>
|
||||
</dd>
|
||||
<dt data-target-cell="annotated-cell-11" data-target-annotation="4">4</dt>
|
||||
<dd>
|
||||
<span data-code-cell="annotated-cell-11" data-code-annotation="4" data-code-lines="5">Now plot it out and have a look!</span>
|
||||
<span data-code-lines="5" data-code-cell="annotated-cell-11" data-code-annotation="4">Now plot it out and have a look!</span>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
@ -876,9 +869,6 @@ What is Nomis?
|
|||
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||
<span id="cb25-3"><a href="#cb25-3" aria-hidden="true" tabindex="-1"></a><span class="fu">ggsave</span>(<span class="st">"chart.png"</span>, <span class="at">plot=</span>plot1, <span class="at">width =</span> <span class="dv">8</span>, <span class="at">height =</span> <span class="dv">10</span>, <span class="at">units=</span><span class="fu">c</span>(<span class="st">"in"</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="references" class="level1 unnumbered">
|
||||
<h1 class="unnumbered">References</h1>
|
||||
<div id="refs" role="list" style="display: none">
|
||||
|
||||
</div>
|
||||
|
@ -1122,7 +1112,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||
</script>
|
||||
<nav class="page-navigation">
|
||||
<div class="nav-page nav-page-previous">
|
||||
<a href="./intro.html" class="pagination-link">
|
||||
<a href="./index.html" class="pagination-link">
|
||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Introduction: Hacking Religion</span>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue