[R] Help with first S3-class

Martin Møller Skarbiniks Pedersen traxplayer at gmail.com
Wed Jan 3 01:07:17 CET 2018


On 3 January 2018 at 00:52, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 02/01/2018 6:38 PM, Martin Møller Skarbiniks Pedersen wrote:
>>
>> Hi,
>>
>>    I am trying to understand S3 classes. I have read several tutorials
>> about
>> the topics but I am still a bit confused. I guess it is because it is
>> so different from
>> Java OOP.
>
>
> What you do below isn't S3.  S3 is a system where the classes are secondary
> to the generic functions.  Methods "belong" to generics, they don't belong
> to classes.  As far as I can see, you hardly make use of S3 methods and
> generics at all.
>
> For the style you're using, the R6 or R.oo packages might be more suitable.

OK. Thanks, I will rewrite the code.

I read the guide at https://www.programiz.com/r-programming/S3-class
to make the code.
And used the part under: 1.3.2. Local Environment Approach

There is a picture of Wickham and it is sponsored by Datacamp so I was
thinking it was a good place for a guide ?!

Regards
Martin



More information about the R-help mailing list