Update data-tidy.qmd

This commit is contained in:
Mine Cetinkaya-Rundel 2023-04-12 20:07:41 -04:00 committed by GitHub
parent dfaef41c90
commit 9b74249f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -435,12 +435,12 @@ When you use `".value"` in `names_to`, the column names in the input contribute
#| Pivoting with `names_to = c(".value", "num")` splits the column names
#| into two components: the first part determines the output column
#| name (`x` or `y`), and the second part determines the value of the
#| `id` column.
#| `num` column.
#| fig-alt: >
#| A diagram that uses color to illustrate how the special ".value"
#| sentinel works. The input has names "x_1", "x_2", "y_1", and "y_2",
#| and we want to use the first component ("x", "y") as a variable name
#| and the second ("1", "2") as the value for a new "id" column.
#| and the second ("1", "2") as the value for a new "num" column.
knitr::include_graphics("diagrams/tidy-data/names-and-values.png", dpi = 270)
```