Hi the list, With basic type, length gives the length of the vector Wtih list, length gives the number of item With S4 object, length gives...one. Even with an objet with empty slot.
setClass("E",representation(e="numeric")) [1] "E" length(new("E")) [1] 1 setClass("E",representation(e="matrix")) [1] "E" length(new("E")) [1] 1 Is there a way to get the real length of an S4 objet ? Furthermore, is there a simple way to detect that an object is has all its slot to object of size zero ? 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.