R, at its heart, is a functional language. This means that it has certain technical properties, but more importantly that it lends itself to a style of problem solving centred on functions.
——Hadley Wickham
首先,可能会让你失望了,R语言更倾向于以函数为核心,而不是对象,可能与你熟悉的Python或Java不太一样。
其次,R语言中比较主流的S3和S4对象类型,是“generic function OOP”,而非“encapsulated OOP”,这又和你熟悉的Python不太一样。
但是,你想找的那种“encapsulated OOP”对象类型也有,比如base中的“Reference Classes”( RC),或者R6包中的R6类型对象。