[R] remove object

Romain Francois romain.francois at dbmail.com
Fri May 29 20:18:59 CEST 2009


fernando espindola wrote:
> Hi list....
>
> I try to remove all object less one, this object is called index. I have
> many object with different names and pattern option in ls function may not
> remove this object why any word in index object repeats with other object.
> Anybody can give me one advise for this question....
>
> Thank for all
>
> fernando
>   
Is this what you are looking for:

rm( list = setdiff( ls( ), "index") ) )

Romain

-- 
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr




More information about the R-help mailing list