[R] Variable im Data Frame Namen

Michael Dewey info at aghmed.fsnet.co.uk
Thu Sep 21 12:29:57 CEST 2006


At 12:03 20/09/2006, Thorsten Muehge wrote:

>Hello R Experts,
>how can I incorporate a variable in a data frame definition?

Thorsten, you have already had a reply about this, but I wonder 
whether you _really_ want to do this. You do not say what the 
scientific question is you are trying to answer, but I find that when 
I am tempted to do this it is almost always better to make a list (in 
your case of data frames) and then access the elements of the list

>Example:
>week <- 28
>test(week) <- data.frame(a,b,s,c);
>test28

Michael Dewey
http://www.aghmed.fsnet.co.uk



More information about the R-help mailing list