For functions which do not preserve the class of the input object, I make wrappers that generally look like this:
fn_wrap <- function (x) {
old_class <- class(x)
x <- fn(x) # which does not preserve x's class...
class(x) <- unique(class(x), old_class)
Am I wrong? Is this right?