More R Magic
The technical term for magic is “object orientation”. Object orientation is voluntary in R, and in fact there are two different versions of it in R. They are called — for historical reasons — S3 methods and S4 methods.
Need to know
As a user of R there is very little that you need to know about object orientation. The main point of object orientation is to make things easier for the user. You don’t need to memorize a lot of function names, you can merely use
plot to get an appropriate picture for a wide range of types of objects.
The main way that object orientation can be a disadvantage is that
Many objects with a class are really a list. You can see the names of that list with:
You can always see the true structure of an object with:
Circle 7 provides a cursory introduction to object orientation in R.
Back to top level of Impatient R