Fixes #1329
This commit is contained in:
Hadley Wickham 2023-03-01 09:45:08 -06:00
parent 7cd62150c0
commit 844879979b
1 changed files with 1 additions and 1 deletions

View File

@ -351,7 +351,7 @@ If you stare at these columns for long enough, you'll notice there's a pattern.
Each column name is made up of three pieces separated by `_`.
The first piece, `sp`/`rel`/`ep`, describes the method used for the `diagnosis`, the second piece, `m`/`f` is the `gender`, and the third piece, `014`/`1524`/`2535`/`3544`/`4554`/`65` is the `age` range.
So in this case we have six variables: two variables are already columns, three variables are contained in the column name, and one variable is in the cell name.
So in this case we have six variables: two variables are already columns, three variables are contained in the column name, and one variable is in the cell value.
This requires two changes to our call to `pivot_longer()`: `names_to` gets a vector of column names and `names_sep` describes how to split the variable name up into pieces:
```{r}