[R] Simple question, name of the variable as string.

2010-09-17 Thread C.H.
Dear R users,

I have a very simple question and I've tried to search for the answer.
(But failed.)

there should be a function (func) that work like

 abc - c(1,2,3,4)
 func(abc)
abc

I would like to know the name of that function. Thank you very much
for your help.

Regards,

CH

-- 
CH Chan

__
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/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Simple question, name of the variable as string.

2010-09-17 Thread David Winsemius


On Sep 17, 2010, at 2:54 AM, C.H. wrote:


Dear R users,

I have a very simple question and I've tried to search for the answer.
(But failed.)

there should be a function (func) that work like


abc - c(1,2,3,4)
func(abc)

abc


 func - function(xyz) deparse(substitute(xyz))
 func(abc)
[1] abc



I would like to know the name of that function.


--
David.

__
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/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Simple question, name of the variable as string.

2010-09-17 Thread Barry Rowlingson
On Fri, Sep 17, 2010 at 7:54 AM, C.H. chainsawti...@gmail.com wrote:
 Dear R users,

 I have a very simple question and I've tried to search for the answer.
 (But failed.)

 there should be a function (func) that work like

 abc - c(1,2,3,4)
 func(abc)
 abc

 I would like to know the name of that function. Thank you very much
 for your help.

 Think: where does R do this?

 Answer: zzz = 1:10 ; plot(zzz)  # look at the y axis.

 How did it do this? Look at the code. Type 'plot' without () and
there's the code. Somewhere in there you will see where it sets the Y
axis label, or ylab.

 Then read and understand the help pages for those functions. What
happens if I do func(c(1,2,3,4))? What's the name of 'c(1,2,3,4)'?

 Its a good way to learn.

Barry

__
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/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.