Skip to content

Commit

Permalink
Rewrote section about renaming pivot columns
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersAskeland authored and lwjohnst86 committed May 7, 2024
1 parent f04b79f commit f3147c6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sessions/pivots.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,11 @@ mmash |>
))
```

While everyting now works, the output names are a bit confusing. For
example, what does `value_median_1` mean? We can make it more
understandable by modifying our `pivot_wider()` to define a group name
and adding a `rename_with()` with an anonymous function to remove
`value_` from the text.
While everyting now works, the column names are a bit confusing. For
example, what does `value_median_1` mean? We can make it more explicit
by modifying our `pivot_wider()` to define a group name and performing a
`rename_with()` (with an anonymous function) to remove the `value_` from
the text.

```{r finalize-summary-function}
#| filename: "R/functions.R"
Expand Down Expand Up @@ -675,4 +675,3 @@ history with {{< var keybind.git >}}.
format.
- Use `pivot_longer()` to convert from wide to long.
- Use `pivot_wider()` to convert from long to wide.

0 comments on commit f3147c6

Please sign in to comment.