Skip to content

Instantly share code, notes, and snippets.

@trcook
Created November 5, 2015 21:05
Show Gist options
  • Save trcook/f1464d301613bad4f639 to your computer and use it in GitHub Desktop.
Save trcook/f1464d301613bad4f639 to your computer and use it in GitHub Desktop.
Using data.table programatically
# pass column as string into data.table programatically
tmp<-function(x="col"){
x =eval(substitute(as.name(x)))
dt[is.na(eval(x))==F,eval(x)]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment