Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] printing the name of the arguments passed to a function

John Sorkin

2005-07-16

Replies:

R2.1.1
Win 2k
I have a function, B, within a function, A.
I would like to have B print the name of the argument passed to it (not
the value of the arguments).
i.e.,

A<-function()
{
  B<-function(x,y)
    {
     fit1<-lm(y~x,data=jo)
     print(summary(fit1)
     I want B to print the string "age" and the string "height".
    }
B(age,height)
}

I would like have function B print the name of the arguments passed to
it, i.e. I want B to print the word
age
and the word
height

I would appreciate any suggestions that would help me accomplish this
task.

Thanks,
John

John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC

University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524

410-605-7119
- NOTE NEW EMAIL ADDRESS:
jsorkin@(protected)

 [[alternative HTML version deleted]]

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.