Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
minimaxir
on Feb 16, 2017
|
parent
|
context
|
favorite
| on:
R for Excel Users
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.
_Wintermute
on Feb 16, 2017
[–]
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]
minimaxir
on Feb 16, 2017
|
parent
[–]
True, although not as a part of a dplyr chain, which is cleaner.
disgruntledphd2
on Feb 16, 2017
|
root
|
parent
[–]
extract and extract2 from magrittr also work. I do normally use dplyr though.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: