I've been trying take two data.tables, cbind them, and re-sort the columns so the first column of the first data.table is the next to the first column of the first data.table and so on.
I used the Map function to come up with the interlocking indexes but when I pass the values to j, it just returns the indexes as a vector. Here are some examples of what I'm talking about:
m <- data.table(a = 1:10, b = letters[1:10], c = LETTERS[1:10], d = rnorm(10))
m[, c(1, 3, 2, 4)] # works
m[, unlist(list(1, 3, 2, 4))] # doesn't work
m[, c(unlist(list(1, 3, 2, 4)))] # works
m[, c(unlist(Map(c, c(1, 2), c(3, 4))))] # doesn't work