Re: [Rd] function to remove attributes?

From: Prof Brian D Ripley <>
Date: Tue 30 Jan 2007 - 09:38:28 GMT

On Tue, 30 Jan 2007, Tamas K Papp wrote:

> Hi,
> I would like to know if there is a compact way to remove attributes
> from an object. I know attributes(obj) <- NULL works, but I wonder if
> there is something similar to unclass or unname. RSiteSearch didn't
> reveal anything.

as.vector is usually used for this purpose, but note the caveat on the help page. (And if you have a classed object you probably do not want to remove all attributes, since class is one.)

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Tue Jan 30 20:41:09 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 30 Jan 2007 - 11:31:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.