4

In analyzing data the metadata about variables is extremely important. How do you manage this information in R?

For example, is there a way to specify a label that will be printed instead of the variable name?

What facilities are there in R for this?

Andrew Redd
  • 4,632
  • 8
  • 40
  • 64
  • 1
    I'll add that some of the need for this in other languages (think SAS and 8 character variable name limits) isn't present in R. If my variable is Mean_Aspririn_Concentration_after_24_Hours then I can call it that. – PaulHurleyuk Nov 12 '10 at 18:10
  • 5
    @Paul - you must love typing ;-) – Gavin Simpson Nov 12 '10 at 18:48

2 Answers2

7

Quick suggestions that come to mind are

  1. attributes to store data along with an object (as Frank Harrell has championed for a long time)
  2. the comment() function can do parts of this
  3. the whole gamut of object-orientation to achieve different printing behaviour etc
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
0

Use the repo package. You can assign each variable a long name, a description, a set of tags, a remote url, dependency relations and also attach to it figures or generic external files. Find the latest stable release on CRAN (install.packages("repo")) or the latest development on github. A quick overview here. Hope it helps.

Francesco Napolitano
  • 1,538
  • 1
  • 11
  • 8