Internally, all that evilr is doing is updating the klass pointer in the object's Rbasic structure.
Classes also have a superclass= method, which works the same way except it operates on the super pointer instead of the klass pointer.