Skip to content

Commit 03e8e69

Browse files
wrangling bugfixes
1 parent 54e6688 commit 03e8e69

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
@@ -101,8 +101,8 @@ example, to create the vector `region` as shown in Figure
101101
\@ref(fig:02-vector), you would write:
102102

103103
``` {r}
104-
year <- c("Toronto", "Montreal", "Vancouver", "Calgary", "Ottawa")
105-
year
104+
region <- c("Toronto", "Montreal", "Vancouver", "Calgary", "Ottawa")
105+
region
106106
```
107107

108108
> **Note:** Technically, these objects are called "atomic vectors." In this book
@@ -198,7 +198,7 @@ tibbles as *data frames* in this book.
198198
> **Note:** You can use the function `class` \index{class} on a data object to assess whether a data
199199
> frame is a built-in R data frame or a tibble. If the data object is a data
200200
> frame, `class` will return `"data.frame"`. If the data object is a
201-
> tibble it will return `"tbl_df" "tbl" "data.frame"`. You can easily convert
201+
> tibble it will return `"tbl_df" "tbl" "data.frame"`. You can easily convert
202202
> built-in R data frames to tibbles using the `tidyverse` `as_tibble` function.
203203
> For example we can check the class of the Canadian languages data set,
204204
> `can_lang`, we worked with in the previous chapters and we see it is a tibble.
@@ -1260,7 +1260,7 @@ For example, we can use `group_by` to group the regions of the `region_lang` dat
12601260
reporting the language as the primary language at home
12611261
for each of the regions in the data set.
12621262

1263-
(ref:summarize-groupby) `summarize` and `group_by` is useful for calculating summary statistics on one or more column(s) for each group. It creates a new data frame&mdash;with one row for each group&mdash;containing the summary statistic(s) for each column being summarized. It also creates a column listing the value of the grouping variable. The darker, top row of each table represents the column headers. The gray, blue, and green colored rows correspond to the rows that belong to each of the three groups being represented in this cartoon example.
1263+
(ref:summarize-groupby) `summarize` and `group_by` is useful for calculating summary statistics on one or more column(s) for each group. It creates a new data frame&mdash;with one row for each group&mdash;containing the summary statistic(s) for each column being summarized. It also creates a column listing the value of the grouping variable. The darker, top row of each table represents the column headers. The orange, blue, and green colored rows correspond to the rows that belong to each of the three groups being represented in this cartoon example.
12641264

12651265
```{r summarize-groupby, echo = FALSE, message = FALSE, warning = FALSE, fig.align = "center", fig.cap = "(ref:summarize-groupby)", fig.retina = 2, out.width = "85%"}
12661266
image_read("img/wrangling/summarize.002.png")

0 commit comments

Comments
 (0)