Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 223

Note – Recent developments

Оглавление

Reference classes are reasonably new to R and therefore, will develop further after the publication of this book. So for the most up-to-date information, we refer to R itself: type ?ReferenceClasses in the command prompt to see the latests updates in your version of R.

People with OOP background will naturally feel more comfortable with RC, it is something what people with C++, C#, PHP, Java, Python, etc., background will be familiar with: a messagepassing OO implementation. However, that sense of comfort has to be mended, in many ways, the refclass system in R is a combination of S4 and environments.

OOP

object oriented

programming

That said, the RC implementation brings R programming to a next level. This system is particularly suited for larger projects, and it will seamlessly collaborate with S4, S3 and base types. However, note that the vast majority of packages in R does not use RC, actually none of the most often used packages do. This is not only because the pre-date the refclass system but also because they do not need it (even while some are rather complex).

Using RC in R will add some complexity to your code and many people advice to use the refclass system only where the mutable state is required. This means that even while using R5, it is still possible to keep most of the code functional.

The Big R-Book

Подняться наверх