Hacker News new | past | comments | ask | show | jobs | submit login

The standard evaluation versions of all dplyr functions are available, just add an underscore to the end: filter_, select_, ...



I'm of the opinion that non-standard evaluation probably isn't the best introduction for converting people from excel to R. As nice as dplyr's syntax is for beginners you can quickly get into the whole ugly side of R.

Also it's often not as simple as just prefixing an underscore, you end up reading the lazyeval vignette and messing about with quote() and formula syntax.


A cool feature of select_ I discovered accidently is that you can pass in a vector of column names to get the corresponding columns, which is much easier than abusing which() to lookup indices.


Not sure if I'm misunderstanding, but you've always been able to slice on a vector of column names.

    cols <- c("colA", "colB")
    dataframe[, cols]


True, although not as a part of a dplyr chain, which is cleaner.


extract and extract2 from magrittr also work. I do normally use dplyr though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: