[R] help with oop in R - class structure and syntex
Luke Tierney
luke at stat.uiowa.edu
Tue Feb 5 17:34:13 CET 2008
On Tue, 5 Feb 2008, Barry Rowlingson wrote:
> Duncan Murdoch wrote:
>
>> Another problem is that there are two different class systems in R:
>> sometimes calls S3 and S4 (because of the versions of S where they were
>> introduced). You were reading about S3.
>
> There's three different class systems if you also include the R.oo
> add-on package[1]. Even perl, the language seemingly founded on the
> concept of TMTOWTDI[2], only has the one OOP system.
>
You need to be a bit careful here. R has two object systems, S3, and
S4, that are supported in the R internals to allow methods for things
like `+` to be written. In addition, R is rich enough as a language
to allow users to develop their own object systems if they choose.
The fact that there are two internally supported systems is not
ideal. On the other, the fact that users can write their own and have
done so is a feature.
luke
> Barry
>
> [1] http://www1.maths.lth.se/help/R/R.oo/
> [2] There's More Than One Way To Do It
>
> ______________________________________________
> R-help at 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.
>
--
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu
More information about the R-help
mailing list