As highlighted here :
http://stackoverflow.com/questions/33851742/object-ansvals-not-found-error-what-does-it-mean
MRE :
DT = data.table(a=1:3, b=4:6)
myCol = "b"
DT[,myCol,with=F] # correct
# b
#1: 4
#2: 5
#3: 6
DT[,(myCol),with=F] # correct
# b
#1: 4
#2: 5
#3: 6
DT[,.(myCol),with=F] # unhelpful error message (ansvals is internal variable)
#Error in `[.data.table`(DT, , .(myCol), with = F) :
# object 'ansvals' not found
As highlighted here :
http://stackoverflow.com/questions/33851742/object-ansvals-not-found-error-what-does-it-mean
MRE :