When should we use braces {} when piping with dplyr

I found out that some expressions can be transmitted only if inside curly brackets (curly braces, { }), for example:

library(dplyr)
3 %>% {3 + .}
3 %>% {ifelse(. < 2, TRUE, FALSE)}

What are the rules for using curly braces in pipelines? When should we use it and with what expressions?

+6
source share

Source: https://habr.com/ru/post/1015519/


All Articles