Typo
This commit is contained in:
parent
f497d3d996
commit
d14615793a
|
@ -101,7 +101,7 @@ But they're still good to know about even if you've never used `%>%` because you
|
||||||
- The `|>` placeholder is deliberately simple and can't replicate many features of the `%>%` placeholder: you can't pass it to multiple arguments, and it doesn't have any special behavior when the placeholder is used inside another function.
|
- The `|>` placeholder is deliberately simple and can't replicate many features of the `%>%` placeholder: you can't pass it to multiple arguments, and it doesn't have any special behavior when the placeholder is used inside another function.
|
||||||
For example, `df %>% split(.$var)` is equivalent to `split(df, df$var)` and `df %>% {split(.$x, .$y)}` is equivalent to `split(df$x, df$y)`.
|
For example, `df %>% split(.$var)` is equivalent to `split(df, df$var)` and `df %>% {split(.$x, .$y)}` is equivalent to `split(df$x, df$y)`.
|
||||||
|
|
||||||
You can use `.` the left-hand side of operators like `$`, `[[`, `[` (which you'll learn about in Chapter \@ref(vectors)), so you can extract a single column from a data frame with (e.g.) `mtcars %>% .$cyl`.
|
With `%>%` you can use `.` on the left-hand side of operators like `$`, `[[`, `[` (which you'll learn about in Chapter \@ref(vectors)), so you can extract a single column from a data frame with (e.g.) `mtcars %>% .$cyl`.
|
||||||
A future version of R may add similar support for `|>` and `_`.
|
A future version of R may add similar support for `|>` and `_`.
|
||||||
For the special case of extracting a column out of a data frame, you can also use `dplyr::pull():`
|
For the special case of extracting a column out of a data frame, you can also use `dplyr::pull():`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue