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

Agustin Lobo alobo at ija.csic.es
Thu Jul 25 16:05:15 CEST 2002


I would make a vector with the list of
files to removed. If the position
is the only way you have to select, you could use:

toberemoved <- ls()
toberemoved <- toberemoved[c(1:20,25:30)]

check that toberemoved is what you want to remove and then

remove(list=toberemoved)

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es


On Thu, 25 Jul 2002, 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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