Fix typos (#433)
This commit is contained in:
parent
a8a45874d0
commit
5872fd7811
|
@ -246,7 +246,7 @@ glance %>%
|
||||||
geom_jitter(width = 0.5)
|
geom_jitter(width = 0.5)
|
||||||
```
|
```
|
||||||
|
|
||||||
We could put out the countries with particularly bad $R^2$ and plot the data:
|
We could pull out the countries with particularly bad $R^2$ and plot the data:
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
bad_fit <- filter(glance, r.squared < 0.25)
|
bad_fit <- filter(glance, r.squared < 0.25)
|
||||||
|
@ -257,7 +257,7 @@ gapminder %>%
|
||||||
geom_line()
|
geom_line()
|
||||||
```
|
```
|
||||||
|
|
||||||
We see two main effects here: the tragedies of the HIV/AIDS epidemic, and the Rwandan genocide.
|
We see two main effects here: the tragedies of the HIV/AIDS epidemic and the Rwandan genocide.
|
||||||
|
|
||||||
### Exercises
|
### Exercises
|
||||||
|
|
||||||
|
@ -307,13 +307,13 @@ List-columns are often most useful as intermediate data structure. They're hard
|
||||||
|
|
||||||
Generally there are three parts of an effective list-column pipeline:
|
Generally there are three parts of an effective list-column pipeline:
|
||||||
|
|
||||||
1. You create the list-column using one of `nest()`, `summarise()` + `list()`
|
1. You create the list-column using one of `nest()`, `summarise()` + `list()`,
|
||||||
or `mutate()` + a map function, as described in [Creating list-columns].
|
or `mutate()` + a map function, as described in [Creating list-columns].
|
||||||
|
|
||||||
1. You create other intermediate list-columns by transforming existing
|
1. You create other intermediate list-columns by transforming existing
|
||||||
list columns with `map()`, `map2()` or `pmap()`. For example,
|
list columns with `map()`, `map2()` or `pmap()`. For example,
|
||||||
in the case study above, we created a list-column of models by transforming
|
in the case study above, we created a list-column of models by transforming
|
||||||
a list column of data frames.
|
a list-column of data frames.
|
||||||
|
|
||||||
1. You simplify the list-column back down to a data frame or atomic vector,
|
1. You simplify the list-column back down to a data frame or atomic vector,
|
||||||
as described in [Simplifying list-columns].
|
as described in [Simplifying list-columns].
|
||||||
|
@ -331,7 +331,7 @@ Typically, you won't create list-columns with `tibble()`. Instead, you'll create
|
||||||
|
|
||||||
Alternatively, you might create them from a named list, using `tibble::enframe()`.
|
Alternatively, you might create them from a named list, using `tibble::enframe()`.
|
||||||
|
|
||||||
Generally, when creating list-columns, you should make sure they're homogeneous: each element should contain the same type of thing. There are no checks to make sure this is true, but if you use purrr and remember what you've learned about type-stable functions you should find it happens naturally.
|
Generally, when creating list-columns, you should make sure they're homogeneous: each element should contain the same type of thing. There are no checks to make sure this is true, but if you use purrr and remember what you've learned about type-stable functions, you should find it happens naturally.
|
||||||
|
|
||||||
### With nesting
|
### With nesting
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ df %>%
|
||||||
|
|
||||||
To apply the techniques of data manipulation and visualisation you've learned in this book, you'll need to simplify the list-column back to a regular column (an atomic vector), or set of columns. The technique you'll use to collapse back down to a simpler structure depends on whether you want a single value per element, or multiple values:
|
To apply the techniques of data manipulation and visualisation you've learned in this book, you'll need to simplify the list-column back to a regular column (an atomic vector), or set of columns. The technique you'll use to collapse back down to a simpler structure depends on whether you want a single value per element, or multiple values:
|
||||||
|
|
||||||
1. If you want a single values, use `mutate()` with `map_lgl()`,
|
1. If you want a single value, use `mutate()` with `map_lgl()`,
|
||||||
`map_int()`, `map_dbl()`, and `map_chr()` to create an atomic vector.
|
`map_int()`, `map_dbl()`, and `map_chr()` to create an atomic vector.
|
||||||
|
|
||||||
1. If you want many values, use `unnest()` to convert list-columns back
|
1. If you want many values, use `unnest()` to convert list-columns back
|
||||||
|
|
Loading…
Reference in New Issue