December 2017
Beginner to intermediate
470 pages
12h 29m
English
Some programmers feel that S3 does not provide the safety normally associated with object-oriented programming. In S3, it is very easy to create a class, but it can also lead to very confusing and hard to debug code when not used with great care. For example, you could easily misspell a name, and R would not complain. You could easily change the class to an object, and R would not complain, either.
S4 classes were developed after S3, with the goal of adding safety. S4 provides protection, but it also introduces a lot of verbosity to provide that safety. The S4 object model implements most features of modern object-oriented programming languages—formal class definitions, inheritance, polymorphism (parametric), and encapsulation. ...