data.table
is a fantastic R package and I am using it in a library I am developing. So far all is going very well, except for one complication. It seems to be m
Maybe you know about this solution already?
DT[[colname]]
This is inspired by @eddi's solution in the comments below, using the OP's example:
set.seed(1)
x = data.table(a = 1:10, b=rnorm(10))
colstr="b"
col <- eval(parse(text=paste("quote(",colstr,")",sep="")))
x[eval(col)<0]
x[eval(col)<0,c(colstr):=-100]