Skip to content

remove multiple objects starting with same name

3 messages · katarv, R. Michael Weylandt, Uwe Ligges

#
Hi,

I'm trying to figure out syntax R function rm() needs to remove all objects
starting with same name.  For example, if I have object1, object2, object3,
i want to do an operation similar to UNIX rm object*

Thanks.




--
View this message in context: http://r.789695.n4.nabble.com/remove-multiple-objects-starting-with-same-name-tp4418694p4418694.html
Sent from the R help mailing list archive at Nabble.com.
#
rm(list = ls(pattern = "object"))

Michael
On Fri, Feb 24, 2012 at 4:40 PM, katarv <katiasmirn at gmail.com> wrote:
#
On 25.02.2012 08:00, R. Michael Weylandt wrote:
Or

rm(list = ls(pattern = "^object"))

since we know the names start woth "object".

Uwe