search for: unrecognizedclass

Displaying 1 result from an estimated 1 matches for "unrecognizedclass".

2011 Apr 11
3
sort.int(S3object) strips class but not the is.object flag
If x has an S3 class then sort.int(x) returns a value without an S3 class but which has the is.object flag set, which, I think, causes identical() give a false/misleading report: > x <- structure(1:3, class="unrecognizedClass") > y <- sort.int(x) > t <- 1:3 > identical(y, t) # expect TRUE [1] FALSE > identical(as.vector(y), as.vector(t)) # expect TRUE [1] FALSE > dput(y) 1:3 > dput(t) 1:3 > class(y) [1] "integer" > class(t) [1] "integer"...