>>> 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
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
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
>
#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
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
> >> 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
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
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
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:
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
10 matches
Mail list logo