[R] Removing a list of Objects

Gabor Csardi csardi at rmki.kfki.hu
Wed May 9 09:06:58 CEST 2007


Hmmm,

rm(list=a)

is what you want.

Gabor

On Wed, May 09, 2007 at 10:29:05AM +0530, Patnaik, Tirthankar  wrote:
> Hi,
> 	I have a simple beginner's question on removing a list of
> objects. Say I have objects C243.Daily1, C243.Daily2...C243.Daily5 in my
> workspace. I'd like to remove these without using rm five times.
> 
> So I write. 
> 
> > a <- list(paste("C243.Daily",sep="",1:5))
> 
> > rm(a)
> 
> Obviously this wouldn't work, as it would only remove the object a.
> 
> But is there any way I could do this, like on the lines of a UNIX `
> (grave-accent)
> 
> Something like
> 
> Prompt> rm `find . -type f -name "foo"`
> 
> TIA and best,
> -Tir
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    MTA RMKI, ELTE TTK



More information about the R-help mailing list