
try this 

rm(list=ls(pat="C243.Daily")


> ls(pat="XXXX.")
 [1] "XXXX.chutes"              "XXXX.densityplot" 
"XXXX.densityplot.default" "XXXX.densityplot.formula"
 [5] "XXXX.eda"                 "XXXX.eda.ts" "XXXX.fancy.stripchart" 
"XXXX.freqpoly" 
 [9] "XXXX.hist.and.boxplot"    "XXXX.lag"                 "XXXX.lm"   
"XXXX.median.test" 
[13] "XXXX.plot.hist.and.box"   "XXXX.scatterplot"         "XXXX.sim"    
"XXXX.violinplot" 
[17] "XXXX.violinplot.default"  "XXXX.violinplot.formula"  "XXXX.z.test"   
 
> ls(pat="XXXX.l")
[1] "XXXX.lag" "XXXX.lm" 
> rm(list = ls(pat="XXXX.l"))
> ls(pat="XXXX.l")
character(0)


-  Regards,

          \\\|||||///
       \\   -    -   //
        (  o   o  )
oOOo-(_)-oOOo--------
|
| Gaurav Yadav
| Assistant Manager, CCIL, Mumbai (India)
| Mob: +919821286118 Email: emailtogauravyadav@gmail.com
| Man is made by his belief, as He believes, so He is.
|                                           --- Bhagavad Gita 
|_______Oooo________
         oooO(      )
         (      )   )   /
          \   (    (_/
            \_ )




"Patnaik, Tirthankar " <tirthankar.patnaik@citi.com> 
Sent by: r-help-bounces@stat.math.ethz.ch
05/09/2007 02:33 PM

To
"Gabor Csardi" <csardi@rmki.kfki.hu>
cc
r-help@stat.math.ethz.ch
Subject
Re: [R] Removing a list of Objects






Hi Gabor,
                 Tried this, and didn't quite work.

> a <- list(paste("C243.Daily",sep="",1:5))
> a
[[1]]
[1] "C243.Daily1" "C243.Daily2" "C243.Daily3" "C243.Daily4"
"C243.Daily5"

> rm(list=a)
Error in remove(list, envir, inherits) : invalid first argument
> 

-Tir

-----Original Message-----
From: Gabor Csardi [mailto:csardi@rmki.kfki.hu] 
Sent: Wednesday, May 09, 2007 12:37 PM
To: Patnaik, Tirthankar [GWM-CIR]
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Removing a list of Objects

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@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@rmki.kfki.hu>    MTA RMKI, ELTE TTK

______________________________________________
R-help@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.



============================================================================================
DISCLAIMER AND CONFIDENTIALITY CAUTION:\ \ This message and ...{{dropped}}

