Skip to content

any updates w.r.t. lapply, sapply, apply retaining classes

3 messages · Mike Williamson, Richard M. Heiberger, Hadley Wickham

#
I don't see why that command should be a problem because class()
returns a string.

A better example might be sapply(x, identity) which in general you
would hope to be identical to x:

x <- structure(1:10, class = "blah")
identical(x, sapply(x, identity))
# [1] FALSE

Hadley