Update data-tidy.qmd
This commit is contained in:
parent
dfaef41c90
commit
9b74249f26
|
@ -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
|
#| Pivoting with `names_to = c(".value", "num")` splits the column names
|
||||||
#| into two components: the first part determines the output column
|
#| into two components: the first part determines the output column
|
||||||
#| name (`x` or `y`), and the second part determines the value of the
|
#| name (`x` or `y`), and the second part determines the value of the
|
||||||
#| `id` column.
|
#| `num` column.
|
||||||
#| fig-alt: >
|
#| fig-alt: >
|
||||||
#| A diagram that uses color to illustrate how the special ".value"
|
#| 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",
|
#| 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 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)
|
knitr::include_graphics("diagrams/tidy-data/names-and-values.png", dpi = 270)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue