Re: [Rd] method using several (and different) arguments in turn

2012-02-14 Thread james.foadi
Dear Martin, I could not entirely follow your suggestion. I can see how you define two classes inheriting from TypeOfSample, and how these two classes have two associated methods (incidentally, I'm unfamiliar with the: function(type,x=numeric(),...)to do. J expression. What is type?

[Rd] method using several (and different) arguments in turn

2012-02-14 Thread james.foadi
Dear R-developers community, I have the following generic: setGeneric( name="newsample", def=function(x,y,z,a,b,c,...){standardGeneric("newsample")} And I can build several methods for this generic. One useful thing is to use "newsample" with only one of the

Re: [Rd] how to define method for "+" function in a new class

2010-07-07 Thread james.foadi
Thank you, Martin! Very clear. J Dr James Foadi PhD Membrane Protein Laboratory (MPL) Diamond Light Source Ltd Diamond House Harewell Science and Innovation Campus Chilton, Didcot Oxfordshire OX11 0DE Email: james.fo...@diamond.ac.uk Alt Email: j.fo...@imperial.ac.uk -Original Messa

Re: [Rd] how to define method for "+" function in a new class

2010-07-07 Thread james.foadi
I don't know why a "3D" appears instead of a "(". Please, interpret a "( whenever you see a "3D". J Dr James Foadi PhD Membrane Protein Laboratory (MPL) Diamond Light Source Ltd Diamond House Harewell Science and Innovation Campus Chilton, Didcot Oxfordshire OX11 0DE Email: james.fo...@diam

[Rd] how to define method for "+" function in a new class

2010-07-07 Thread james.foadi
Dear R developers, I have a new class, which I called "Molecule", and have tried to define = a "+" operation for 2 objects of this class. This is what I have written so far, although the method is not complete = (I'm trying to look at it at intermediate stages): setMethod( f=3D"+",