Skip to content
Prev 250674 / 398498 Next

Error when modifying names of the object returned by get()

On 15/02/2011 11:43 AM, John Edwards wrote:
You can probably do this by constructing a call to the `names<-` 
replacement function, but it's really bad style.  Don't write R code 
that has external side effects if you can avoid it.  In this case, 
you'll almost certainly get more maintainable code by writing your 
function to return a copy of x with new names, rather than trying to 
modify the original.

Duncan Murdoch