Why the .
, to indicate the first object that was passed to the function, works with %>%
operator but not with |>
operator?
> a <- 1:10
> a[2] <- NA
> library(tidyr)
> a %>% replace(is.na(.),11)
[1] 1 11 3 4 5 6 7 8 9 10
> a |> replace(is.na(.),11)
Error: object '.' not found