This commit is contained in:
Hadley Wickham 2022-11-10 06:42:39 -06:00
parent 8edfbadba3
commit 1b82fe4625
1 changed files with 2 additions and 1 deletions

View File

@ -252,7 +252,8 @@ These functions are naturally paired with `mutate()` when doing data cleaning, a
### Extract variables
The last function we'll discuss uses regular expressions to extract data out of one column into one or more new columns: `separate_wider_regex()`.
It's a peer of the `separate_wider_location()` and `separate_wider_delim()` functions that you learned about in @sec-string-columns. These functions live in tidyr because the operates on (columns of) data frames, rather than individual vectors.
It's a peer of the `separate_wider_location()` and `separate_wider_delim()` functions that you learned about in @sec-string-columns.
These functions live in tidyr because the operates on (columns of) data frames, rather than individual vectors.
Let's create a simple dataset to show how it works.
Here we have some data derived from `babynames` where we have the name, gender, and age of a bunch of people in a rather weird format[^regexps-5]: