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
@@ -583,7 +583,7 @@ currently making it difficult to read the different language names.
583
583
One solution is to rotate the plot such that the bars are horizontal rather than vertical.
584
584
To accomplish this, we will swap the x and y coordinate axes:
585
585
586
-
```{r barplot-mother-tongue-flipped, fig.width=5, fig.height=3, fig.pos = "H", warning=FALSE, fig.cap = "Horizontal bar plot of the ten Aboriginal languages most often reported by Canadian residents as their mother tongue."}
586
+
```{r barplot-mother-tongue-flipped, fig.width=5, fig.height=3, fig.pos = "H", out.extra="", warning=FALSE, fig.cap = "Horizontal bar plot of the ten Aboriginal languages most often reported by Canadian residents as their mother tongue."}
587
587
ggplot(ten_lang, aes(x = mother_tongue, y = language)) +
588
588
geom_bar(stat = "identity") +
589
589
xlab("Mother Tongue (Number of Canadian Residents)") +
Copy file name to clipboardExpand all lines: wrangling.Rmd
+15-16Lines changed: 15 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -81,16 +81,15 @@ these are the values that the three variables take for the first entity in the
81
81
data set. There are 13 entities in the data set in total, corresponding to the
82
82
13 rows in Figure \@ref(fig:02-obs).
83
83
84
-
```{r 02-obs, echo = FALSE, message = FALSE, warning = FALSE, fig.align = "center", fig.cap = "A data frame storing data regarding the population of various regions in Canada. In this example data frame, the row that corresponds to the observation for the city of Vancouver is colored yellow, and the column that corresponds to the population variable is colored blue.", fig.retina = 2, out.width = "100%"}
84
+
```{r 02-obs, echo = FALSE, message = FALSE, warning = FALSE, fig.align = "center", fig.pos = "H", out.extra="", fig.cap = "A data frame storing data regarding the population of various regions in Canada. In this example data frame, the row that corresponds to the observation for the city of Vancouver is colored yellow, and the column that corresponds to the population variable is colored blue.", fig.retina = 2, out.width = "100%"}
@@ -1205,7 +1204,7 @@ or columns, as shown in Figure \@ref(fig:summarize).
1205
1204
1206
1205
(ref:summarize) `summarize` is useful for calculating summary statistics on one or more column(s). In its simplest use case, it creates a new data frame with a single row containing the summary statistic(s) for each column being summarized. The darker, top row of each table represents the column headers.
@@ -1303,7 +1302,7 @@ for each of the regions in the data set.
1303
1302
1304
1303
(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.
@@ -1345,7 +1344,7 @@ Then we will also explore how we can use a more general iteration function,
1345
1344
1346
1345
(ref:summarize-across) `summarize` + `across` or `map` is useful for efficiently calculating summary statistics on many columns at once. The darker, top row of each table represents the column headers.
> **Note:** Similar to when we use base R statistical summary functions
1455
1452
> (e.g., `max`, `min`, `mean`, `sum`, etc.) with `summarize`,
1456
1453
> `map` functions paired with base R statistical summary functions
@@ -1483,7 +1480,7 @@ We illustrate such a data transformation in Figure \@ref(fig:mutate-across).
1483
1480
1484
1481
(ref:mutate-across) `mutate` and `across` is useful for applying functions across many columns. The darker, top row of each table represents the column headers.
@@ -1525,7 +1522,7 @@ We illustrate such a data transformation in Figure \@ref(fig:rowwise).
1525
1522
1526
1523
(ref:rowwise) `rowwise` and `mutate` is useful for applying functions across columns within one row. The darker, top row of each table represents the column headers.
0 commit comments