Convert from %>% to |>

This commit is contained in:
Hadley Wickham
2022-02-23 13:15:52 -06:00
parent 1b0c50894a
commit da0fbd50d5
36 changed files with 542 additions and 552 deletions

View File

@@ -34,9 +34,9 @@ ggplot(diamonds, aes(color)) + geom_bar()
### The largest diamonds
```{r}
diamonds %>%
arrange(desc(carat)) %>%
head(100) %>%
select(carat, cut, color, price) %>%
diamonds |>
arrange(desc(carat)) |>
head(100) |>
select(carat, cut, color, price) |>
DT::datatable()
```

View File

@@ -8,7 +8,7 @@ output: html_document
library(ggplot2)
library(dplyr)
smaller <- diamonds %>%
smaller <- diamonds |>
filter(carat <= 2.5)
```
@@ -18,7 +18,7 @@ We have data about `r nrow(diamonds)` diamonds. Only
below:
```{r, echo = FALSE}
smaller %>%
smaller |>
ggplot(aes(carat)) +
geom_freqpoly(binwidth = 0.01)
```

View File

@@ -8,7 +8,7 @@ params:
library(ggplot2)
library(dplyr)
class <- mpg %>% filter(class == params$my_class)
class <- mpg |> filter(class == params$my_class)
```
# Fuel economy for `r params$my_class`s