title: In R, how can one make a method of an S4 object that directly adjusts the values inside the slots of that object?
body: <p>Is there a way to allow a method of an S4 object to directly adjust the values inside the slots of that object without copying the entire object into memory and having to re-write it to the parent environment at the end of the method?  Right now I have an object that has slots where it keeps track of its own state.  I call a method that advances it to the next state, but right now it seems like I have to assign() each value (or a copy of the object invoking the method) back to the parent environment.  As a result, the object oriented code seems to be running <em>a lot</em> slower than code that simply adjusts the various state variables in a loop.</p>