<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />


<meta name="author" content="@ Northwest Universities R Day" />


<title>Reproducible Research w/ rrtools</title>

<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/cerulean.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/font-awesome-5.0.13/css/fa-svg-with-js.css" rel="stylesheet" />
<script src="site_libs/font-awesome-5.0.13/js/fontawesome-all.min.js"></script>
<script src="site_libs/font-awesome-5.0.13/js/fa-v4-shims.min.js"></script>


<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
  { position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
  { content: attr(data-line-number);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; pointer-events: all; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
    color: #aaaaaa;
  }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
div.sourceCode
  { background-color: #f8f8f8; }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ef2929; } /* Alert */
code span.an { color: #8f5902; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #c4a000; } /* Attribute */
code span.bn { color: #0000cf; } /* BaseN */
code span.cf { color: #204a87; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4e9a06; } /* Char */
code span.cn { color: #000000; } /* Constant */
code span.co { color: #8f5902; font-style: italic; } /* Comment */
code span.cv { color: #8f5902; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #8f5902; font-weight: bold; font-style: italic; } /* Documentation */
code span.dt { color: #204a87; } /* DataType */
code span.dv { color: #0000cf; } /* DecVal */
code span.er { color: #a40000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #0000cf; } /* Float */
code span.fu { color: #000000; } /* Function */
code span.im { } /* Import */
code span.in { color: #8f5902; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #204a87; font-weight: bold; } /* Keyword */
code span.op { color: #ce5c00; font-weight: bold; } /* Operator */
code span.ot { color: #8f5902; } /* Other */
code span.pp { color: #8f5902; font-style: italic; } /* Preprocessor */
code span.sc { color: #000000; } /* SpecialChar */
code span.ss { color: #4e9a06; } /* SpecialString */
code span.st { color: #4e9a06; } /* String */
code span.va { color: #000000; } /* Variable */
code span.vs { color: #4e9a06; } /* VerbatimString */
code span.wa { color: #8f5902; font-weight: bold; font-style: italic; } /* Warning */
</style>
<style type="text/css">
  pre:not([class]) {
    background-color: white;
  }
</style>


<style type="text/css">
h1 {
  font-size: 34px;
}
h1.title {
  font-size: 38px;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 24px;
}
h4 {
  font-size: 18px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 12px;
}
.table th:not([align]) {
  text-align: left;
}
</style>


</head>

<body>

<style type = "text/css">
.main-container {
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
code {
  color: inherit;
  background-color: rgba(0, 0, 0, 0.04);
}
img {
  max-width:100%;
  height: auto;
}
.tabbed-pane {
  padding-top: 12px;
}
.html-widget {
  margin-bottom: 20px;
}
button.code-folding-btn:focus {
  outline: none;
}
</style>


<style type="text/css">
/* padding for bootstrap navbar */
body {
  padding-top: 51px;
  padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar)  */
.section h1 {
  padding-top: 56px;
  margin-top: -56px;
}

.section h2 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h3 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h4 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h5 {
  padding-top: 56px;
  margin-top: -56px;
}
.section h6 {
  padding-top: 56px;
  margin-top: -56px;
}
</style>

<script>
// manage active state of menu based on current page
$(document).ready(function () {
  // active menu anchor
  href = window.location.pathname
  href = href.substr(href.lastIndexOf('/') + 1)
  if (href === "")
    href = "index.html";
  var menuAnchor = $('a[href="' + href + '"]');

  // mark it active
  menuAnchor.parent().addClass('active');

  // if it's got a parent navbar menu mark it active as well
  menuAnchor.closest('li.dropdown').addClass('active');
});
</script>


<div class="container-fluid main-container">

<!-- tabsets -->
<script>
$(document).ready(function () {
  window.buildTabsets("TOC");
});
</script>

<!-- code folding -->




<script>
$(document).ready(function ()  {

    // move toc-ignore selectors from section div to header
    $('div.section.toc-ignore')
        .removeClass('toc-ignore')
        .children('h1,h2,h3,h4,h5').addClass('toc-ignore');

    // establish options
    var options = {
      selectors: "h1,h2,h3",
      theme: "bootstrap3",
      context: '.toc-content',
      hashGenerator: function (text) {
        return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
      },
      ignoreSelector: ".toc-ignore",
      scrollTo: 0
    };
    options.showAndHide = true;
    options.smoothScroll = true;

    // tocify
    var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>

<style type="text/css">

#TOC {
  margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
  position: relative;
  width: 100%;
}
}


.toc-content {
  padding-left: 30px;
  padding-right: 40px;
}

div.main-container {
  max-width: 1200px;
}

div.tocify {
  width: 20%;
  max-width: 260px;
  max-height: 85%;
}

@media (min-width: 768px) and (max-width: 991px) {
  div.tocify {
    width: 25%;
  }
}

@media (max-width: 767px) {
  div.tocify {
    width: 100%;
    max-width: none;
  }
}

.tocify ul, .tocify li {
  line-height: 20px;
}

.tocify-subheader .tocify-item {
  font-size: 0.90em;
  padding-left: 25px;
  text-indent: 0;
}

.tocify .list-group-item {
  border-radius: 0px;
}


</style>

<!-- setup 3col/9col grid for toc_float and main content  -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>

<div class="toc-content col-xs-12 col-sm-8 col-md-9">




<div class="navbar navbar-default  navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.html">Reproducible Research with rrtools</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav">
        <li>
  <a href="index.html">Home</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    <span class="fa fa-gear"></span>
     
    Handouts
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu">
    <li class="dropdown-header">Workshop Sections</li>
    <li>
      <a href="intro.html">Welcome &amp; Background</a>
    </li>
    <li>
      <a href="create-compendium.html">Create a compendium</a>
    </li>
    <li>
      <a href="package.html">Manage functionality as a package</a>
    </li>
    <li>
      <a href="paper.html">Create a reproducible paper</a>
    </li>
  </ul>
</li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li>
  <a href="https://bit.ly/rrtools_wks">Get Workshop Materials</a>
</li>
<li>
  <a href="https://github.com/annakrystalli/rrcompendium-complete">Final compendium</a>
</li>
<li>
  <a href="https://github.com/annakrystalli/rrtools-repro-research">
    <span class="fa fa-github"></span>
     
  </a>
</li>
      </ul>
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

<!-- Add a small amount of space between sections. -->
<style type="text/css">
div.section {
  padding-top: 12px;
}
</style>

<div class="fluid-row" id="header">



<h1 class="title toc-ignore">Reproducible Research w/ rrtools</h1>
<h3 class="subtitle"><em>✨ harnessing the power of convention ✨</em></h3>
<h4 class="author"><em>@ Northwest Universities R Day</em></h4>
<h4 class="date"><em>31st Oct 2018</em></h4>

</div>


<p><strong>Last updated:</strong> 2018-11-10</p>
<strong>workflowr checks:</strong> <small>(Click a bullet for more information)</small>
<ul>
<li>
<details>
<p><summary> <strong style="color:blue;">✔</strong> <strong>R Markdown file:</strong> up-to-date </summary></p>
<p>Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.</p>
</details>
</li>
<li>
<details>
<p><summary> <strong style="color:blue;">✔</strong> <strong>Environment:</strong> empty </summary></p>
<p>Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.</p>
</details>
</li>
<li>
<details>
<p><summary> <strong style="color:blue;">✔</strong> <strong>Seed:</strong> <code>set.seed(20181015)</code> </summary></p>
<p>The command <code>set.seed(20181015)</code> was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.</p>
</details>
</li>
<li>
<details>
<p><summary> <strong style="color:blue;">✔</strong> <strong>Session information:</strong> recorded </summary></p>
<p>Great job! Recording the operating system, R version, and package versions is critical for reproducibility.</p>
</details>
</li>
<li>
<details>
<p><summary> <strong style="color:blue;">✔</strong> <strong>Repository version:</strong> <a href="https://github.com/annakrystalli/rrtools-repro-research/tree/63e35eeae98931a11b79ef7702501bfdce34f4de" target="_blank">63e35ee</a> </summary></p>
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated. <br><br> Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use <code>wflow_publish</code> or <code>wflow_git_commit</code>). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
<pre><code>
Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/data/
    Ignored:    analysis/package.Rmd
    Ignored:    assets/
    Ignored:    docs/.DS_Store

Untracked files:
    Untracked:  docs/assets/Boettiger-2018-Ecology_Letters.pdf
    Untracked:  docs/assets/Packaging-Data-Analytical Work-Reproducibly-Using-R-and-Friends.pdf
    Untracked:  docs/css/
    Untracked:  libs/

</code></pre>
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
</details>
</li>
</ul>
<details>
<summary> <small><strong>Expand here to see past versions:</strong></small> </summary>
<ul>
<table style="border-collapse:separate; border-spacing:5px;">
<thead>
<tr>
<th style="text-align:left;">
File
</th>
<th style="text-align:left;">
Version
</th>
<th style="text-align:left;">
Author
</th>
<th style="text-align:left;">
Date
</th>
<th style="text-align:left;">
Message
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/annakrystalli/rrtools-repro-research/2c1e9572829c307c3d6921c6bd98d94ecb112597/docs/intro.html" target="_blank">2c1e957</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-31
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/annakrystalli/rrtools-repro-research/c26c9360887245207869d7cd79130f334488a96a/docs/intro.html" target="_blank">c26c936</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-31
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/annakrystalli/rrtools-repro-research/blob/d3f45b6cdcf84825e35310c60409b34658cfd834/analysis/intro.Rmd" target="_blank">d3f45b6</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-31
</td>
<td style="text-align:left;">
add intro, re-publish
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/annakrystalli/rrtools-repro-research/52adf4f0c35dc3fc2b7d57ade327271f3565dd7b/docs/intro.html" target="_blank">52adf4f</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-30
</td>
<td style="text-align:left;">
Build site.
</td>
</tr>
<tr>
<td style="text-align:left;">
html
</td>
<td style="text-align:left;">
<a href="https://cdn.rawgit.com/annakrystalli/rrtools-repro-research/921a7f864708008758ca207fa2761de380f22642/docs/intro.html" target="_blank">921a7f8</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-30
</td>
<td style="text-align:left;">
commit docs
</td>
</tr>
<tr>
<td style="text-align:left;">
Rmd
</td>
<td style="text-align:left;">
<a href="https://github.com/annakrystalli/rrtools-repro-research/blob/f1468acbb039fedf24ab2799ff1ca290f4df46fa/analysis/intro.Rmd" target="_blank">f1468ac</a>
</td>
<td style="text-align:left;">
annakrystalli
</td>
<td style="text-align:left;">
2018-10-30
</td>
<td style="text-align:left;">
commit Rmd
</td>
</tr>
</tbody>
</table>
</ul>
</details>
<hr />
<div id="hello-and-welcome" class="section level1">
<h1>👋 Hello and welcome</h1>
<div id="me-dr-anna-krystalli" class="section level3">
<h3>me: Dr Anna Krystalli</h3>
<ul>
<li><strong>Research Software Engineer</strong>, <em>University of Sheffield</em>
<ul>
<li>twitter <strong><span class="citation">@annakrystalli</span></strong></li>
<li>github <strong><span class="citation">@annakrystalli</span></strong></li>
<li>email <strong>a.krystalli[at]sheffield.ac.uk</strong></li>
</ul></li>
<li><strong>Editor <a href="http://onboarding.ropensci.org/">rOpenSci</a></strong></li>
</ul>
</div>
</div>
<div id="background" class="section level1">
<h1>Background</h1>
<ul>
<li><p><strong>Research is increasingly computational</strong></p></li>
<li><strong>Code and data are important research outputs</strong>
<ul>
<li>yet, we still focus mainly on curating papers.</li>
</ul></li>
<li><strong>Calls for openness</strong>
<ul>
<li>stick: reproducibility crisis</li>
<li>carrot: huge rewards from working open</li>
</ul></li>
</ul>
<div id="yet-we-lack-conventions-and-technical-infrastructure-for-such-openness." class="section level5">
<h5>Yet we lack conventions and technical infrastructure for such openness.</h5>
<p><br></p>
</div>
<div id="enter-the-research-compendium" class="section level2">
<h2>Enter the Research Compendium</h2>
<blockquote>
<p>The goal of a research compendium is to provide a <strong>standard</strong> and easily recognizable way for <strong>organizing the digital materials</strong> of a project to enable others to <strong>inspect, reproduce, and extend the research</strong>.</p>
</blockquote>
<div id="three-generic-principles" class="section level3">
<h3>Three Generic Principles</h3>
<ol style="list-style-type: decimal">
<li><strong>Organize its files according to prevailing conventions</strong>:
<ul>
<li>help other people recognize the structure of the project,</li>
<li>supports tool building which takes advantage of the shared structure.</li>
</ul></li>
<li><p><strong>Separate of data, method, and output</strong>, while making the relationship between them clear.</p></li>
<li><p><strong>Specify the computational environment</strong> that was used for the original analysis.</p></li>
</ol>
<p><br></p>
</div>
</div>
<div id="r-community-response" class="section level2">
<h2>R community response</h2>
<blockquote>
<p>R packages can be used as a research compendium for organising and sharing files!</p>
</blockquote>
<ol style="list-style-type: decimal">
<li><p>_Wickham, H. (2017) <a href="https://docs.google.com/document/d/1LzZKS44y4OEJa4Azg5reGToNAZL0e0HSUwxamNY7E-Y/edit#heading=h.blggi16hdosp">Research compendia. Note prepared for the 2017 rOpenSci Unconf_</a></p></li>
<li><p>Ben Marwick, Carl Boettiger &amp; Lincoln Mullen (2018) <a href="https://www.tandfonline.com/doi/abs/10.1080/00031305.2017.1375986?journalCode=utas20"><em>Packaging Data Analytical Work Reproducibly Using R (and Friends)</em></a>, The American Statistician, 72:1, 80-88, DOI: &lt;10.1080/00031305.2017.1375986&gt;</p></li>
</ol>
<p><img src="assets/marw_f3.jpeg" width="300px"></p>
<p><em>Example use of the R package structure for a research compendium</em> (source Marwick <em>et al</em>, 2018)</p>
<p><br></p>
</div>
<div id="enter-rrtools" class="section level2">
<h2>Enter <code>rrtools</code></h2>
<blockquote>
<p>The goal of rrtools is to provide <strong>instructions, templates, and functions</strong> for making a <strong>basic compendium</strong> suitable for writing <strong>reproducible research with R</strong>.</p>
</blockquote>
<p><strong><code>rrtools</code> build on tools &amp; conventions for R package development to</strong></p>
<ul>
<li>organise files</li>
<li>manage dependencies</li>
<li>share code</li>
<li>document code</li>
<li>check and test code</li>
</ul>
<p><strong><code>rrtools</code> extends and works with a number of R packages:</strong></p>
<ul>
<li><p><a href="https://cran.r-project.org/package=devtools"><code>devtools</code></a>: functions for package development</p></li>
<li><p><a href="https://www.tidyverse.org/articles/2017/11/usethis-1.0.0/"><code>usethis</code></a>: automates repetitive tasks that arise during project setup and development</p></li>
<li><p><a href="https://bookdown.org/"><code>bookdown</code></a>: facilitates writing books and long-form articles/reports with R Markdown</p></li>
</ul>
<p><br></p>
<hr />
</div>
</div>
<div id="workshop-approach" class="section level1">
<h1>Workshop approach</h1>
<div id="live-coding" class="section level2">
<h2>Live coding</h2>
<p>The majority of the workshop I will be <strong>live coding</strong> 😨 so that you can follow along. You will get a lot more out of the workshop if you do.</p>
<p>However, handouts of the materials we’ll cover are available if you get stuck!</p>
</div>
</div>
<div id="workshop-materials" class="section level1">
<h1>Workshop materials</h1>
<div id="data" class="section level2">
<h2>Data</h2>
<div id="on-github-httpsgithub.comannakrystallirrtools-wkshp-materials" class="section level4">
<h4>On github: <a href="https://github.com/annakrystalli/rrtools-wkshp-materials/" class="uri">https://github.com/annakrystalli/rrtools-wkshp-materials/</a></h4>
<ul>
<li><p>click on <strong>Clone or download</strong></p></li>
<li><p>click on <strong>Download ZIP</strong></p></li>
<li><p>Unzip the file</p></li>
</ul>
</div>
</div>
<div id="handouts" class="section level2">
<h2>Handouts:</h2>
<div id="bit.lyrrtools_handouts" class="section level4">
<h4>&lt;bit.ly/rrtools_handouts&gt;</h4>
<hr />
</div>
</div>
</div>
<div id="workshop-aims-and-objectives" class="section level1">
<h1>Workshop aims and objectives</h1>
<p>In this workshop we’ll <strong>use materials associated with a published paper</strong> (text, data and code) to <strong>create a research compendium</strong> around it.</p>
<p><br></p>
<p>By the end of the workshop, you should be able to:</p>
<ul>
<li><p>Be able to <strong>Create a Research Compendium</strong> to manage and share resources associated with an academic publication.</p></li>
<li><p>Understand the basics of <strong>managing code as an R package</strong>.</p></li>
<li><p>Be able to <strong>produce a reproducible manuscript from a single rmarkdown document</strong>.</p></li>
<li><p>Appreciate the power of convention!</p></li>
</ul>
<p><br></p>
<blockquote>
<p>It’s like agreeing that we will all drive on the left or the right. A hallmark of civilization is following conventions that constrain your behavior a little, in the name of public safety.</p>
</blockquote>
<p><strong>Jenny Bryan</strong> on <a href="https://www.tidyverse.org/articles/2017/12/workflow-vs-script/">Project-oriented workflows</a></p>
<hr />
<div id="level" class="section level3">
<h3>Level</h3>
<p>Intermediate</p>
</div>
<div id="prerequisites" class="section level3">
<h3>Prerequisites:</h3>
<p>Familiarity with Version Control through RStudio and rmarkdown.</p>
</div>
<div id="system-requirements" class="section level3">
<h3>System Requirements:</h3>
<p>Pandoc (&gt;= 1.17.2) LaTeX</p>
<p>If you don’t have LaTeX installed, consider installing <code>TinyTeX</code>, a custom LaTeX distribution based on TeX Live that is small in size but functions well in most cases, especially for R users.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">install.packages</span>(<span class="st">&#39;tinytex&#39;</span>)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2">tinytex<span class="op">::</span><span class="kw">install_tinytex</span>()</a></code></pre></div>
<p>Check <a href="https://yihui.name/tinytex/">docs</a> before before installing.</p>
</div>
<div id="lets-dive-in" class="section level2">
<h2>Let’s dive in!</h2>
</div>
<div id="session-information" class="section level2">
<h2>Session information</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw">sessionInfo</span>()</a></code></pre></div>
<pre><code>R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.1

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19      rstudioapi_0.8    knitr_1.20       
 [4] whisker_0.3-2     magrittr_1.5      workflowr_1.1.1  
 [7] rlang_0.3.0.1     stringr_1.3.1     tools_3.4.4      
[10] R.oo_1.21.0       git2r_0.23.0      htmltools_0.3.6  
[13] yaml_2.2.0        rprojroot_1.3-2   digest_0.6.18    
[16] assertthat_0.2.0  crayon_1.3.4      purrr_0.2.5      
[19] R.utils_2.6.0     glue_1.3.0        evaluate_0.11    
[22] rmarkdown_1.10    emo_0.0.0.9000    stringi_1.2.4    
[25] compiler_3.4.4    backports_1.1.2   R.methodsS3_1.7.1
[28] lubridate_1.7.4  </code></pre>
</div>
</div>

<!-- Adjust MathJax settings so that all math formulae are shown using
TeX fonts only; see
http://docs.mathjax.org/en/latest/configuration.html.  This will make
the presentation more consistent at the cost of the webpage sometimes
taking slightly longer to load. Note that this only works because the
footer is added to webpages before the MathJax javascript. -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    "HTML-CSS": { availableFonts: ["TeX"] }
  });
</script>

<hr>
<p>
  This reproducible <a href="http://rmarkdown.rstudio.com">R Markdown</a>
  analysis was created with
  <a href="https://github.com/jdblischak/workflowr">workflowr</a> 1.1.1
</p>
<hr>


</div>
</div>

</div>

<script>

// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
  $('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
  bootstrapStylePandocTables();
});


</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>