I'm not clear why the first function operates and the second does not. Since everything other code in this example functions perfectly, my attention is limited to what is occurring with the paste() function. I tried the second function with a comma separator between each value in addition to what is displayed below.
In my function, the list should ideally be like follows, however instead of me listing these values, the paste() method should be used.
i.X41262.0.0, i.X41262.0.1, etc. are all equivalent to X41262.0.0.
c("eid", "X2784.0.0", "X2794.0.0", "fread("ukb33822.csv", select=
"X2804.0.0", "X2814.0.0", "X2834.0.0",
paste("X41262.0.," 0:65, sep = ""), "X3536.0.0", "X3546.0.0",
"X3581.0.0"))
biobank[biobank2, on = .(eid), `:=` (X2784.0.0 = i.X2784.0.0, X2794.0.0 = i.X2794.0.0,
X2804.0.0 = i.X2804.0.0, X2814.0.0 = i.X2814.0.0,
X2834.0.0 = i.X2834.0.0, X3536.0.0 = i.X3536.0.0,
X3546.0.0 = i.X3546.0.0, paste("X41262.0.", 0:65, " = ", "i.X41262.0.", 0:65, sep = ""),