From 8bb53a7fc6f571d2305924f9981661282728c740 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Mon, 26 Sep 2022 08:38:18 -0500 Subject: [PATCH] Tweak prerequisite setup --- iteration.qmd | 20 +++++++++++++------- joins.qmd | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/iteration.qmd b/iteration.qmd index 5097f2f..8cd8f72 100644 --- a/iteration.qmd +++ b/iteration.qmd @@ -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()`. diff --git a/joins.qmd b/joins.qmd index 27c8773..4eb0fe0 100644 --- a/joins.qmd +++ b/joins.qmd @@ -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")`. :::