Skip to content

Commit 72e0f20

Browse files
ch3 bug hunt from py issue
1 parent 7f147d0 commit 72e0f20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/wrangling.Rmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ when we need to make the data frame longer and narrower.
310310
To learn how to use `pivot_longer`, we will work through an example with the
311311
`region_lang_top5_cities_wide.csv` data set. This data set contains the
312312
counts of how many Canadians cited each language as their mother tongue for five
313-
major Canadian cities (Toronto, Montréal, Vancouver, Calgary and Edmonton) from
313+
major Canadian cities (Toronto, Montréal, Vancouver, Calgary, and Edmonton) from
314314
the 2016 Canadian census. \index{Canadian languages}
315315
To get started,
316316
we will load the `tidyverse` package and use `read_csv` to load the (untidy) data.
@@ -326,7 +326,7 @@ What is wrong with the untidy format above?
326326
The table on the left in Figure \@ref(fig:img-pivot-longer-with-table)
327327
represents the data in the "wide" (messy) format.
328328
From a data analysis perspective, this format is not ideal because the values of
329-
the variable *region* (Toronto, Montréal, Vancouver, Calgary and Edmonton)
329+
the variable *region* (Toronto, Montréal, Vancouver, Calgary, and Edmonton)
330330
are stored as column names. Thus they
331331
are not easily accessible to the data analysis functions we will apply
332332
to our data set. Additionally, the *mother tongue* variable values are
@@ -428,7 +428,7 @@ we will work through an example
428428
with the `region_lang_top5_cities_long.csv` data set.
429429
This data set contains the number of Canadians reporting
430430
the primary language at home and work for five
431-
major cities (Toronto, Montréal, Vancouver, Calgary and Edmonton).
431+
major cities (Toronto, Montréal, Vancouver, Calgary, and Edmonton).
432432

433433
``` {r 02-reading-long, warning=FALSE, message=FALSE, R.options = list(width = 90)}
434434
lang_long <- read_csv("data/region_lang_top5_cities_long.csv")
@@ -496,7 +496,7 @@ more columns, and we would see the data set "widen."
496496

497497
Data are also not considered tidy when multiple values are stored in the same \index{separate}
498498
cell. The data set we show below is even messier than the ones we dealt with
499-
above: the `Toronto`, `Montréal`, `Vancouver`, `Calgary` and `Edmonton` columns
499+
above: the `Toronto`, `Montréal`, `Vancouver`, `Calgary`, and `Edmonton` columns
500500
contain the number of Canadians reporting their primary language at home and
501501
work in one column separated by the delimiter (`/`). The column names are the \index{delimiter}
502502
values of a variable, *and* each value does not have its own cell! To turn this

0 commit comments

Comments
 (0)