[R] remove objects(1-20, 25-30) OR remove objects(...) except(...)??

Joerg Maeder maeder at atmos.umnw.ethz.ch
Thu Jul 25 15:33:48 CEST 2002


Hello Ulrich,

i use the following function to remove all objects with names with one
or two letters. I use such variable names for temporary objects. I think
you can use something similary for your problem

clear <- function(){
 ll<-objects(1)
 ll<-ll[nchar(ll)<3]
 remove(list=ll,pos=1)
}


gruess

joerg

Ulrich Leopold wrote:
> 
> Dear list,
> 
> I would like to do a remove like either
> 
> remove objects(1-20, 25-30) OR remove objects(...) except(...)
> 
> I only found the approach rm(pat=) which is not suitable as there would be
> too many patterns.
> 
> Can I also remove objects by their given number in ls() or do a remove but
> exclude certain objetcs?
> 
> Regards, Ulrich
> 
> --
> __________________________________________________
> 
> Ulrich Leopold MSc.
> 
> Department of Physical Geography
> Institute for Biodiversity and Ecosystem Dynamics
> Faculty of Science
> University of Amsterdam
> Nieuwe Achtergracht 166
> NL-1018WV Amsterdam
> 
> Phone: +31-(0)20-525-7456 (7451 Secretary)
> Fax:   +31-(0)20-525-7431
> Email: uleopold at science.uva.nl
> http://www.frw.uva.nl/soil/Welcome.html
> 
> Check us also out at:
> Netherlands Centre for Geo-ecological Research
> http://www.frw.uva.nl/icg
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
Joerg Maeder    .:|:||:..:.||.::   maeder at atmos.umnw.ethz.ch
Tel: +41 1 633 36 25   .:|:||:..:.||.::   
http://www.iac.ethz.ch/staff/maeder
PhD student at INSTITUTE FOR ATMOSPHERIC AND CLIMATE SCIENCE (IACETH)
ETH ZÜRICH Switzerland
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list