문제

I am pretty new using R in an advanced way...so apologize for futile questions! I want to create a object of class S4, defined by 3 slots. Thing is that I can't manage to create these attributes as a list. Here is my code :

test<-setClass("dblist",representation(df.list="list", df.para="list",df.coups="list"))
new("dblist",representation(df.list="list", df.para="list",df.coups="list"))

and the error I get :

Error in initialize(value, ...) : cannot use object of class “list” in new():  class   
“dblistpgn” does not extend that class

Could you please explain how creating an object with list plot? Thx!

도움이 되었습니까?

해결책

try this:

new("dblist", df.list = list(), df.para = list(), df.coups = list())
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top