[R] Class & Method, S3 / S4

Dominik Locher dominik.locher at bondsearch.ch
Thu Mar 2 13:21:02 CET 2006


Hi Martin

Thanks a lot for your short example. If you input

test(testObj)

it will return

22

However, how is it possible that the value will be saved in the object

i.e. (does not work currently!!??)
setMethod("test", signature=c("connect"),
  function( obj ) { obj at value<-obj at value / 2 })

so that test(testObj) will save a new value to obj at value or 

testObj at value will return 22.

Thanks.
Nik




More information about the R-help mailing list