Hi the list, I am defining S4 objet. Is it possbile to define a method that change the slot of an object without using <- ? My object contain a numeric and a matrix. At some point, I would like to impute the missing value in the matrix. So I would like to use something like :
----------------- setClass("MyObj",representation(time="numeric",traj="matrix")) a <- new("MyObj",time=3,traj=matrix(c(1:6,NA,8:12),ncol=3)) imputeMyObj(a) ----------------- I find 'setTime<-' to change le slot time, but it can not work in the case of imputeMyObs since this mehod does not need a value... Any solution ? Thanks Christophe ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.