Skip to content

Commit

Permalink
Update 06-data-carpentry.Rmd (#287)
Browse files Browse the repository at this point in the history
changed the order of "sex" and "age" in the section 6.3.2.
  • Loading branch information
thrkng authored Aug 25, 2020
1 parent 963d82a commit 397f108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 06-data-carpentry.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ Splitting means taking a variable that is really two variables combined and crea
agesex = c("m0-10", "f0-10") # create compound variable
n = c(3, 5) # create a value for each observation
agesex_df = tibble(agesex, n) # create a data frame
separate(agesex_df, agesex, c("age", "sex"), sep = 1)
separate(agesex_df, agesex, c("sex", "age"), sep = 1)
```

```{r to-separate, echo=FALSE,}
knitr::kable(agesex_df, caption = "Joined age and sex variables in one column")
```

```{r separated, echo=FALSE}
knitr::kable(separate(agesex_df, agesex, c("age", "sex"), sep = 1),
knitr::kable(separate(agesex_df, agesex, c("sex", "age"), sep = 1),
caption = "Age and sex variables separated by the function `separate`.")
```

Expand Down

0 comments on commit 397f108

Please sign in to comment.