Skip to content

Commit 1cde9ea

Browse files
committed
Run aeolus on non-episode files
1 parent 2202c39 commit 1cde9ea

File tree

3 files changed

+133
-149
lines changed

3 files changed

+133
-149
lines changed

instructors/instructor-notes.md

Lines changed: 63 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,61 @@ and may not be relevant to this redesigned version.**
1919
## Dataset
2020

2121
The data used for this lesson are in the figshare repository at:
22-
[https://doi.org/10.6084/m9.figshare.1314459](https://doi.org/10.6084/m9.figshare.1314459)
23-
24-
This lesson uses mostly `combined.csv`. The 3 other csv files: `plots.csv`,
25-
`species.csv` and `surveys.csv` are only needed for the lesson on databases.
26-
27-
`combined.csv` is downloaded directly in the episode "Starting with Data" and
28-
does not need to be downloaded before hand. It however requires that there is a
29-
decent internet connection in the room where the workshop is being taught. To
30-
facilitate the download process, the chunk of code that includes the URL where
31-
the csv file lives, and where the file should go and be named is included in the
32-
code handout (see next paragraph). Using this approach ensures that the file
33-
will be where the lesson expects it to be, and teaches good/reproducible
34-
practice of automating the download. If the learners haven't created the `data/`
35-
directory and/or are not in the correct working directory, the `download.file`
36-
command will produce an error. Therefore, it is important to use the stickies at
37-
this point.
22+
<https://doi.org/10.6084/m9.figshare.1314459>
23+
24+
This lesson uses mostly `combined.csv`.
25+
The 3 other csv files: `plots.csv`, `species.csv` and `surveys.csv` are only needed for the lesson on databases.
26+
27+
`combined.csv` is downloaded directly in the episode "Starting with Data" and does not need to be downloaded before hand.
28+
It however requires that there is a decent internet connection in the room where the workshop is being taught.
29+
To facilitate the download process, the chunk of code that includes the URL where the csv file lives, and where the file should go and be named is included in the code handout (see next paragraph).
30+
Using this approach ensures that the file will be where the lesson expects it to be, and teaches good/reproducible practice of automating the download.
31+
If the learners haven't created the `data/` directory and/or are not in the correct working directory, the `download.file` command will produce an error.
32+
Therefore, it is important to use the stickies at this point.
3833

3934
## The handout
4035

41-
The [code handout](files/code-handout.R)
42-
(a link to download it is also available on the top bar of the lesson website)
43-
is useful for Data Carpentry workshops. It includes an outline of the lesson
44-
content, the text for the challenges, the links for the files that need to be
45-
downloaded for the lesson, and pieces of code that may be difficult to type for
46-
learners with no programming experience/who are unfamiliar with R's syntax. We
47-
encourage you to distribute it to the learners at the beginning of the
48-
lesson. As an instructor, we encourage you to do the live coding directly in
49-
this file, so the participants can follow along.
36+
The [code handout](files/code-handout.R) (a link to download it is also available on the top bar of the lesson website) is useful for Data Carpentry workshops.
37+
It includes an outline of the lesson content, the text for the challenges, the links for the files that need to be downloaded for the lesson, and pieces of code that may be difficult to type for learners with no programming experience/who are unfamiliar with R's syntax.
38+
We encourage you to distribute it to the learners at the beginning of the lesson.
39+
As an instructor, we encourage you to do the live coding directly in this file, so the participants can follow along.
5040

5141
## R Version
5242

53-
With the release of R 4.0.0 in early 2020, an important change has been made
54-
to R: The default for `stringsAsFactors` is now `FALSE` instead of `TRUE`.
55-
As a result, the `read.csv()` and `data.frame()` functions do not automatically
56-
convert character columns to factors anymore (you can read more about it
57-
[in this post on the R developer blog](https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/index.html)).
43+
With the release of R 4.
44+
0\.
45+
0 in early 2020, an important change has been made to R: The default for `stringsAsFactors` is now `FALSE` instead of `TRUE`.
46+
As a result, the `read.csv()` and `data.frame()` functions do not automatically convert character columns to factors anymore (you can read more about it [in this post on the R developer blog](https://developer.r-project.org/Blog/public/2020/02/16/stringsasfactors/index.html)).
5847

59-
This change should not cause any problems with this lesson, independent of
60-
whether R >4.0 is used or not, because it uses
61-
`read_csv()` from the **`tidyverse`** package throughout. Other than
62-
`read.csv()` from base R, `read_csv()` never converts character columns to
63-
factors, regardless of the R version.
48+
This change should not cause any problems with this lesson, independent of whether R >4.
49+
0 is used or not, because it uses `read_csv()` from the **`tidyverse`** package throughout.
50+
Other than `read.csv()` from base R, `read_csv()` never converts character columns to factors, regardless of the R version.
6451

65-
Nevertheless, it is recommended that learners install a version of R ≥4.0.0,
66-
and instructors and helpers should be aware of this potential source of error.
52+
Nevertheless, it is recommended that learners install a version of R ≥4.
53+
0\.
54+
0, and instructors and helpers should be aware of this potential source of error.
6755

6856
## RStudio and Multiple R Installs
6957

70-
Some learners may have previous R installations. On Mac, if a new install
71-
is performed, the learner's system will create a symbolic link, pointing to the
72-
new install as 'Current.' Sometimes this process does not occur, and, even
73-
though a new R is installed and can be accessed via the R console, RStudio does
74-
not find it. The net result of this is that the learner's RStudio will be
75-
running an older R install. This will cause package installations to fail. This
76-
can be fixed at the terminal. First, check for the appropriate R installation in
77-
the library;
58+
Some learners may have previous R installations.
59+
On Mac, if a new install is performed, the learner's system will create a symbolic link, pointing to the new install as 'Current.
60+
' Sometimes this process does not occur, and, even though a new R is installed and can be accessed via the R console, RStudio does not find it.
61+
The net result of this is that the learner's RStudio will be running an older R install.
62+
This will cause package installations to fail.
63+
This can be fixed at the terminal.
64+
First, check for the appropriate R installation in the library;
7865

7966
```
8067
ls -l /Library/Frameworks/R.framework/Versions/
8168
```
8269

83-
We are currently using R 4.0.x. If it isn't there, they will need to install it.
84-
If it is present, you will need to set the symbolic link to Current to point to
85-
the 4.0.x directory:
70+
We are currently using R 4.
71+
0\.
72+
x.
73+
If it isn't there, they will need to install it.
74+
If it is present, you will need to set the symbolic link to Current to point to the 4.
75+
0\.
76+
x directory:
8677

8778
```
8879
ln -s /Library/Frameworks/R.framework/Versions/3.6.x /Library/Frameworks/R.framework/Version/Current
@@ -92,26 +83,22 @@ Then restart RStudio.
9283

9384
## Issues with Fonts on MacOS
9485

95-
On older versions of MacOS, it may happen that axis labels do not show up when calling `plot()`
96-
(section "renaming factors" in "Starting with Data"). This issue might be due to the default font
97-
Arial being deactivated, so that R cannot find it. To resolve this issue, go to Finder,
98-
Search for Font Book and open it. Look for the Arial font and, if it is greyed out, turn it on.
86+
On older versions of MacOS, it may happen that axis labels do not show up when calling `plot()` (section "renaming factors" in "Starting with Data").
87+
This issue might be due to the default font Arial being deactivated, so that R cannot find it.
88+
To resolve this issue, go to Finder, Search for Font Book and open it.
89+
Look for the Arial font and, if it is greyed out, turn it on.
9990

100-
If the problem occurs with `ggplot2` plots, an alternative workaround is to change the default
101-
theme for the R session, so that ggplot uses a *serif* font. Since Arial is a *sans-serif*
102-
font, R will try to load a different font. This can be done with
103-
`theme_update(text = element_text(family = "serif"))`.
91+
If the problem occurs with `ggplot2` plots, an alternative workaround is to change the default theme for the R session, so that ggplot uses a *serif* font.
92+
Since Arial is a *sans-serif* font, R will try to load a different font.
93+
This can be done with `theme_update(text = element_text(family = "serif"))`.
10494

10595
## Required packages
10696

107-
Save yourself some aggrevation, and have everyone check and see if they can
108-
install all these packages before you start the first day.
109-
See the "Install required R packages" section on the homepage of the course
110-
website for package installation instructions.
97+
Save yourself some aggrevation, and have everyone check and see if they can install all these packages before you start the first day.
98+
See the "Install required R packages" section on the homepage of the course website for package installation instructions.
11199

112100
Sometimes learners are unable to install the **`tidyverse`** package.
113-
In that case, they can try to install the individual packages that are actually
114-
needed:
101+
In that case, they can try to install the individual packages that are actually needed:
115102

116103
```
117104
install.packages(c("readr", "lubridate", "dplyr", "tidyr", "ggplot2", "dbplyr"))
@@ -194,7 +181,7 @@ The two main goals for this lessons are:
194181
- This lesson is a broad overview of ggplot2 and focuses on (1) getting familiar
195182
with the layering system of ggplot2, (2) using the argument `group` in the
196183
`aes()` function, (3) basic customization of the plots.
197-
- It maybe worthwhile to mention that we can also specify colors by color HEX code ([http://colorbrewer2.org](https://colorbrewer2.org))
184+
- It maybe worthwhile to mention that we can also specify colors by color HEX code ( [http://colorbrewer2.org](https://colorbrewer2.org))
198185
```
199186
ggplot(data = surveys_complete, mapping = aes(x = weight, y = hindfoot_length)) +
200187
geom_point(alpha = 0.1, color = "#FF0000")
@@ -214,44 +201,33 @@ The two main goals for this lessons are:
214201

215202
## Potential issues \& solutions
216203

217-
As it stands, the solutions to all the challenges are commented out in the Rmd
218-
files. If you want to double check your answer, you can look at the source code
219-
of the Rmd files on GitHub.
204+
As it stands, the solutions to all the challenges are commented out in the Rmd files.
205+
If you want to double check your answer, you can look at the source code of the Rmd files on GitHub.
220206

221207
## Technical Tips and Tricks
222208

223-
Show how to use the 'zoom' button to blow up graphs without constantly resizing
224-
windows
209+
Show how to use the 'zoom' button to blow up graphs without constantly resizing windows
225210

226211
Sometimes a package will not install, try a different CRAN mirror
227212

228213
- Tools > Global Options > Packages > CRAN Mirror
229214

230-
Alternatively you can go to CRAN and download the package and install from ZIP
231-
file
215+
Alternatively you can go to CRAN and download the package and install from ZIP file
232216

233217
- Tools > Install Packages > set to 'from Zip/TAR'
234218

235-
It is important that R, and the R packages be installed locally, not on a
236-
network drive. If a learner is using a machine with multiple users where their
237-
account is not based locally this can create a variety of issues (This often
238-
happens on university computers). Hopefully the learner will realize these
239-
issues before hand, but depending on the machine and how the IT folks that
240-
service the computer have things set up, it may be very difficult to impossible
241-
to make R work without their help.
219+
It is important that R, and the R packages be installed locally, not on a network drive.
220+
If a learner is using a machine with multiple users where their account is not based locally this can create a variety of issues (This often happens on university computers).
221+
Hopefully the learner will realize these issues before hand, but depending on the machine and how the IT folks that service the computer have things set up, it may be very difficult to impossible to make R work without their help.
242222

243-
If learners are having issues with one package, they may have issues with
244-
another. It is often easier to [make sure they have all the necessary packages installed](#required-packages)
245-
at one time, rather then deal with these issues over and over.
223+
If learners are having issues with one package, they may have issues with another.
224+
It is often easier to [make sure they have all the necessary packages installed](#required-packages) at one time, rather then deal with these issues over and over.
246225

247-
In lesson 2 starting with data, one might not have the appropriate folder "data\_raw" in their working directory causing an error. This is a good time to go over reading an error, and a brief introduction of how to identify your working directory `getwd()` as well as setting your working directory `setwd("/somedirectory")` and if needed creating a directory within your script `dir.create("/some_new_directory")`, or simply creating it within a file explorer works if short on time.
226+
In lesson 2 starting with data, one might not have the appropriate folder "data\_raw" in their working directory causing an error.
227+
This is a good time to go over reading an error, and a brief introduction of how to identify your working directory `getwd()` as well as setting your working directory `setwd("/somedirectory")` and if needed creating a directory within your script `dir.create("/some_new_directory")`, or simply creating it within a file explorer works if short on time.
248228

249229
## Other Resources
250230

251-
If you encounter a problem during a workshop, feel free to contact the
252-
maintainers by email or
253-
[open an issue](https://github.com/fishtree-attempt/R-ecology-lesson/issues/new).
231+
If you encounter a problem during a workshop, feel free to contact the maintainers by email or [open an issue](https://github.com/fishtree-attempt/R-ecology-lesson/issues/new).
254232

255-
For a more in-depth coverage of topics of the workshops, you may want to read
256-
"[R for Data Science](https://r4ds.had.co.nz/)" by Hadley Wickham and Garrett
257-
Grolemund.
233+
For a more in-depth coverage of topics of the workshops, you may want to read " [R for Data Science](https://r4ds.had.co.nz/)" by Hadley Wickham and Garrett Grolemund.

learners/extra-challenges.Rmd

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ teaching: 45
44
exercises: 3
55
---
66

7-
87
```{r setup, include=FALSE}
98
knitr::opts_chunk$set(dpi = 200, out.height = 600, out.width = 600, R.options = list(max.print = 100))
109
```
@@ -14,22 +13,24 @@ library(tidyverse)
1413
surveys <- read_csv("data/cleaned/surveys_complete_77_89.csv")
1514
```
1615

17-
::::::::::::::::::::::::::::::::::::: challenge
16+
::::::::::::::::::::::::::::::::::::: challenge
1817

1918
## Challenge: `ggplot2` syntax
2019

21-
There are some issues with these `ggplot2` examples. Can you figure out what is wrong with each one?
20+
There are some issues with these `ggplot2` examples.
21+
Can you figure out what is wrong with each one?
2222

2323
```{r, eval=FALSE}
2424
ggplot(data = surveys,
2525
mapping = aes(x = weight, y = hindfoot_length, color = "blue")) +
2626
geom_point()
2727
```
2828

29+
:::::::::::::::::::::::: solution
2930

30-
:::::::::::::::::::::::: solution
31-
32-
Our points don't actually turn out blue, because we defined the color inside of `aes()`. `aes()` is used for translating variables from the data into plot elements, like color. There is no variable in the data called "blue".
31+
Our points don't actually turn out blue, because we defined the color inside of `aes()`.
32+
`aes()` is used for translating variables from the data into plot elements, like color.
33+
There is no variable in the data called "blue".
3334

3435
::::::::::::::::::::::::
3536

@@ -39,7 +40,7 @@ ggplot(data = surveys,
3940
geom_point()
4041
```
4142

42-
:::::::::::::::::::::::: solution
43+
:::::::::::::::::::::::: solution
4344

4445
Variable names inside `aes()` should not be wrapped in quotes.
4546

@@ -51,7 +52,7 @@ ggplot(data = surveys,
5152
+ geom_point()
5253
```
5354

54-
:::::::::::::::::::::::: solution
55+
:::::::::::::::::::::::: solution
5556

5657
When adding things like `geom_` or `scale_` functions to a `ggplot()`, you have to end a line with `+`, not begin a line with it.
5758

@@ -62,7 +63,7 @@ ggplot(data = surveys, x = weight, y = hindfoot_length) +
6263
geom_point()
6364
```
6465

65-
:::::::::::::::::::::::: solution
66+
:::::::::::::::::::::::: solution
6667

6768
When translating variables from the data, like `weight` and `hindfoot_length`, to elements of the plot, like `x` and `y`, you must put them inside `aes()`.
6869

@@ -75,9 +76,10 @@ ggplot(data = surveys,
7576
scale_color_continuous(type = "viridis")
7677
```
7778

78-
:::::::::::::::::::::::: solution
79+
:::::::::::::::::::::::: solution
7980

80-
`species_id` is a categorical variable, but `scale_color_continuous()` supplies a continuous color scale. `scale_color_discrete()` would give a discrete/categorical scale.
81+
`species_id` is a categorical variable, but `scale_color_continuous()` supplies a continuous color scale.
82+
`scale_color_discrete()` would give a discrete/categorical scale.
8183

8284
::::::::::::::::::::::::
8385
::::::::::::::::::::::::::::::::::::::::::::::::

0 commit comments

Comments
 (0)