typeInfo <- function(x) { print(x, digits=22) cat("str: ") str(x) cat("mode: ", mode(x), "\n") cat("typeof: ", typeof(x), "\n") cat("class: ", class(x), "\n") # if there are attributes, print them too if (! is.null(attributes(x))) { cat("attributes:\n") print(attributes(x)) } }