I wish to change the class of selected variables in a data table, using a vectorized operation. I am new to the data.table syntax, and am trying to learn as much as possible. I
You could avoid the overhead of the construction of .SD within j by using set
.SD
j
set
for(j in index) set(data, j =j ,value = as.character(data[[j]]))