How can I add a new method to the generic function "[" or "+"

I want to create a S3 and S4 class that will use the "[" and "+" method in a 
different way.
How can I overload the generic primitive "[" or "+" so the method dispatch will 
work correctly for my class?

I saw an example of this in the ggplot2 package where different objects are 
joined using the "+" primitive.
Still, I could not figure out how to do that. 

Can someone give a small code example to show how that works?

TIA
Mark

–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Dipl. Wirt.-Ing. cand. Psych.
Vorstraße 93 B01
28359 Bremen
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com





        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to