Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit

Permalink
Add Show notes and cleanup structure
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddelkoop committed May 22, 2024
1 parent 1368b91 commit 15b2761
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 533 deletions.
29 changes: 29 additions & 0 deletions Notes.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "Show Notes"
output: html_document
editor_options:
chunk_output_type: console
---

# Navigate R Studio and Setup Project

* Open RStudio
* Create a new "New Project" in `~/work`
* If you use Git (you should) use "New Project" -> "Version Control" -> "Git".
* "File" -> "New Project" -> "New Directory" -> "New Project" -> "work/skc-workshop". Projects and data must be saved in `~/work` otherwise they will be lost. Use a good name such as "skc-workshop"
* Turn off saving `.RData` in workspace
* "Tools" -> "Global Options" -> "General" (already selected) -> "Basic" (already selected) -> Under "Workspace" turn off "Restore `.RData` …" and set "Save workspace to `.RData` …" to "Never"
* Create a new "R Markdown" File
* "File" -> "New File" -> "R Markdown" -> "Create Empty Document" (bottom left button).
* Save file (cmd-s for Mac, ctrl-s for Windows/Linux) and use a good name such as "R-Ecology-Workshop" (it will add the `.Rmd` extension)
* Write, Setup, and View RMarkdown
* Write title `# RStudio`
* "Settings (gear)" -> "Preview in Viewer Pane"
* "Settings (gear)" -> "Chunk Output in Console"
* Save file
* Knit (Knit to HTML)
* Optionally set "Knit on Save" - (runs entire notebook)

Resources:

* https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html
89 changes: 42 additions & 47 deletions prep/Setup.html → Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@



<title>Setup</title>
<title>Show Notes</title>

<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
Expand Down Expand Up @@ -348,58 +348,53 @@



<h1 class="title toc-ignore">Setup</h1>
<h1 class="title toc-ignore">Show Notes</h1>

</div>


<div id="setup" class="section level1">
<h1>Setup</h1>
<p>Update Tools with “Tools -&gt; Update” (do not pin) - takes a long
time - don’t do in class.</p>
<p>Use a “R Markdown” document (<code>output: html_document</code> in
prolog).</p>
<p>To have the output display in the console (not inline) set in the
config for the Rmd file set “chunk output in console”.</p>
<p>To view Rmd rendered (click Knit to html) in separate windows select
settings for the Rmd file (wheel) and select “Preview in Window”</p>
<p>Prolog should look like this:</p>
<pre><code>---
title: &quot;Setup&quot;
output: html_document
editor_options:
chunk_output_type: console
---</code></pre>
<div id="git" class="section level2">
<h2>Git</h2>
<p>Setup Git</p>
<pre class="bash"><code>git config color.ui auto
git config pull.ff only
git config push.default simple

