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

From: John Sorkin <jsorkin_at_grecc.umaryland.edu>
Date: Sun 17 Jul 2005 - 12:35:11 EST


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@grecc.umaryland.edu

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 17 12:39:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:46 EST