> Note how S3 methods are dispatched only by reference to the first
> argument (on the left of the operator). I think S4 beats this by
> having signatures that can dispatch depending on both arguments.
That's somewhat of a simplification for primitive binary operators. R
actually looks up the meth
On Thu, Oct 28, 2010 at 12:14 PM, Christofer Bogaso
wrote:
> Dear Barry, this is really interesting. However I could not understand
> this line:
>
> Ops.ss=function(e1,e2){paste(e1,e2)}
>
> Where you have told R to behave "+" function differently when it faces
> "ss" class?
> What should be the id
On Thu, Oct 28, 2010 at 2:12 PM, Martin Morgan wrote:
> Not so hard, eh? Though then like your S3 implementation this makes all
> 'Ops' (see ?Ops)
Except you have to re-run the set* things every R session:
> setClass("SS", "character")
> setMethod(Ops, c("SS", "SS"), function(e1, e2) paste(e
On 10/28/2010 02:17 AM, Barry Rowlingson wrote:
> On Thu, Oct 28, 2010 at 9:31 AM, Mark Heckmann wrote:
>>
>> 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 th
Dear Barry, this is really interesting. However I could not understand
this line:
Ops.ss=function(e1,e2){paste(e1,e2)}
Where you have told R to behave "+" function differently when it faces
"ss" class?
What should be the ideal approach if I what to use "*" function?
Thanks,
On Thu, Oct 28, 2010
On Thu, Oct 28, 2010 at 9:31 AM, Mark Heckmann wrote:
>
> 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
>
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
7 matches
Mail list logo