I'm trying to apply a function to a group of columns in a large data.table without referring to each one individually.
a with the MWE above, this:
a[,b=as.numeric(b),with=F] works, but this:
a[,b[2:3]:=data.table(as.numeric(b[2:3])),with=F] doesn't work. What is the correct way to apply the as.numeric function to just columns 2 and 3 of a without referring to them individually.
(In the actual data set there are tens of columns so it would be impractical)
Thanks