I found out that some expressions can only be piped if inside curly brackets (braces, { }
), for instance:
library(dplyr)
3 %>% {3 + .}
3 %>% {ifelse(. < 2, TRUE, FALSE)}
What are the rules behind the use of curly brackets when piping? When should we use it and with which expressions?