Skip to content

DT[,.(myCol),with=FALSE] gives error 'object ansvals not found' #1440

@mattdowle

Description

@mattdowle

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions