fork download
  1. library(magrittr)
  2. mtcars %>%
  3. subset(cyl == 6) %>%
  4. `[[`("mpg") %>%
  5. mean()
  6.  
  7. # Equivalent using placeholder
  8. mtcars %>%
  9. subset(cyl == 6, . ) %>%
  10. `[[`("mpg", .) %>%
  11. mean(.)
Success #stdin #stdout #stderr 0.28s 43468KB
stdin
Standard input is empty
stdout
[1] 19.74286
stderr
Error in subset(cyl == 6, .) : object 'cyl' not found
Calls: %>% ... eval -> eval -> _fseq -> freduce -> <Anonymous> -> subset
Execution halted