Skip to content

Commit d8f7cff

Browse files
author
Adam M. Wilson
committed
Add help CS
1 parent 405f321 commit d8f7cff

File tree

173 files changed

+8933
-1225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+8933
-1225
lines changed

07_Reproducibile.Rmd

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
---
2-
title: "Reproducible Research"
2+
title: "Reproducible Research and R Markdown"
3+
date: 2018-10-10
4+
subtitle:
5+
reading:
6+
-
7+
presentation:
8+
- day_13_repro.html
9+
tasks:
10+
- Learn how to read R help files effectively
11+
- Learn how to search for help
12+
- Learn how to create a Minimum Working Example (MWE)
313
---
414

15+
516
```{r, echo=FALSE, message=FALSE, results='hide', purl=FALSE}
17+
source("functions.R")
618
source("knitr_header.R")
719
```
820

9-
<div>
10-
<iframe src="07_assets/Reproducibile_presentation.html" width=100% height=400px></iframe>
11-
</div>
12-
<a target="_blank" href="07_assets/Reproducibile_presentation.html">Click here to open the presentation in a new tab </a>
21+
`r presframe()`
22+
23+
## Download
24+
25+
`r output_table()`
26+
1327

1428
## R Markdown
1529

@@ -20,25 +34,7 @@ Cheatsheet:
2034
<small><small><small>[https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf](https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf)</small></small></small>
2135

