【发布时间】:2020-04-03 11:46:19
【问题描述】:
从Chamber的Extending R中听说R中存在的一切都是对象(在Python中也是如此:Python中的类是对象,类的类是元类.)。 S4 类是对象吗? S4 类的类型是什么?
> setClass("Person",
+ slots = c(
+ name = "character",
+ age = "numeric"
+ )
+ )
> typeof(Person)
Error in typeof(Person) : object 'Person' not found
> typeof("Person")
[1] "character"
> attributes(Person)
Error: object 'Person' not found
谢谢。
【问题讨论】:
-
您认为其中一个答案足以被接受吗?
-
是的。提前感谢您的耐心等待。