I have a data.table looking like this:
dd <- data.table(a= 1:3, `1990` = 4:6, `1991` = 7:9, `1992` = 10:12)
I want to select columns that essentially correspond to integers.
The following code would work if dd
is a data.frame but fails if dd
is a data.table
dd[,as.character(1990:1992)]
The following does not work either:
dd[,.(1990:1992)]
Is there a solution that mimics the data.frame solution mentioned?