2236
## Overview
23-
Today we will make a copy of a template for your project, edit it, and 'push' it back up to your github account. You can check out the template code at [https://github.com/AdamWilsonLab/RDataScience_Project](https://github.com/AdamWilsonLab/RDataScience_Project) and the template website at [http://adamwilson.us/RDataScience_Project/](http://adamwilson.us/RDataScience_Project/)
24-
25-
## Install Git on your computer
26-
27-
### Windows and OSX
28-
http://git-scm.com/downloads
29-
30-
### Linux
31-
` sudo apt-get install git `
32-
or similar
33-
34-
35-
## Create an account on [GitHub](github.com)
36-
37-
1. Create a GitHub account at [https://github.com/](https://github.com/)
38-
* This will be a public account associated with your name
39-
* Choose a username wisely for future use
40-
* Don't worry about details, you can fill them in later
41-
2. To set up a connection that doesn't require you to type in your password every time, [see here](GitSSHNotes.html)
37+
Today we will make a copy of a template for your final project, edit it, and 'push' it back up to your github account. You can check out the template code at [https://github.com/AdamWilsonLab/RDataScience_Project](https://github.com/AdamWilsonLab/RDataScience_Project) and the template website at [http://adamwilson.us/RDataScience_Project/](http://adamwilson.us/RDataScience_Project/)
4238

4339
## `Fork` the repository to create a linked copy in your GitHub account.
4440

07_Reproducibile.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
---
2-
title: "Reproducible Research"
2+
title: "Reproducible Research and R Markdown"
3+
date: 2018-10-10
4+
subtitle:
5+
reading:
6+
-
7+
presentation:
8+
- day_13_repro.html
9+
tasks:
10+
- Learn how to read R help files effectively
11+
- Learn how to search for help
12+
- Learn how to create a Minimum Working Example (MWE)
313
---
414

515

616

7-
<div>
8-
<iframe src="07_assets/Reproducibile_presentation.html" width=100% height=400px></iframe>
9-
</div>
10-
<a target="_blank" href="07_assets/Reproducibile_presentation.html">Click here to open the presentation in a new tab </a>
1117

12-
## R Markdown
1318

14-
Cheatsheet:
19+
<div class='extraswell'>
20+
<button data-toggle='collapse' class='btn btn-link' data-target='#pres'>View Presentation </button> [Open presentation in a new tab](presentation/day_13_repro.html){target='_blank'}
21+
<div id='pres' class='collapse'>
22+
<div class='embed-responsive embed-responsive-16by9'>
23+
<iframe class='embed-responsive-item' src='presentation/day_13_repro.html' allowfullscreen></iframe>
24+
_Click on presentation and then use the space bar to advance to the next slide
25+
or escape key to show an overview._
26+
</div>
27+
</div>
28+
</div>
1529

16-
<a href="https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf"> <img src="07_assets/rmarkdown.png" alt="alt text" width="400"></a>
1730

18-
<small><small><small>[https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf](https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf)</small></small></small>
31+
## Download
1932

20-
## Overview
21-
Today we will make a copy of a template for your project, edit it, and 'push' it back up to your github account. You can check out the template code at [https://github.com/AdamWilsonLab/RDataScience_Project](https://github.com/AdamWilsonLab/RDataScience_Project) and the template website at [http://adamwilson.us/RDataScience_Project/](http://adamwilson.us/RDataScience_Project/)
33+
| [<i class='fas fa-code fa-2x' aria-hidden='true'></i><br> R Script]( scripts/07_Reproducibile_nocomments.R ) | [<i class='fa fa-file-code-o fa-2x'></i> <br> Commented R Script]( scripts/07_Reproducibile.R ) | [<i class='far fa-file-alt fa-2x'></i> <br> Rmd Script]( scripts/07_Reproducibile.Rmd )|
34+
|:--:|:-:|:-:|
2235

23-
## Install Git on your computer
2436

25-
### Windows and OSX
26-
http://git-scm.com/downloads
37+
## R Markdown
2738

28-
### Linux
29-
` sudo apt-get install git `
30-
or similar
39+
Cheatsheet:
3140

41+
<a href="https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf"> <img src="07_assets/rmarkdown.png" alt="alt text" width="400"></a>
3242

33-
## Create an account on [GitHub](github.com)
43+
<small><small><small>[https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf](https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf)</small></small></small>
3444

35-
1. Create a GitHub account at [https://github.com/](https://github.com/)
36-
* This will be a public account associated with your name
37-
* Choose a username wisely for future use
38-
* Don't worry about details, you can fill them in later
39-
2. To set up a connection that doesn't require you to type in your password every time, [see here](GitSSHNotes.html)
45+
## Overview
46+
Today we will make a copy of a template for your final project, edit it, and 'push' it back up to your github account. You can check out the template code at [https://github.com/AdamWilsonLab/RDataScience_Project](https://github.com/AdamWilsonLab/RDataScience_Project) and the template website at [http://adamwilson.us/RDataScience_Project/](http://adamwilson.us/RDataScience_Project/)
4047

4148
## `Fork` the repository to create a linked copy in your GitHub account.
4249

07_assets/Reproducibile_presentation.html

Lines changed: 0 additions & 354 deletions
This file was deleted.

CS_07.Rmd

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "Getting Help!"
3+
date: 2018-10-10
4+
subtitle: Learning more about finding help
5+
reading:
6+
- How to [write a reproducible example](http://adv-r.had.co.nz/Reproducibility.html)
7+
presentation:
8+
- day_12_help.html
9+
tasks:
10+
- Learn how to read R help files effectively
11+
- Learn how to search for help
12+
- Learn how to create a Minimum Working Example (MWE)
13+
- Debug existing code
14+
- Save your reprex to your course repository as an html file using Export -> "Save As Webpage" in the RStudio "Viewer" Tab.
15+
---
16+
17+
```{r, echo=FALSE, message=FALSE, results='hide', purl=FALSE}
18+
source("functions.R")
19+
source("knitr_header.R")
20+
```
21+
22+
`r presframe()`
23+
24+
# Reading
25+
26+
```{r reading,results='asis',echo=F,purl=F}
27+
md_bullet(rmarkdown::metadata$reading)
28+
```
29+
30+
# Tasks
31+
32+
```{r tasks,results='asis',echo=F,purl=F}
33+
md_bullet(rmarkdown::metadata$tasks)
34+
```
35+
36+
## Download
37+
38+
`r output_table()`
39+
40+
## Libraries
41+
42+
```{r message=F,warning=FALSE}
43+
library(tidyverse)
44+
library(reprex)
45+
library(sf)
46+
47+
library(spData)
48+
data(world)
49+
```
50+
51+
## Your problem
52+
53+
You want to make a figure illustrating the distribution of GDP per capita for all countries within each continent using the `world` data in the `spData` package. Your desired figure looks something like the following:
54+
55+
```{r, echo=F, purl=F, warning=F}
56+
library(spData)
57+
library(ggplot2)
58+
data(world)
59+
60+
ggplot(world,aes(x=gdpPercap, fill=continent))+
61+
geom_density(alpha=0.5,color=F)+
62+
labs(x="GDP Per Capita",y="Density")+
63+
theme(legend.position = "bottom")
64+
```
65+
66+
You have started working on the figure but can't seem to make it work like you want. Here is your current version of the code (and the resulting figure):
67+
68+
```{r, warning=F}
69+
ggplot(world,aes(x=gdpPercap, y=continent, color=continent))+
70+
geom_density(alpha=0.5,color=F)
71+
```
72+
73+
You want to ask for help and so you know that you need to make a reproducible example. Starting with the code above, make the required edits so you can use `reprex()` to generate a nicely formatted example that you could email or post to a forum to ask for help. See the [reading](https://reprex.tidyverse.org/) for more help. Note: you do _not_ need to recreate the figure above, only to use `reprex()` to illustrate your question.
74+
75+
If you have extra time, try to fix the code above to make the first figure.
76+

CS_07.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "Getting Help!"
3+
date: 2018-10-10
4+
subtitle: Learning more about finding help
5+
reading:
6+
- How to [write a reproducible example](http://adv-r.had.co.nz/Reproducibility.html)
7+
presentation:
8+
- day_12_help.html
9+
tasks:
10+
- Learn how to read R help files effectively
11+
- Learn how to search for help
12+
- Learn how to create a Minimum Working Example (MWE)
13+
- Debug existing code
14+
- Save your reprex to your course repository as an html file using Export -> "Save As Webpage" in the RStudio "Viewer" Tab.
15+
---
16+
17+
18+
19+
20+
<div class='extraswell'>
21+
<button data-toggle='collapse' class='btn btn-link' data-target='#pres'>View Presentation </button> [Open presentation in a new tab](presentation/day_12_help.html){target='_blank'}
22+
<div id='pres' class='collapse'>
23+
<div class='embed-responsive embed-responsive-16by9'>
24+
<iframe class='embed-responsive-item' src='presentation/day_12_help.html' allowfullscreen></iframe>
25+
_Click on presentation and then use the space bar to advance to the next slide
26+
or escape key to show an overview._
27+
</div>
28+
</div>
29+
</div>
30+
31+
32+
# Reading
33+
34+
- How to [write a reproducible example](http://adv-r.had.co.nz/Reproducibility.html)
35+
36+
# Tasks
37+
38+
- Learn how to read R help files effectively
39+
- Learn how to search for help
40+
- Learn how to create a Minimum Working Example (MWE)
41+
- Debug existing code
42+
- Save your reprex to your course repository as an html file using Export -> "Save As Webpage" in the RStudio "Viewer" Tab.
43+
44+
## Download
45+
46+
| [<i class='fas fa-code fa-2x' aria-hidden='true'></i><br> R Script]( scripts/CS_07_nocomments.R ) | [<i class='fa fa-file-code-o fa-2x'></i> <br> Commented R Script]( scripts/CS_07.R ) | [<i class='far fa-file-alt fa-2x'></i> <br> Rmd Script]( scripts/CS_07.Rmd )|
47+
|:--:|:-:|:-:|
48+
49+
## Libraries
50+
51+
52+
```r
53+
library(tidyverse)
54+
library(reprex)
55+
library(sf)
56+
57+
library(spData)
58+
data(world)
59+
```
60+
61+
## Your problem
62+
63+
You want to make a figure illustrating the distribution of GDP per capita for all countries within each continent using the `world` data in the `spData` package. Your desired figure looks something like the following:
64+
65+
![](CS_07_files/figure-html/unnamed-chunk-3-1.png)<!-- -->
66+
67+
You have started working on the figure but can't seem to make it work like you want. Here is your current version of the code (and the resulting figure):
68+
69+
70+
```r
71+
ggplot(world,aes(x=gdpPercap, y=continent, color=continent))+
72+
geom_density(alpha=0.5,color=F)
73+
```
74+
75+
![](CS_07_files/figure-html/unnamed-chunk-4-1.png)<!-- -->
76+
77+
You want to ask for help and so you know that you need to make a reproducible example. Starting with the code above, make the required edits so you can use `reprex()` to generate a nicely formatted example that you could email or post to a forum to ask for help. See the [reading](https://reprex.tidyverse.org/) for more help. Note: you do _not_ need to recreate the figure above, only to use `reprex()` to illustrate your question.
78+
79+
If you have extra time, try to fix the code above to make the first figure.
80+
174 KB
Loading
165 KB
Loading

Calendar.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Course content is designed to be flexible to accommodate student interest and ab
99
In the table below, R4DS refers to [_R for Data Science_ by Garrett Grolemund and Hadley Wickham](http://r4ds.had.co.nz) and, while GCR refers to [_Geocomputation with R_ by Robin Lovelace, Jakub Nowosad, and Jannes Muenchow (CRC Press, 2018)](https://geocompr.robinlovelace.net/).
1010

1111

12-
```{r, echo=FALSE, message=FALSE, purl=FALSE}
12+
```{r, echo=FALSE, message=FALSE, purl=FALSE, eval=F}
1313
source("functions.R")
1414
library(fullcalendar)
1515
library(lubridate)

Calendar.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ Course content is designed to be flexible to accommodate student interest and ab
99
In the table below, R4DS refers to [_R for Data Science_ by Garrett Grolemund and Hadley Wickham](http://r4ds.had.co.nz) and, while GCR refers to [_Geocomputation with R_ by Robin Lovelace, Jakub Nowosad, and Jannes Muenchow (CRC Press, 2018)](https://geocompr.robinlovelace.net/).
1010

1111

12-
<!--html_preserve--><div id="htmlwidget-686092dc917a388ea16d" style="width:672px;height:480px;" class="fullcalendar html-widget"></div>
13-
<script type="application/json" data-for="htmlwidget-686092dc917a388ea16d">{"x":{"firstDay":1,"height":500,"aspectRatio":1.75,"header":{"right":"week,month,listMonth"},"footer":{"right":"today prev,next, title"},"titleFormat":" MM-YYYY","events":[{"date":"2018-08-30","title":"CS_01","type":"CS","url":"./CS_01.html","color":"red"},{"date":"2018-09-06","title":"CS_02","type":"CS","url":"./CS_02.html","color":"red"},{"date":"2018-09-13","title":"CS_03","type":"CS","url":"./CS_03.html","color":"red"},{"date":"2018-09-20","title":"CS_04","type":"CS","url":"./CS_04.html","color":"red"},{"date":"2018-09-25","title":"CS_05","type":"CS","url":"./CS_05.html","color":"red"},{"date":"2018-10-04","title":"CS_06","type":"CS","url":"./CS_06.html","color":"red"},{"date":"2018-09-06","title":"TK_01","type":"TK","url":"./TK_01.html","color":"green"},{"date":"2018-09-11","title":"TK_02","type":"TK","url":"./TK_02.html","color":"green"}]},"evals":[],"jsHooks":[]}</script><!--/html_preserve-->
12+

TODO.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ Weekly courses due before topic in class
4646
* [Exploratory Data Analysis in R: Case Study](https://www.datacamp.com/courses/exploratory-data-analysis-in-r-case-study)
4747
* [Spatial Analysis in R with sf and raster](https://www.datacamp.com/courses/spatial-analysis-in-r-with-sf-and-raster)
4848

49+
## New Module: troubleshooting code
50+
* reading helpfiles
51+
* break down your code
52+
* reading error messages
53+
4954
## Git Classroom
5055
* setup git account
5156
* use github classroom

0 commit comments

Comments
 (0)