Can someone explain why in the following code (taken from Hadley, R for Data Science, Chapter 13, print, First Edition)
library(tidyverse)
mtcars %>% split(.$cyl) # Works
mtcars |> split(.$cyl) # Does not work
the third line throws an error saying
#Error in split.data.frame(mtcars, .$cyl) : object '.' not found
I thought that the pipe %>%
and the native pipe |>
could be used interchangeably.
Using R.4.2. Is it generally a bad idea to use the native pipe implemented in RStudio?