parent
419e7eaa99
commit
273a481021
6
tidy.Rmd
6
tidy.Rmd
|
@ -406,7 +406,7 @@ treatment <- frame_data(
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
You can fill in these missing values with `fill()`. It takes a set of columns where you want missing values to be replaced by the most recent non-missing value (sometimese called last observation carried forward).
|
You can fill in these missing values with `fill()`. It takes a set of columns where you want missing values to be replaced by the most recent non-missing value (sometimes called last observation carried forward).
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
treatment %>%
|
treatment %>%
|
||||||
|
@ -502,7 +502,7 @@ who3 <- who2 %>%
|
||||||
who3
|
who3
|
||||||
```
|
```
|
||||||
|
|
||||||
Then we might as well drop the `new` colum because it's constant in this dataset. While we're dropping columns, let's also drop `iso2` and `iso3` since they're redundant.
|
Then we might as well drop the `new` column because it's constant in this dataset. While we're dropping columns, let's also drop `iso2` and `iso3` since they're redundant.
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
who3 %>%
|
who3 %>%
|
||||||
|
@ -521,7 +521,7 @@ who5
|
||||||
|
|
||||||
The `who` dataset is now tidy!
|
The `who` dataset is now tidy!
|
||||||
|
|
||||||
I've shown you the code a piece at a time, assinging each interim result to a new variable. This typically isn't how you'd work interactively. Instead, you'd gradually build up a complex pipe:
|
I've shown you the code a piece at a time, assigning each interim result to a new variable. This typically isn't how you'd work interactively. Instead, you'd gradually build up a complex pipe:
|
||||||
|
|
||||||
```{r, results = "hide"}
|
```{r, results = "hide"}
|
||||||
who %>%
|
who %>%
|
||||||
|
|
Loading…
Reference in New Issue