Select / assign to data.table when variable names are stored in a character vector
Two ways to programmatically select variable(s): with = FALSE: DT = data.table(col1 = 1:3) colname = “col1” DT[, colname, with = FALSE] # col1 # 1: 1 # 2: 2 # 3: 3 ‘dot dot’ (..) prefix: DT[, ..colname] # col1 # 1: 1 # 2: 2 # 3: 3 For further description of the … Read more