Remove an object by the reference

View: New views
3 Messages — Rating Filter:   Alert me  

Remove an object by the reference

by Shubha Vishwanath Karanth :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi R,

 

A simple question, but don't know the answer...

 

x="a"

a=5

 

I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible?

 

Shubha Karanth | Amba Research

Ph +91 80 3980 8031 | Mob +91 94 4886 4510

Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com

 

This e-mail may contain confidential and/or privileged i...{{dropped:13}}


______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: Remove an object by the reference

by Richard Pearson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How about rm(list=x)?

Richard.


Shubha Vishwanath Karanth wrote:

> Hi R,
>
>  
>
> A simple question, but don't know the answer...
>
>  
>
> x="a"
>
> a=5
>
>  
>
> I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible?
>
>  
>
> Shubha Karanth | Amba Research
>
> Ph +91 80 3980 8031 | Mob +91 94 4886 4510
>
> Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com
>
>  
>
> This e-mail may contain confidential and/or privileged i...{{dropped:13}}
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help@... mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
Richard D. Pearson             richard.pearson@...
School of Computer Science,    http://www.cs.man.ac.uk/~pearsonr
University of Manchester,      Tel: +44 161 275 6178
Oxford Road,                   Mob: +44 7971 221181
Manchester M13 9PL, UK.        Fax: +44 161 275 6204

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: Remove an object by the reference

by Gabor Csardi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> a <- 1
> x <- "a"
> rm(list=x)
> a
Error: object "a" not found

See ?rm for details.

Gabor

On Tue, May 13, 2008 at 05:13:41PM +0530, Shubha Vishwanath Karanth wrote:

> Hi R,
>
>  
>
> A simple question, but don't know the answer...
>
>  
>
> x="a"
>
> a=5
>
>  
>
> I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible?
>
>  
>
> Shubha Karanth | Amba Research
>
> Ph +91 80 3980 8031 | Mob +91 94 4886 4510
>
> Bangalore * Colombo * London * New York * San Jos? * Singapore * www.ambaresearch.com
>
>  
>
> This e-mail may contain confidential and/or privileged i...{{dropped:13}}
>

> ______________________________________________
> R-help@... mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


--
Csardi Gabor <csardi@...>    UNIL DGM

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.