Hi
                X       <-      data.table(a=rep(1:3,1:3),b=31:36,c=7:12)
                X
                setnames(X,     2,      "a" )  ## two column named "a" now
                X
                X[,2:=200L, with=FALSE  ]       # Change the entries of column 2
                X[,2, with=FALSE  ]                     # Instead of changing 
column 2, the code
appears to have done a look up on the column names and picked the first
match
                X

Can anybody tell me how to change column 2 in this example when I have
duplicate column names?

Thanks
Sean


--
View this message in context: 
http://r.789695.n4.nabble.com/Is-this-supposed-to-happen-tp4631075.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to