Pergunta

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!

Foi útil?

Solução

try this:

new("dblist", df.list = list(), df.para = list(), df.coups = list())
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top