Tweak prerequisite setup
This commit is contained in:
parent
2f637609c4
commit
8bb53a7fc6
|
@ -23,6 +23,11 @@ We'll conclude with a brief discussion of `for`-loops, an important iteration te
|
||||||
|
|
||||||
### Prerequisites
|
### 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.
|
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.
|
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.
|
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)
|
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}
|
## Modifying multiple columns {#sec-across}
|
||||||
|
|
||||||
Imagine you have this simple tibble:
|
Imagine you have this simple tibble:
|
||||||
|
@ -307,13 +320,6 @@ diamonds |>
|
||||||
summarise_means(c(carat, x:z))
|
summarise_means(c(carat, x:z))
|
||||||
```
|
```
|
||||||
|
|
||||||
```{r}
|
|
||||||
#| include: false
|
|
||||||
pick <- function(cols) {
|
|
||||||
across({{ cols }})
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Vs `pivot_longer()`
|
### Vs `pivot_longer()`
|
||||||
|
|
||||||
Before we go on, it's worth pointing out an interesting connection between `across()` and `pivot_longer()`.
|
Before we go on, it's worth pointing out an interesting connection between `across()` and `pivot_longer()`.
|
||||||
|
|
|
@ -26,7 +26,7 @@ If you're familiar with SQL, you should find the ideas in this chapter familiar,
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
::: callout-important
|
::: 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")`.
|
If you want to live life on the edge you can get the dev version with `devtools::install_github("tidyverse/dplyr")`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue