Skip to content

Commit 397f108

Browse files
authored
Update 06-data-carpentry.Rmd (#287)
changed the order of "sex" and "age" in the section 6.3.2.
1 parent 963d82a commit 397f108

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

06-data-carpentry.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ Splitting means taking a variable that is really two variables combined and crea
163163
agesex = c("m0-10", "f0-10") # create compound variable
164164
n = c(3, 5) # create a value for each observation
165165
agesex_df = tibble(agesex, n) # create a data frame
166-
separate(agesex_df, agesex, c("age", "sex"), sep = 1)
166+
separate(agesex_df, agesex, c("sex", "age"), sep = 1)
167167
```
168168

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

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

0 commit comments

Comments
 (0)