Skip to content
Prev 304361 / 398503 Next

don't print object attributes

On 28/08/2012 1:12 PM, Liviu Andronic wrote:
Assign a class to the object, and write a print method for it.

For example, this doesn't quite do what you want, but it's a start:

print.noattributes <- function(x, ...) {
    attributes(x) <- NULL
    print(x)
}

class(x) <- "noattributes"
x

It loses some attributes that you probably want to keep (e.g. the 
names), but otherwise works on your example.

Duncan Murdoch