[R] Variable Descriptors

Frank E Harrell Jr feh3k at spamcop.net
Wed Apr 14 22:16:55 CEST 2004


On Wed, 14 Apr 2004 15:50:51 -0400
"Zodet, Marc" <MZodet at ahrq.gov> wrote:

> Is there a way to associate text descriptions with variables in a
> data.frame?
> 
>  
> 
> For example...
> 
>  
> 
> Let's say that in my data.frame I have a variable named var1.  var1
> represents the responses to the question "When was the last time you saw
> your physician?"  When I tabulate the variable var1 I'd like the output
> to be a bit more descriptive and contain the more descriptive question
> (i.e.,"When was...) rather than just var1.
> 
>  
> 
> What I'm looking for is something analogous to the label statement in
> SAS.

The Hmisc package provides this, and many of its graphics and table-making
functions use the labels.

Frank

> 
>  
> 
> Thanks for your help.
> 
>  
> 
> Marc
> 
>  
> 
> Marc W. Zodet, MS
> 
> Health Statistician
> 
>  
> 
> Agency for Healthcare Research and Quality
> 
> Center for Financing, Access, and Cost Trends
> 
> Division of Statistical Research and Methods
> 
> 540 Gaither Road, Room 5058
> 
> Rockville, Maryland 20850
> 
>  
> 
> Phone:  301-427-1563
> 
> FAX:    301-427-1276
> 
> E-mail:  <mailto:mzodet at ahrq.gov> mzodet at ahrq.gov
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html


---
Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list