From ripley at stats.ox.ac.uk  Tue Jan 30 10:38:28 2007
From: ripley at stats.ox.ac.uk (Prof Brian D Ripley)
Date: Tue, 30 Jan 2007 09:38:28 +0000 (GMT Standard Time)
Subject: [Rd] function to remove attributes?
In-Reply-To: <20070130091101.GA28937@pu100877.student.princeton.edu>
References: <20070130091101.GA28937@pu100877.student.princeton.edu>
Message-ID: <Pine.WNT.4.64.0701300937080.2432@Petrel>

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,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] function to remove attributes?
Prof Brian D Ripley