data.table error: Error in is.finite(if (is.character(from)) from <- as.numeric(from) else from) : default method not implemented for type 'closure'

What did you tried exactly ?

Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.