Scott Chamberlain and Ted Laderas
2019-05-01
data.frame
s!data.frame
: when it was generated, who generated itAny of these is an opportunity to encapsulate data together into an object!
Results object for your package
data.frame
data.frame
We want people to do something with this object!
print()
, plot()
, summary()
(S3)
shiny
From Chambers:
The main ideas of object-oriented programming are also quite simple and intuitive:
https://rstudio-pubs-static.s3.amazonaws.com/150296_904158e070594471864e89c10c0d14f9.html
override
parts of the definitionThere are three object systems in R:
Lightweight, good enough, all purpose!
Use S3 if:
print()
, summary()
, and plot()
methods for your classStricter than S3; enforces data types in slots and methods
Use S4 if:
matrix
(Matrix
package), ExpressionSet
(Bioconductor)A lot like Java/Python Objects.
Use R6 if:
Portions of this tutorial are derived from: