You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
50
+
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.
54
51
55
-
```{r, echo=F, purl=F, warning=F}
52
+
### Your goal
53
+
Your desired figure looks something like the following:
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):
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.
75
+
The second figure is quite different from the one you want. 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 first figure above, only to use `reprex()` to illustrate your question and problematic code.
1. Download the [<iclass="fa fa-file-code-o fa-1x"aria-hidden="true"></i> starter R script (if desired)](`r output_nocomment`){target="_blank"}. Save this directly to your course folder (repository) so you don't lose track of it!
83
+
2. Add code needed to produce the second plot (loading required libraries above and loading the `world` data)
84
+
2. Copy the code to your clipboard
85
+
3. run `reprex()` to generate the reproducible example in the "Viewer Pane"
86
+
4. Export the preview as an html file and save it in your course repository. It should look something like this (note the image is intentionally blurred):
87
+

88
+
89
+
</div>
90
+
</div>
76
91
77
-
If you have extra time, try to fix the code above to make the first figure.
Copy file name to clipboardExpand all lines: CS_07.md
+29-8Lines changed: 29 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ date: 2018-10-10
4
4
subtitle: Learning more about finding help
5
5
reading:
6
6
- How to [write a reproducible example](http://adv-r.had.co.nz/Reproducibility.html)
7
+
- Using [Reprex package](https://reprex.tidyverse.org/)
7
8
presentation:
8
9
- day_12_help.html
9
10
tasks:
@@ -41,11 +42,6 @@ tasks:
41
42
- Debug existing code
42
43
- Save your reprex to your course repository as an html file using Export -> "Save As Webpage" in the RStudio "Viewer" Tab.
43
44
44
-
## Download
45
-
46
-
|[<iclass='fas fa-code fa-2x'aria-hidden='true'></i><br> R Script](scripts/CS_07_nocomments.R)|[<iclass='fa fa-file-code-o fa-2x'></i> <br> Commented R Script](scripts/CS_07.R)|[<iclass='far fa-file-alt fa-2x'></i> <br> Rmd Script](scripts/CS_07.Rmd)|
47
-
|:--:|:-:|:-:|
48
-
49
45
## Libraries
50
46
51
47
@@ -60,10 +56,13 @@ data(world)
60
56
61
57
## Your problem
62
58
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:
59
+
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.
64
60
61
+
### Your goal
62
+
Your desired figure looks something like the following:
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):
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.
76
+
The second figure is quite different from the one you want. 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 first figure above, only to use `reprex()` to illustrate your question and problematic code.
If you have extra time, try to fix the code above to make the first figure.
82
+
## Steps
83
+
1. Download the [<iclass="fa fa-file-code-o fa-1x"aria-hidden="true"></i> starter R script (if desired)](scripts/CS_07_nocomments.R){target="_blank"}. Save this directly to your course folder (repository) so you don't lose track of it!
84
+
2. Add code needed to produce the second plot (loading required libraries above and loading the `world` data)
85
+
2. Copy the code to your clipboard
86
+
3. run `reprex()` to generate the reproducible example in the "Viewer Pane"
87
+
4. Export the preview as an html file and save it in your course repository. It should look something like this (note the image is intentionally blurred):
<p>You want to make a figure illustrating the distribution of GDP per capita for all countries within each continent using the <code>world</code> data in the <code>spData</code> package. Your desired figure looks something like the following:</p>
<p>You want to make a figure illustrating the distribution of GDP per capita for all countries within each continent using the <code>world</code> data in the <code>spData</code> package.</p>
456
+
<divid="your-goal" class="section level3">
457
+
<h3>Your goal</h3>
458
+
<p>Your desired figure looks something like the following: <imgsrc="CS_07_files/figure-html/unnamed-chunk-3-1.png" /><!-- --></p>
<p>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):</p>
<p>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 <code>reprex()</code> to generate a nicely formatted example that you could email or post to a forum to ask for help. See the <ahref="https://reprex.tidyverse.org/">reading</a> for more help. Note: you do <em>not</em> need to recreate the figure above, only to use <code>reprex()</code> to illustrate your question.</p>
476
-
<p>If you have extra time, try to fix the code above to make the first figure.</p>
466
+
<p>The second figure is quite different from the one you want. 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 <code>reprex()</code> to generate a nicely formatted example that you could email or post to a forum to ask for help. See the <ahref="https://reprex.tidyverse.org/">reading</a> for more help. Note: you do <em>not</em> need to recreate the first figure above, only to use <code>reprex()</code> to illustrate your question and problematic code.</p>
<li>Download the <ahref="scripts/CS_07_nocomments.R" target="_blank"><iclass="fa fa-file-code-o fa-1x" aria-hidden="true"></i> starter R script (if desired)</a>. Save this directly to your course folder (repository) so you don’t lose track of it!</li>
475
+
<li>Add code needed to produce the second plot (loading required libraries above and loading the <code>world</code> data)</li>
476
+
<li>Copy the code to your clipboard</li>
477
+
<li>run <code>reprex()</code> to generate the reproducible example in the “Viewer Pane”</li>
478
+
<li>Export the preview as an html file and save it in your course repository. It should look something like this (note the image is intentionally blurred): <imgsrc="assets/reprex.png" /></li>
0 commit comments