Methods belong to the object . You call them using the $ operator (e.g., my_object$do_something() ). The Core Systems 1. S3: The Pragmatic Standard
Requires an external dependency; can lead to "non-idiomatic" R code if overused. 4. Reference Classes (RC): The Internal Alternative Advanced Object-Oriented Programming in R: Stat...
S4 is a more formal version of S3, requiring explicit class definitions with "slots" and typed data. Methods belong to the object
S3 is R’s original, informal OOP system. It is essentially a list with a "class" attribute. S3: The Pragmatic Standard Requires an external dependency;
Advanced Object-Oriented Programming in R: Strategic Selection
Strict type checking; multiple dispatch (methods can choose logic based on multiple arguments). Cons: High "ceremony" and steep learning curve. 3. R6: The Modern Powerhouse
90% of R tasks, especially providing print() , summary() , or plot() methods for new data types. Pros: Minimal boilerplate; easy to learn; highly flexible.