I have a data table containing 4 variables. How can I add two columns using indexes.
As an example:
DT = data.table(a=6,b=8,c=0,d=5)
min1 = 3
min2 = 4
DT[,"mrg":=min1+min2,with=F] # How to write this line correctly
DT[,(c(min1,min2)):=NULL] # this works