library(magrittr) mtcars %>% subset(cyl == 6) %>% `[[`("mpg") %>% mean() # Equivalent using placeholder mtcars %>% subset(cyl == 6, . ) %>% `[[`("mpg", .) %>% mean(.)
Standard input is empty
[1] 19.74286
Error in subset(cyl == 6, .) : object 'cyl' not found Calls: %>% ... eval -> eval -> _fseq -> freduce -> <Anonymous> -> subset Execution halted