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
Copy file name to clipboardExpand all lines: instructors/instructor-notes.md
+38-70Lines changed: 38 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,18 +40,13 @@ As an instructor, we encourage you to do the live coding directly in this file,
40
40
41
41
## R Version
42
42
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`.
43
+
With the release of R 4.0.0 in early 2020, an important change has been made to R: The default for `stringsAsFactors` is now `FALSE` instead of `TRUE`.
46
44
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)).
47
45
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.
46
+
This change should not cause any problems with this lesson, independent of whether R >4.0 is used or not, because it uses `read_csv()` from the **`tidyverse`** package throughout.
50
47
Other than `read.csv()` from base R, `read_csv()` never converts character columns to factors, regardless of the R version.
51
48
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.
49
+
Nevertheless, it is recommended that learners install a version of R ≥4.0.0, and instructors and helpers should be aware of this potential source of error.
55
50
56
51
## RStudio and Multiple R Installs
57
52
@@ -67,13 +62,9 @@ First, check for the appropriate R installation in the library;
67
62
ls -l /Library/Frameworks/R.framework/Versions/
68
63
```
69
64
70
-
We are currently using R 4.
71
-
0\.
72
-
x.
65
+
We are currently using R 4.0.x.
73
66
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:
67
+
If it is present, you will need to set the symbolic link to Current to point to the 4.0.x directory:
- The main goal here is to help the learners be comfortable with the RStudio
112
-
interface. We use RStudio because it helps make using R more organized and
103
+
interface.
104
+
We use RStudio because it helps make using R more organized and
113
105
user friendly.
114
-
- The "Why learning R?" section contains suggestions of what you could tell your
115
-
learners about the benefits of learning R. However, it's best if you can talk
116
-
here about what has worked for you personally.
117
-
- Go very slowly in the "Getting setup section". Make sure everyone is following
118
-
along (remind learners to use the stickies). Plan with the helpers at this
119
-
point to go around the room, and be available to help. It's important to make
120
-
sure that learners are in the correct working directory, and that they create
121
-
a `data_raw` (all lowercase) subfolder.
106
+
- The "Why learning R?" section contains suggestions of what you could tell your learners about the benefits of learning R.
107
+
However, it's best if you can talk here about what has worked for you personally.
108
+
- Go very slowly in the "Getting setup section". Make sure everyone is following along (remind learners to use the stickies).
109
+
Plan with the helpers at this point to go around the room, and be available to help.
110
+
It's important to make sure that learners are in the correct working directory, and that they create a `data_raw` (all lowercase) subfolder.
122
111
- The seeking help section is relatively long, and while it's useful to
123
-
demonstrate a couple of ways to get help from within R, you may want to mostly
124
-
point the workshop participants to this useful reference so that they can
125
-
refer to it after the workshop.
126
-
- In the "where to ask for help section?", you may want to emphasize the first
127
-
point about how workshops are a great way to create community of learners that
128
-
can help each others during and after the workshop.
112
+
demonstrate a couple of ways to get help from within R, you may want to mostly point the workshop participants to this useful reference so that they can refer to it after the workshop.
113
+
- In the "where to ask for help section?", you may want to emphasize the first point about how workshops are a great way to create community of learners that can help each others during and after the workshop.
129
114
130
115
### Intro to R
131
116
132
-
- When going over the section on assignments, make
133
-
sure to pause for at least 30 seconds when asking "What do you think is the
134
-
current content of the object weight\_lb? 126.5 or 220?". For learners with no
135
-
programming experience, this is a new and important concept.
117
+
- When going over the section on assignments, make sure to pause for at least 30 seconds when asking "What do you think is the
118
+
current content of the object weight\_lb? 126.5 or 220?".
119
+
For learners with no programming experience, this is a new and important concept.
136
120
- Given that the concept of missing data is an important feature of the R
137
121
language, it is worth spending enough time on it.
138
122
139
123
### Starting with data
140
124
141
125
The two main goals for this lessons are:
142
126
143
-
- To make sure that learners are comfortable with working with data frames, and
144
-
can use the bracket notation to select slices/columns
127
+
- To make sure that learners are comfortable with working with data frames, and can use the bracket notation to select slices/columns
145
128
- To expose learners to factors. Their behavior is not necessarily intuitive,
146
-
and so it is important that they are guided through it the first time they are
147
-
exposed to it. The content of the lesson should be enough for learners to
148
-
avoid common mistakes with them.
149
-
- If the learners are not familiar with the ecology terminology used in the data
150
-
set, it might be a good idea to briefly review it here. Especially the terms
151
-
*genus* and *plot* have caused some confusion to learners in the past.
152
-
It might help to point out that the plural of genus is *genera*, and that
153
-
`plot_id` and `plot_type` in the data set refer to the ID and type of a plot
154
-
of land that was surveyed by the researchers in the study.
129
+
and so it is important that they are guided through it the first time they are exposed to it.
130
+
The content of the lesson should be enough for learners to avoid common mistakes with them.
131
+
- If the learners are not familiar with the ecology terminology used in the data set, it might be a good idea to briefly review it here.
132
+
Especially the terms *genus* and *plot* have caused some confusion to learners in the past.
133
+
It might help to point out that the plural of genus is *genera*, and that `plot_id` and `plot_type` in the data set refer to the ID and type of a plot of land that was surveyed by the researchers in the study.
155
134
156
135
### Manipulating data
157
136
158
137
- For this lesson make sure that learners are comfortable using pipes.
159
-
- There is also sometimes some confusion on what the arguments of `group_by`
160
-
should be.
138
+
- There is also sometimes some confusion on what the arguments of `group_by` should be.
161
139
- This lesson uses the tidyr package to reshape data for plotting
162
-
- After this lesson students should be familiar with the spread() and gather()
163
-
functions available in tidyr
164
-
- While working with the example for mutate(), it is difficult to see the
165
-
"weight" columns on a zoomed in RStudio screen. Including a select()
166
-
command to select the columns "weight\_kg" and "weight\_lb" makes it easier
167
-
to view how the "weight" columns are changed.
140
+
- After this lesson students should be familiar with the spread() and gather() functions available in tidyr
141
+
- While working with the example for mutate(), it is difficult to see the "weight" columns on a zoomed in RStudio screen.
142
+
Including a select() command to select the columns "weight\_kg" and "weight\_lb" makes it easier to view how the "weight" columns are changed.
168
143
- It is crucial that learners use the function `read_csv()` from tidyverse,
169
-
not `read.csv()` from base R. Using the wrong function will cause unexpected
170
-
results further down the line, especially in the section on working with
171
-
factors.
144
+
not `read.csv()` from base R.
145
+
Using the wrong function will cause unexpected results further down the line, especially in the section on working with factors.
172
146
- Note: If students end up with 30521 rows for `surveys_complete` instead of
173
-
the expected 30463 rows at the end of the chapter, then they have likely used
174
-
`read.csv()` and not `read_csv()` to import the data.
147
+
the expected 30463 rows at the end of the chapter, then they have likely used `read.csv()` and not `read_csv()` to import the data.
175
148
- When explaining `view()`, consider mentioning that is a function of the
176
-
**`tibble`** package, and that the base function `View()` can also be used to
177
-
view a data frame.
149
+
**`tibble`** package, and that the base function `View()` can also be used to view a data frame.
178
150
179
151
### Visualizing data
180
152
181
-
- This lesson is a broad overview of ggplot2 and focuses on (1) getting familiar
182
-
with the layering system of ggplot2, (2) using the argument `group` in the
183
-
`aes()` function, (3) basic customization of the plots.
184
-
- It maybe worthwhile to mention that we can also specify colors by color HEX code ( [http://colorbrewer2.org](https://colorbrewer2.org))
153
+
- This lesson is a broad overview of ggplot2 and focuses on (1) getting familiar with the layering system of ggplot2, (2) using the argument `group` in the `aes()` function, (3) basic customization of the plots.
154
+
- It maybe worthwhile to mention that we can also specify colors by color HEX code (<http://colorbrewer2.org>)
- Ideally this lesson is best taught at the end of the workshop (as a capstone
193
-
example) to illustrate how the tools covered can integrate with each
194
-
others. Depending on the audience, and the pace of the workshop, it can be
162
+
- Ideally this lesson is best taught at the end of the workshop (as a capstone example) to illustrate how the tools covered can integrate with each
163
+
others.
164
+
Depending on the audience, and the pace of the workshop, it can be
195
165
shown as a demonstration rather than a typically lesson.
196
-
- The explanation of how dplyr's verb syntax is translated into SQL statements,
197
-
and the section on laziness are optional and don't need to be taught in detail
198
-
during a workshop. They can be useful after a workshop for learners interested
199
-
in learning more about the topics or for instructors to answer questions from
166
+
- The explanation of how dplyr's verb syntax is translated into SQL statements, and the section on laziness are optional and don't need to be taught in detail during a workshop.
167
+
They can be useful after a workshop for learners interested in learning more about the topics or for instructors to answer questions from
Copy file name to clipboardExpand all lines: learners/setup.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,13 +65,19 @@ You have to install R before you install RStudio.
65
65
66
66
If you already have R and RStudio installed, first check if your R version is up to date:
67
67
68
-
- When you open RStudio your R version will be printed in the console on the bottom left. Alternatively, you can type `sessionInfo()` into the console. If your R version is 4.0.0 or later, you don't need to update R for this lesson. If your version of R is older than that, download and install the latest version of R from the R project website [for Windows](https://cran.r-project.org/bin/windows/base/), [for MacOS](https://cran.r-project.org/bin/macosx/), or [for Linux](https://cran.r-project.org/bin/linux/)
68
+
- When you open RStudio your R version will be printed in the console on the bottom left.
69
+
Alternatively, you can type `sessionInfo()` into the console.
70
+
If your R version is 4.0.0 or later, you don't need to update R for this lesson.
71
+
If your version of R is older than that, download and install the latest version of R from the R project website [for Windows](https://cran.r-project.org/bin/windows/base/), [for MacOS](https://cran.r-project.org/bin/macosx/), or [for Linux](https://cran.r-project.org/bin/linux/)
69
72
- It is not necessary to remove old versions of R from your system, but if you wish to do so you can check [How do I uninstall R?](https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-UNinstall-R_003f)
70
-
- After installing a new version of R, you will have to reinstall all your packages with the new version. For Windows, there is a package called `installr` that can help you with upgrading your R version and migrate your package library. A similar package called `pacman` can help with updating R packages across
73
+
- After installing a new version of R, you will have to reinstall all your packages with the new version.
74
+
For Windows, there is a package called `installr` that can help you with upgrading your R version and migrate your package library.
75
+
A similar package called `pacman` can help with updating R packages across
71
76
To update RStudio to the latest version, open RStudio and click on
72
-
`Help > Check for Updates`. If a new version is available follow the
73
-
instruction on screen. By default, RStudio will also automatically notify you
74
-
of new versions every once in a while.
77
+
`Help > Check for Updates`.
78
+
If a new version is available follow the
79
+
instruction on screen.
80
+
By default, RStudio will also automatically notify you of new versions every once in a while.
75
81
76
82
::::::::::::::::::::::::::::: callout
77
83
@@ -130,4 +136,3 @@ The data files for the lesson can be downloaded manually:
130
136
131
137
-[cleaned data](../episodes/data/cleaned/surveys_complete_77_89.csv) and
132
138
-[zip file of raw data](../episodes/data/new_data.zip).
0 commit comments