Skip to content

Commit

Permalink
Add setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
pfh committed May 11, 2024
1 parent 5eba6fc commit 5953b29
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 6 deletions.
63 changes: 58 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.551">
<meta name="generator" content="quarto-1.4.554">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">

Expand Down Expand Up @@ -5579,6 +5579,10 @@ <h2 id="toc-title">Table of contents</h2>

<ul>
<li><a href="#workshop-material" id="toc-workshop-material" class="nav-link active" data-scroll-target="#workshop-material">Workshop material</a></li>
<li><a href="#setup" id="toc-setup" class="nav-link" data-scroll-target="#setup">Setup</a>
<ul class="collapse">
<li><a href="#optional-further-software" id="toc-optional-further-software" class="nav-link" data-scroll-target="#optional-further-software">Optional further software</a></li>
</ul></li>
<li><a href="#bits-and-pieces" id="toc-bits-and-pieces" class="nav-link" data-scroll-target="#bits-and-pieces">Bits and pieces</a>
<ul class="collapse">
<li><a href="#quarto.yml-file-required-for-this-workshop" id="toc-quarto.yml-file-required-for-this-workshop" class="nav-link" data-scroll-target="#quarto.yml-file-required-for-this-workshop">_quarto.yml file required for this workshop</a></li>
Expand Down Expand Up @@ -5626,6 +5630,55 @@ <h2 class="anchored" data-anchor-id="workshop-material">Workshop material</h2>
</ul>
<p><br> <br> <br></p>
</section>
<section id="setup" class="level2">
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
<p>You can use RStudio on your own laptop (preferred) or use <a href="https://posit.cloud/">Posit Cloud</a>. If using RStudio on your own laptop, follow the software installation instructions below. If using Posit Cloud, please still do steps 3 and 4 below.</p>
<p>If you have a Monash University supplied laptop, you may need to submit a service request to eSolutions to be allowed to install software. For now, use Posit Cloud.</p>
<p><strong>1. Install <a href="https://cran.r-project.org/index.html">R</a></strong></p>
<p><strong>2. Install <a href="https://posit.co/download/rstudio-desktop/">RStudio</a></strong></p>
<p><strong>3. In RStudio, run this R code to install some packages:</strong></p>
<div class="cell">
<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="fu">install.packages</span>(</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">c</span>(<span class="st">&quot;quarto&quot;</span>,<span class="st">&quot;tidyverse&quot;</span>,<span class="st">&quot;BayesFactor&quot;</span>,<span class="st">&quot;patchwork&quot;</span>,<span class="st">&quot;renv&quot;</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><strong>4. Create an account on <a href="https://github.com/">GitHub</a></strong> if you don’t already have one.</p>
<p><strong>5. Install git:</strong></p>
<p><strong>Windows</strong> users should install Git for Windows (includes Git Credential Manager*).</p>
<p><strong>Mac</strong> users should install Apple’s Xcode command line tools, which includes git. This is also worthwhile because it will let you install R packages that need compilation. Open the Terminal app, type the command below, and press return:</p>
<pre><code>xcode-select --install</code></pre>
<p>(Mac users can also the binary installer here: ​​https://git-scm.com/download/mac. It is slightly out of date but should be fine. This method will be faster.)</p>
<p>Mac users should also install Git Credential Manager*: <a href="https://github.com/git-ecosystem/git-credential-manager/releases/">download page</a>, <a href="https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/install.md">installation instructions</a>. Download and open the appropriate “.pkg” file for your machine, gcm-osx-arm64-…pkg if you have an M1 or M2 mac, gcm-osx-x64-…pkg otherwise.</p>
<ul>
<li>Git Credential Manager should let us push (upload) changes to repositories on GitHub using the https method. Otherwise we would need to set up an ssh key to push changes, which is beyond the scope of this workshop.</li>
</ul>
<div style="font-size: 75%">
<p>There is also an alternative method using tokens:</p>
<p>Log in to github.com <br>→ Settings <br>→ Developer settings <br>→ Access tokens <br>→ Fine-grained personal access tokens (beta) <br>→ Generate new token</p>
<p>Select:</p>
<ul>
<li>Repository access:
<ul>
<li>only select repositories → the repository we are working on</li>
</ul></li>
<li>Repository permissions:
<ul>
<li>commit statuses → access level: read &amp; write</li>
<li>contents → access level: read &amp; write</li>
</ul></li>
</ul>
<p>When pushing from RStudio, paste the token when prompted for a password.</p>
</div>
<p>If you run into problems installing any of these, you can use Posit Cloud for the workshop.</p>
<section id="optional-further-software" class="level3">
<h3 class="anchored" data-anchor-id="optional-further-software">Optional further software</h3>
<p>RStudio comes bundled with Quarto and LaTeX, but you can install them separately if you want to use them from the command line. LaTeX is used to create PDFs. We won’t use this in the workshop.</p>
<ul>
<li><a href="https://quarto.org/docs/get-started/">Install Quarto</a></li>
<li><a href="https://quarto.org/docs/output-formats/pdf-engine.html">Install the TinyTeX version of LaTeX using Quarto</a></li>
</ul>
<p><br> <br> <br></p>
</section>
</section>
<section id="bits-and-pieces" class="level2">
<h2 class="anchored" data-anchor-id="bits-and-pieces">Bits and pieces</h2>
<p><a href="https://quarto.org/docs/reference/">Quarto reference</a></p>
Expand Down Expand Up @@ -5672,7 +5725,7 @@ <h3 class="anchored" data-anchor-id="quarto.yml-suggested-further-settings">_qua
<h3 class="anchored" data-anchor-id="nice-looking-tables">Nice looking tables</h3>
<p>The default appearance of tables produced by code chunks is a bit plain. Try these instead, and look at their documentation for how to customize the output further.</p>
<div class="cell">
<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>knitr<span class="sc">::</span><span class="fu">kable</span>(mtcars)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>knitr<span class="sc">::</span><span class="fu">kable</span>(mtcars)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<table class="table table-sm table-striped small">
<colgroup>
Expand Down Expand Up @@ -6157,10 +6210,10 @@ <h3 class="anchored" data-anchor-id="nice-looking-tables">Nice looking tables</h
</tbody>
</table>
</div>
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>DT<span class="sc">::</span><span class="fu">datatable</span>(mtcars)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>DT<span class="sc">::</span><span class="fu">datatable</span>(mtcars)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output-display">
<div class="datatables html-widget html-fill-item" id="htmlwidget-bb8885db4e7558905b61" style="width:100%;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-bb8885db4e7558905b61">{"x":{"filter":"none","vertical":false,"data":[["Mazda RX4","Mazda RX4 Wag","Datsun 710","Hornet 4 Drive","Hornet Sportabout","Valiant","Duster 360","Merc 240D","Merc 230","Merc 280","Merc 280C","Merc 450SE","Merc 450SL","Merc 450SLC","Cadillac Fleetwood","Lincoln Continental","Chrysler Imperial","Fiat 128","Honda Civic","Toyota Corolla","Toyota Corona","Dodge Challenger","AMC Javelin","Camaro Z28","Pontiac Firebird","Fiat X1-9","Porsche 914-2","Lotus Europa","Ford Pantera L","Ferrari Dino","Maserati Bora","Volvo 142E"],[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],[6,6,4,6,8,6,8,4,4,6,6,8,8,8,8,8,8,4,4,4,4,8,8,8,8,4,4,4,8,6,8,4],[160,160,108,258,360,225,360,146.7,140.8,167.6,167.6,275.8,275.8,275.8,472,460,440,78.7,75.7,71.09999999999999,120.1,318,304,350,400,79,120.3,95.09999999999999,351,145,301,121],[110,110,93,110,175,105,245,62,95,123,123,180,180,180,205,215,230,66,52,65,97,150,150,245,175,66,91,113,264,175,335,109],[3.9,3.9,3.85,3.08,3.15,2.76,3.21,3.69,3.92,3.92,3.92,3.07,3.07,3.07,2.93,3,3.23,4.08,4.93,4.22,3.7,2.76,3.15,3.73,3.08,4.08,4.43,3.77,4.22,3.62,3.54,4.11],[2.62,2.875,2.32,3.215,3.44,3.46,3.57,3.19,3.15,3.44,3.44,4.07,3.73,3.78,5.25,5.424,5.345,2.2,1.615,1.835,2.465,3.52,3.435,3.84,3.845,1.935,2.14,1.513,3.17,2.77,3.57,2.78],[16.46,17.02,18.61,19.44,17.02,20.22,15.84,20,22.9,18.3,18.9,17.4,17.6,18,17.98,17.82,17.42,19.47,18.52,19.9,20.01,16.87,17.3,15.41,17.05,18.9,16.7,16.9,14.5,15.5,14.6,18.6],[0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,0,0,0,1],[1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1],[4,4,4,3,3,3,3,4,4,4,4,3,3,3,3,3,3,4,4,4,3,3,3,3,3,4,5,5,5,5,5,4],[4,4,1,1,2,1,4,2,2,4,4,3,3,3,4,4,4,1,2,1,1,2,2,4,2,1,2,2,4,6,8,2]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>mpg<\/th>\n <th>cyl<\/th>\n <th>disp<\/th>\n <th>hp<\/th>\n <th>drat<\/th>\n <th>wt<\/th>\n <th>qsec<\/th>\n <th>vs<\/th>\n <th>am<\/th>\n <th>gear<\/th>\n <th>carb<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"columnDefs":[{"className":"dt-right","targets":[1,2,3,4,5,6,7,8,9,10,11]},{"orderable":false,"targets":0},{"name":" ","targets":0},{"name":"mpg","targets":1},{"name":"cyl","targets":2},{"name":"disp","targets":3},{"name":"hp","targets":4},{"name":"drat","targets":5},{"name":"wt","targets":6},{"name":"qsec","targets":7},{"name":"vs","targets":8},{"name":"am","targets":9},{"name":"gear","targets":10},{"name":"carb","targets":11}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
<div class="datatables html-widget html-fill-item" id="htmlwidget-6766a7fcf59c08acfafe" style="width:100%;height:auto;"></div>
<script type="application/json" data-for="htmlwidget-6766a7fcf59c08acfafe">{"x":{"filter":"none","vertical":false,"data":[["Mazda RX4","Mazda RX4 Wag","Datsun 710","Hornet 4 Drive","Hornet Sportabout","Valiant","Duster 360","Merc 240D","Merc 230","Merc 280","Merc 280C","Merc 450SE","Merc 450SL","Merc 450SLC","Cadillac Fleetwood","Lincoln Continental","Chrysler Imperial","Fiat 128","Honda Civic","Toyota Corolla","Toyota Corona","Dodge Challenger","AMC Javelin","Camaro Z28","Pontiac Firebird","Fiat X1-9","Porsche 914-2","Lotus Europa","Ford Pantera L","Ferrari Dino","Maserati Bora","Volvo 142E"],[21,21,22.8,21.4,18.7,18.1,14.3,24.4,22.8,19.2,17.8,16.4,17.3,15.2,10.4,10.4,14.7,32.4,30.4,33.9,21.5,15.5,15.2,13.3,19.2,27.3,26,30.4,15.8,19.7,15,21.4],[6,6,4,6,8,6,8,4,4,6,6,8,8,8,8,8,8,4,4,4,4,8,8,8,8,4,4,4,8,6,8,4],[160,160,108,258,360,225,360,146.7,140.8,167.6,167.6,275.8,275.8,275.8,472,460,440,78.7,75.7,71.09999999999999,120.1,318,304,350,400,79,120.3,95.09999999999999,351,145,301,121],[110,110,93,110,175,105,245,62,95,123,123,180,180,180,205,215,230,66,52,65,97,150,150,245,175,66,91,113,264,175,335,109],[3.9,3.9,3.85,3.08,3.15,2.76,3.21,3.69,3.92,3.92,3.92,3.07,3.07,3.07,2.93,3,3.23,4.08,4.93,4.22,3.7,2.76,3.15,3.73,3.08,4.08,4.43,3.77,4.22,3.62,3.54,4.11],[2.62,2.875,2.32,3.215,3.44,3.46,3.57,3.19,3.15,3.44,3.44,4.07,3.73,3.78,5.25,5.424,5.345,2.2,1.615,1.835,2.465,3.52,3.435,3.84,3.845,1.935,2.14,1.513,3.17,2.77,3.57,2.78],[16.46,17.02,18.61,19.44,17.02,20.22,15.84,20,22.9,18.3,18.9,17.4,17.6,18,17.98,17.82,17.42,19.47,18.52,19.9,20.01,16.87,17.3,15.41,17.05,18.9,16.7,16.9,14.5,15.5,14.6,18.6],[0,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,0,0,0,1],[1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1],[4,4,4,3,3,3,3,4,4,4,4,3,3,3,3,3,3,4,4,4,3,3,3,3,3,4,5,5,5,5,5,4],[4,4,1,1,2,1,4,2,2,4,4,3,3,3,4,4,4,1,2,1,1,2,2,4,2,1,2,2,4,6,8,2]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>mpg<\/th>\n <th>cyl<\/th>\n <th>disp<\/th>\n <th>hp<\/th>\n <th>drat<\/th>\n <th>wt<\/th>\n <th>qsec<\/th>\n <th>vs<\/th>\n <th>am<\/th>\n <th>gear<\/th>\n <th>carb<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"columnDefs":[{"className":"dt-right","targets":[1,2,3,4,5,6,7,8,9,10,11]},{"orderable":false,"targets":0},{"name":" ","targets":0},{"name":"mpg","targets":1},{"name":"cyl","targets":2},{"name":"disp","targets":3},{"name":"hp","targets":4},{"name":"drat","targets":5},{"name":"wt","targets":6},{"name":"qsec","targets":7},{"name":"vs","targets":8},{"name":"am","targets":9},{"name":"gear","targets":10},{"name":"carb","targets":11}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/slideshow.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="slideshow_files/libs/quarto-html/light-border.css" rel="stylesheet">
<link href="slideshow_files/libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="slideshow_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.4.551">
<meta name="generator" content="quarto-1.4.554">

<title>Reproducible Research in R with Quarto</title>
<meta name="apple-mobile-web-app-capable" content="yes">
Expand Down
72 changes: 72 additions & 0 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,78 @@ Some slides to put things in context:

* [Slides](slideshow.html){target="_blank"}

<br>
<br>
<br>

## Setup

You can use RStudio on your own laptop (preferred) or use [Posit Cloud](https://posit.cloud/). If using RStudio on your own laptop, follow the software installation instructions below. If using Posit Cloud, please still do steps 3 and 4 below.

If you have a Monash University supplied laptop, you may need to submit a service request to eSolutions to be allowed to install software. For now, use Posit Cloud.

**1. Install [R](https://cran.r-project.org/index.html)**

**2. Install [RStudio](https://posit.co/download/rstudio-desktop/)**

**3. In RStudio, run this R code to install some packages:**

```{r}
#| eval: false
install.packages(
c("quarto","tidyverse","BayesFactor","patchwork","renv"))
```

**4. Create an account on [GitHub](https://github.com/)** if you don't already have one.

**5. Install git:**

**Windows** users should install Git for Windows (includes Git Credential Manager*).

**Mac** users should install Apple's Xcode command line tools, which includes git. This is also worthwhile because it will let you install R packages that need compilation. Open the Terminal app, type the command below, and press return:

```
xcode-select --install
```

(Mac users can also the binary installer here: ​​https://git-scm.com/download/mac. It is slightly out of date but should be fine. This method will be faster.)

Mac users should also install Git Credential Manager*: [download page](https://github.com/git-ecosystem/git-credential-manager/releases/), [installation instructions](https://github.com/GitCredentialManager/git-credential-manager/blob/release/docs/install.md). Download and open the appropriate ".pkg" file for your machine, gcm-osx-arm64-...pkg if you have an M1 or M2 mac, gcm-osx-x64-...pkg otherwise.

* Git Credential Manager should let us push (upload) changes to repositories on GitHub using the https method. Otherwise we would need to set up an ssh key to push changes, which is beyond the scope of this workshop.

::: {style="font-size: 75%"}
There is also an alternative method using tokens:

Log in to github.com
<br>→ Settings
<br>→ Developer settings
<br>→ Access tokens
<br>→ Fine-grained personal access tokens (beta)
<br>→ Generate new token

Select:

* Repository access:
* only select repositories → the repository we are working on
* Repository permissions:
* commit statuses → access level: read & write
* contents → access level: read & write

When pushing from RStudio, paste the token when prompted for a password.
:::

If you run into problems installing any of these, you can use Posit Cloud for the workshop.

### Optional further software

RStudio comes bundled with Quarto and LaTeX, but you can install them separately if you want to use them from the command line. LaTeX is used to create PDFs. We won't use this in the workshop.

* [Install Quarto](https://quarto.org/docs/get-started/)
* [Install the TinyTeX version of LaTeX using Quarto](https://quarto.org/docs/output-formats/pdf-engine.html)



<br>
<br>
<br>
Expand Down

0 comments on commit 5953b29

Please sign in to comment.