> setClass("person",representation(name="character",age="numeric",kids="list")) [1] "person" > bob <- new("person") > length(b...@name) [1] 0 > length(b...@age) [1] 0 > length(b...@kids) [1] 0 > is.na(b...@kids) logical(0) > is.na(b...@age) logical(0) > is.na(b...@name) logical(0) > b...@kids <- list("joe","sue") > is.na(b...@kids) [1] FALSE FALSE > length(b...@kids) [1] 2
Ah, length(obj...@property) is what i was looking for. Thanks alot. -- View this message in context: http://r.789695.n4.nabble.com/test-to-see-if-a-s4-property-is-assigned-tp2541044p2543895.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.