[Rd] problem subsetting of a reference class

2011-04-21 Thread A Zege
I am trying to define subset operator for a reference class and hitting some problem i am unable to diagnose.To give an example, here is a toy class generator that is a wrapper around a list tmpGEN-setRefClass(TMP, fields=list( namelist=list ))

Re: [Rd] problem subsetting of a reference class

2011-04-21 Thread John Chambers
You're confusing functional and OOP-style methods. Since you define an OOP-style method, you need to invoke it in OOP style. With your example: tmp$`[`(random) [1] -1.439131143 -0.630354726 0.822006263 -0.651707539 0.475332681 [6] 0.002680224 1.539035675 -0.117609566 2.066227300