Re: [R] Removing objects and clearing memory

2011-09-27 Thread Kondor
>>> How do I remove all objects except one in R? Here is another way. ls() gives you a list. get a number (n) of the item you'd like to keep, and then do: rm(list=ls()[n+1:last]) rm(list=ls()[1:n-1]) ls() should return only one object after this. -- View this message in context: http://r.78

Re: [R] Removing objects and clearing memory

2011-04-13 Thread Jim Silverton
On Wed, Apr 13, 2011 at 11:12 AM, Jim Silverton wrote: > Hey guys thanks very much for al your responses. It was very helpful. > > Jim > > > On Tue, Apr 12, 2011 at 6:59 PM, Peter Ehlers wrote: > >> On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: >> >>> How do I remove all objects exce

Re: [R] Removing objects and clearing memory

2011-04-13 Thread Jim Silverton
Hey guys thanks very much for al your responses. It was very helpful. Jim On Tue, Apr 12, 2011 at 6:59 PM, Peter Ehlers wrote: > On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: > >> How do I remove all objects except one in R? > > rm(list=ls()) #will remove ALL objects >

Re: [R] Removing objects and clearing memory

2011-04-12 Thread B77S
#replace v with whatever rm(list=(ls()[ls()!="v"])) -- View this message in context: http://r.789695.n4.nabble.com/Removing-objects-and-clearing-memory-tp3445763p3445865.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Peter Ehlers
On 2011-04-12 15:52, seeliger.c...@epamail.epa.gov wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects But he wanted to remove all objects ***except one***!!! So what's the point of this answer? I can't see any way except a rather round-about kludge to

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Seeliger . Curt
> >> How do I remove all objects except one in R? > >> > > rm(list=ls()) #will remove ALL objects > > But he wanted to remove all objects ***except one***!!! So what's the > point of this answer? > > I can't see any way except a rather round-about kludge to do what the > OP wants. ... That migh

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
This should work also data.frame(ls()) rm(list=ls()[-5]) #for instance On 13.04.2011 01:45, Rolf Turner wrote: > On 13/04/11 09:49, Denis Kazakiewicz wrote: >> On 13.04.2011 00:39, Jim Silverton wrote: >>> How do I remove all objects except one in R? >>> >> rm(list=ls()) #will remove ALL objects

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Rolf Turner
On 13/04/11 09:49, Denis Kazakiewicz wrote: On 13.04.2011 00:39, Jim Silverton wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects But he wanted to remove all objects ***except one***!!! So what's the point of this answer? I can't see any way except a

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
On 13.04.2011 00:39, Jim Silverton wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

[R] Removing objects and clearing memory

2011-04-12 Thread Jim Silverton
How do I remove all objects except one in R? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posti