[Rd] ReferenceClasses examples {method}

Marc Carpentier marc.carpentier at ymail.com
Fri Jan 28 20:01:43 CET 2011

Dear r-devel-list, dear John Chambers,

I'm trying to learn OOP-possibilities in R and I was going through the 
documentation 'ReferenceClasses {methods}' (great work, by the way...).
Reading associated Examples, something bothers me : it seems to me that there 
are errors in 'edit' and 'undo' methods. I think that :
- 'undo' should update 'edits' field with :
length(edits) <<- length(edits) - 1 #(and not - 2)
- and for coherence, 'edit' should store modifications in an 'append'-style :
edits <<- c(edits,list(backup)) #as opposed to c(list(backup),edits)

I hope I'm not wrong and this hasn't been previously reported (I didn't find 
anything about it)
Best regards.

PS: I first posted this message on help-list. David Winsemius suggested  me 
devel-list would probably be more appropriate and was right about that. Sorry if 
you read it  again.
PPS: please associate my address when responding because I didn't subscribe to 
r-devel-list (I'm still far from being able to follow all its discussions...)

More information about the R-devel mailing list