Last active
March 31, 2016 00:48
-
-
Save briandconnelly/e86aed13a5365248dd042969f557f756 to your computer and use it in GitHub Desktop.
Problems with NSE and lazyeval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_column_ <- function(.data, colname) { | |
lazyeval::lazy_eval(colname, .data) | |
} | |
get_column <- function(.data, col) { | |
# Adding .data as the env argument to lazy() is also not working | |
get_column_(.data=.data, colname=lazyeval::lazy(col)) | |
} | |
mydata <- data.frame(time = c(1,2,3), value = rnorm(3)) | |
# How can I get data from a column with a conflicting name (i.e., 'time')? | |
get_column(mydata, time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mebbe: