Tweak prerequisite setup

This commit is contained in:
Hadley Wickham 2022-09-26 08:38:18 -05:00
parent 2f637609c4
commit 8bb53a7fc6
2 changed files with 14 additions and 8 deletions

View File

@ -23,6 +23,11 @@ We'll conclude with a brief discussion of `for`-loops, an important iteration te
### Prerequisites
::: callout-important
This chapter relies on features only found in purrr 1.0.0, which is still in development.
If you want to live life on the edge you can get the dev version with `devtools::install_github("tidyverse/purrr")`.
:::
In this chapter, we'll focus on tools provided by dplyr and purrr, both core members of the tidyverse.
You've seen dplyr before, but purrr is new.
We're going to use just a couple of purrr functions from in this chapter, but it's a great package to skill as you improve your programming skills.
@ -34,6 +39,14 @@ We're going to use just a couple of purrr functions from in this chapter, but it
library(tidyverse)
```
This chapter also relies on a function that hasn't yet been implemented for dplyr:
```{r}
pick <- function(cols) {
across({{ cols }})
}
```
## Modifying multiple columns {#sec-across}
Imagine you have this simple tibble:
@ -307,13 +320,6 @@ diamonds |>
summarise_means(c(carat, x:z))
```
```{r}
#| include: false
pick <- function(cols) {
across({{ cols }})
}
```
### Vs `pivot_longer()`
Before we go on, it's worth pointing out an interesting connection between `across()` and `pivot_longer()`.

View File

@ -26,7 +26,7 @@ If you're familiar with SQL, you should find the ideas in this chapter familiar,
### Prerequisites
::: callout-important
This chapter relies on features only found in the development version of dplyr.
This chapter relies on features only found in dplyr 1.1.0, which is still in development.
If you want to live life on the edge you can get the dev version with `devtools::install_github("tidyverse/dplyr")`.
:::