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: source/wrangling.Rmd
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -101,8 +101,8 @@ example, to create the vector `region` as shown in Figure
101
101
\@ref(fig:02-vector), you would write:
102
102
103
103
```{r}
104
-
year <- c("Toronto", "Montreal", "Vancouver", "Calgary", "Ottawa")
105
-
year
104
+
region <- c("Toronto", "Montreal", "Vancouver", "Calgary", "Ottawa")
105
+
region
106
106
```
107
107
108
108
> **Note:** Technically, these objects are called "atomic vectors." In this book
@@ -198,7 +198,7 @@ tibbles as *data frames* in this book.
198
198
> **Note:** You can use the function `class` \index{class} on a data object to assess whether a data
199
199
> frame is a built-in R data frame or a tibble. If the data object is a data
200
200
> 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
202
202
> built-in R data frames to tibbles using the `tidyverse``as_tibble` function.
203
203
> For example we can check the class of the Canadian languages data set,
204
204
> `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
1260
1260
reporting the language as the primary language at home
1261
1261
for each of the regions in the data set.
1262
1262
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—with one row for each group—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—with one row for each group—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.
0 commit comments