#git config user.name &quot;First Last&quot;
#git config user.email &quot;first_last@example.edu&quot;</code></pre>
<p>Notes:</p>
<div id="navigate-r-studio-and-setup-project" class="section level1">
<h1>Navigate R Studio and Setup Project</h1>
<ul>
<li>R Notebooks seem fragile and Caching output seems dangerous. Use
“Chunk Output Inline” for a more Notebook experence or use Juypter!</li>
<li>R Markdown is a bit different (lists for example) than other
markdown.</li>
<li>With Rmd files I am a fan of using the console (chunk output in
console) and use cmd-enter to run each line (opt-enter for not advancing
cursor) for development.</li>
<li>Open RStudio</li>
<li>Create a new “New Project” in <code>~/work</code>
<ul>
<li>If you use Git (you should) use “New Project” -&gt; “Version
Control” -&gt; “Git”.</li>
<li>“File” -&gt; “New Project” -&gt; “New Directory” -&gt; “New Project”
-&gt; “work/skc-workshop”. Projects and data must be saved in
<code>~/work</code> otherwise they will be lost. Use a good name such as
“skc-workshop”</li>
</ul></li>
<li>Turn off saving <code>.RData</code> in workspace
<ul>
<li>“Tools” -&gt; “Global Options” -&gt; “General” (already selected)
-&gt; “Basic” (already selected) -&gt; Under “Workspace” turn off
“Restore <code>.RData</code> …” and set “Save workspace to
<code>.RData</code> …” to “Never”</li>
</ul></li>
<li>Create a new “R Markdown” File
<ul>
<li>“File” -&gt; “New File” -&gt; “R Markdown” -&gt; “Create Empty
Document” (bottom left button).</li>
<li>Save file (cmd-s for Mac, ctrl-s for Windows/Linux) and use a good
name such as “R-Ecology-Workshop” (it will add the <code>.Rmd</code>
extension)</li>
</ul></li>
<li>Write, Setup, and View RMarkdown
<ul>
<li>Write title <code># RStudio</code></li>
<li>“Settings (gear)” -&gt; “Preview in Viewer Pane”</li>
<li>“Settings (gear)” -&gt; “Chunk Output in Console”</li>
<li>Save file</li>
<li>Knit (Knit to HTML)</li>
<li>Optionally set “Knit on Save” - (runs entire notebook)</li>
</ul></li>
</ul>
<p>Resources:</p>
<ul>
<li><a href="https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html" class="uri">https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html</a></li>
</ul>
</div>
</div>
<div id="test" class="section level1">
<h1>Test</h1>
<p>Top/bottom</p>
<pre class="r"><code>1+2</code></pre>
<pre><code>## [1] 3</code></pre>
<pre class="r"><code>3+4</code></pre>
<pre><code>## [1] 7</code></pre>
<pre class="r"><code>print(&#39;Hello World&#39;)</code></pre>
<pre><code>## [1] &quot;Hello World&quot;</code></pre>
</div>


Expand Down
13 changes: 13 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# SKC Carpentries Workshop June 2024

## Lessons

Lessons (Day 1):
* https://datacarpentry.org/R-ecology-lesson-alternative/index.html
* https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html
* https://datacarpentry.org/R-ecology-lesson-alternative/visualizing-ggplot.html
* https://datacarpentry.org/R-ecology-lesson-alternative/how-r-thinks-about-data.html

Lessons (Day 2):
* https://datacarpentry.org/R-ecology-lesson-alternative/working-with-data.html
* https://datacarpentry.org/R-ecology-lesson/05-r-and-databases.html

4 changes: 4 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Setup shell with:
# . ./env.sh

if [ -z "$USER" ] ; then
export USER=$NB_USER
fi

export SSH_AUTH_SOCK=/run/lock/agent.$USER
if [ ! -S $SSH_AUTH_SOCK ] ; then
eval `ssh-agent -a $SSH_AUTH_SOCK` | grep -v "^Agent pid"
Expand Down
7 changes: 5 additions & 2 deletions prep/Setup.Rmd → prep/Instructor_Notes.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Setup"
title: "Instructor Notes"
output: html_document
editor_options:
chunk_output_type: console
Expand All @@ -25,6 +25,9 @@ editor_options:
---
```

Project should use a "R Project". Load by clicking on the `.RProj` file.


## Git

Setup Git
Expand All @@ -38,7 +41,7 @@ git config push.default simple
#git config user.email "first_last@example.edu"
```

Notes:
## Notes

* R Notebooks seem fragile and Caching output seems dangerous. Use "Chunk Output Inline" for a more Notebook experence or use Juypter!
* R Markdown is a bit different (lists for example) than other markdown.
Expand Down
32 changes: 12 additions & 20 deletions Overview.ipynb → prep/Notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@
"cells": [
{
"cell_type": "markdown",
"id": "898b87d6-96c4-4c9b-9713-fde12d72c176",
"id": "bad274ce-122f-4a4f-85e4-d5716a15e557",
"metadata": {},
"source": [
"# SKC JupyterLab"
"# Setup Notebook"
]
},
{
"cell_type": "markdown",
"id": "71db22fe-b816-43c2-aab9-4b36ee2d6f10",
"metadata": {},
"source": [
"## Test"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "bff3dc73-02d1-49de-a397-eb086ac17c33",
"id": "1ea83d46-645e-4dd5-a6c2-dc74967037b9",
"metadata": {},
"outputs": [
{
Expand All @@ -27,26 +35,10 @@
"print(sys.version)"
]
},
{
"cell_type": "markdown",
"id": "96eedf95-e36d-45af-84a3-ef53016628f9",
"metadata": {},
"source": [
"Lessons (Day 1):\n",
"* https://datacarpentry.org/R-ecology-lesson-alternative/index.html\n",
"* https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html\n",
"* https://datacarpentry.org/R-ecology-lesson-alternative/visualizing-ggplot.html\n",
"* https://datacarpentry.org/R-ecology-lesson-alternative/how-r-thinks-about-data.html\n",
"\n",
"Lessons (Day 2):\n",
"* https://datacarpentry.org/R-ecology-lesson-alternative/working-with-data.html\n",
"* https://datacarpentry.org/R-ecology-lesson/05-r-and-databases.html"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8d33cae3-32d9-431a-b806-0556792fb840",
"id": "b6ec5b43-6626-4d3b-b5a6-25c74a81b19b",
"metadata": {},
"outputs": [],
"source": []
Expand Down
463 changes: 0 additions & 463 deletions prep/Preparation.html

This file was deleted.

2 changes: 1 addition & 1 deletion prep/Preparation.Rmd → prep/RStudio.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Preparation"
title: "Lesson Preparation"
output: html_document
editor_options:
chunk_output_type: console
Expand Down

0 comments on commit 15b2761

Please sign in to comment.