I\'d like to know how to ascertain the class of a column in a data.table dt given a character vector w.
dt
w
Reproducible example:
These seem to work in the way you want:
class(dt[[w]])
sapply(dt,class)
Also, doing 2 and then subsetting works for 1: sapply(dt,class)[w].
sapply(dt,class)[w]