[R] "Attach" for S4 objects?
F.Tusell
etptupaf at bs.ehu.es
Tue Jan 18 15:37:51 CET 2005
When passing a list as an argument to a function, I find it convenient
to attach it in the first line of th function code, then refer to the
components as A, B, etc. rather than as list$A, list$B, etc.
If I pass a S4 class object, is there a way to "attach" it, or do I have
to refer to the slots as object at A, objetc at B, etc.?
I could always make copies,
A <- object at A
B <- object at B
...
but "object" has many slots, some fairly large, so this seems wasteful.
Thank you.
--
Fernando TUSELL e-mail:
Departamento de Econometría y Estadística etptupaf at bs.ehu.es
Facultad de CC.EE. y Empresariales Tel: (+34)94.601.3733
Avenida Lendakari Aguirre, 83 Fax: (+34)94.601.3754
E-48015 BILBAO (Spain) Secr: (+34)94.601.3740
More information about the R-help
mailing list