3 ms·
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]
by _Wintermute 10y ago
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 10y agoTrue, although not as a part of a dplyr chain, which is cleaner.
- disgruntledphd2 10y agoextract and extract2 from magrittr also work. I do normally use dplyr though.