[R] An example of "overloading" [

Vincent Goulet vincent.goulet at act.ulaval.ca
Tue Mar 13 14:37:08 CET 2007


Le Mardi 13 Mars 2007 00:28, Sender a écrit :
> Hello:
>
> Could anyone point me to a nice example where someone has created methods
> for "[" on a user defined Class?
>
> I looked at the package Matrix but that was a little daunting. I'm looking
> for someone a little more introductory. I've tried to search the help
> section and the web but its difficult since "[" isn't searchable.
>
> Thanks in advance!

You might also have a look at the methods for "[" and "[<-" created 
for "grouped data" objects in the development version of package actuar.

Creation of the objects:
https://vgoulet.act.ulaval.ca/svn/R/actuar/trunk/actuar/R/grouped.data.R

Extraction methods:
https://vgoulet.act.ulaval.ca/svn/R/actuar/trunk/actuar/R/Extract.grouped.data.R

Doc:
https://vgoulet.act.ulaval.ca/svn/R/actuar/trunk/actuar/man/grouped.data.Rd
https://vgoulet.act.ulaval.ca/svn/R/actuar/trunk/actuar/man/Extract.grouped.data.Rd

Package:
http://vgoulet.act.ulaval.ca/actuar/

HTH

-- 
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec 
  Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca



More information about the R-help mailing list