New here so apologies in advance!
I am using data.tables in R and I want to 'combine' various columns (say, V1, V2, V3,...). I have the names of the columns in a list (for example, lst <- c("V1", "V2")
). So, basically I want to create a new column V3 such as
DT[, V3: = combine(lst)]
Also, the idea is that lst can be of any length and I am concerned about efficiency.
I don't mind what kind of format the union has (char, numeric, etc.). Any ideas?
Thank you very much in advance.