Skip to content

Commit 27e47a8

Browse files
committed
Tweak output manually on non-episode files
1 parent 1cde9ea commit 27e47a8

File tree

3 files changed

+49
-78
lines changed

3 files changed

+49
-78
lines changed

instructors/instructor-notes.md

Lines changed: 38 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,13 @@ As an instructor, we encourage you to do the live coding directly in this file,
4040

4141
## R Version
4242

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`.
4644
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)).
4745

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.
5047
Other than `read.csv()` from base R, `read_csv()` never converts character columns to factors, regardless of the R version.
5148

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.
5550

5651
## RStudio and Multiple R Installs
5752

@@ -67,13 +62,9 @@ First, check for the appropriate R installation in the library;
6762
ls -l /Library/Frameworks/R.framework/Versions/
6863
```
6964

70-
We are currently using R 4.
71-
0\.
72-
x.
65+
We are currently using R 4.0.x.
7366
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:
7768

7869
```
7970
ln -s /Library/Frameworks/R.framework/Versions/3.6.x /Library/Frameworks/R.framework/Version/Current
@@ -109,94 +100,71 @@ install.packages(c("readr", "lubridate", "dplyr", "tidyr", "ggplot2", "dbplyr"))
109100
### Before we start
110101

111102
- 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
113105
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.
122111
- 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.
129114

130115
### Intro to R
131116

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.
136120
- Given that the concept of missing data is an important feature of the R
137121
language, it is worth spending enough time on it.
138122

139123
### Starting with data
140124

141125
The two main goals for this lessons are:
142126

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
145128
- 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.
155134

156135
### Manipulating data
157136

158137
- 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.
161139
- 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.
168143
- 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.
172146
- 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.
175148
- 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.
178150

179151
### Visualizing data
180152

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>)
185155
```
186156
ggplot(data = surveys_complete, mapping = aes(x = weight, y = hindfoot_length)) +
187157
geom_point(alpha = 0.1, color = "#FF0000")
188158
```
189159

190160
### R and SQL
191161

192-
- 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
195165
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
200168
the workshop participants.
201169

202170
## Potential issues \& solutions

learners/reference.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,3 @@ Cheat sheet of functions used in the lessons
100100
- `inner_join()` # perform an inner join between two tables
101101
- `src_sqlite()` # connect dplyr to a SQLite database file
102102
- `copy_to()` # copy a data frame as a table into a database
103-
104-

learners/setup.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@ You have to install R before you install RStudio.
6565

6666
If you already have R and RStudio installed, first check if your R version is up to date:
6767

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/)
6972
- 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
7176
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.
7581

7682
::::::::::::::::::::::::::::: callout
7783

@@ -130,4 +136,3 @@ The data files for the lesson can be downloaded manually:
130136

131137
- [cleaned data](../episodes/data/cleaned/surveys_complete_77_89.csv) and
132138
- [zip file of raw data](../episodes/data/new_data.zip).
133-

0 commit comments

Comments
 (0)