Re: [R] Help with first S3-class

2018-01-03 Thread Martin Møller Skarbiniks Pedersen
On 3 January 2018 at 08:36, Jeff Newmiller wrote: > Function arguments are not pass-by-reference... they are pass-by-value. You > need to return the altered object to the caller when you are done messing > with it. Thanks. Of course. Now it is working. > Note that R is a data processing langu

Re: [R] Help with first S3-class

2018-01-02 Thread Jeff Newmiller
Function arguments are not pass-by-reference... they are pass-by-value. You need to return the altered object to the caller when you are done messing with it. Note that R is a data processing language... your example will not scale to real world use cases because you make no use of vectorizatio

Re: [R] Help with first S3-class

2018-01-02 Thread Martin Møller Skarbiniks Pedersen
Some mistake: > I expect this output: [1] 100 Martin Saldo is: 100 but I get [1] 0 Martn Saldo is: 0 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

Re: [R] Help with first S3-class

2018-01-02 Thread Martin Møller Skarbiniks Pedersen
On 3 January 2018 at 00:52, Duncan Murdoch 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 differe

Re: [R] Help with first S3-class

2018-01-02 Thread Martin Møller Skarbiniks Pedersen
On 3 January 2018 at 00:52, Duncan Murdoch 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 differe

Re: [R] Help with first S3-class

2018-01-02 Thread Duncan Murdoch
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 t