I know that I can do this,
x<- data.table( mtcars )
x[ , .N , by = as.numeric( gear==4 & carb==4) ]
But I don't know how to do it with character strings. If I was using a single variable name, I could use get()
and that would work
x[ , .N , by = get( "as.numeric( gear==4 & carb==4)") ]