Re: [R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-25 Thread Jonathan Dushoff
Thanks for your help, and sorry for mis-posting. JD On Wed, Sep 25, 2013 at 3:18 AM, Matthew Dowle wrote: > Very sorry to hear this bit you. If you need a copy of names before > changing them by reference : > oldnames <- copy(names(DT)) > This will be documented and it's on the bug list

Re: [R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-25 Thread Matthew Dowle
Very sorry to hear this bit you. If you need a copy of names before changing them by reference : oldnames <- copy(names(DT)) This will be documented and it's on the bug list to do so. copy is needed in other circumstances too, see ?copy. More details here : http://stackoverflow.com/q