Hi Martin, thanks for your quick answer. I didn't know that '.' could be missleading. Is there any standard way to name function for S4 objects? "get","set" etc..?
I saw your example, and I was wondering, why get.par(ext) put out "Son1", and not the same as get.par(new("Son1", name="Son1", par=3)) If I define a function just like setMethod("get.par", "Father", function(object) object@name) , for example setMethod("get.par", "Father", function(object) object@par) then it would work, for all objects, which are either Son1 or Son2, but not all object, which are "Father", contains also the variable par get.par(new("Father")) Alexander -- View this message in context: http://r.789695.n4.nabble.com/Extending-a-group-of-S4-classes-by-setClassUnion-tp4475251p4475650.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.