Re: [R] Re-assigning variables stored as character strings in another variable

2010-02-22 Thread Henrique Dallazuanna
See ?get and ?assign On Mon, Feb 22, 2010 at 4:49 PM, Anthony Damico wrote: > Is there any way to get the last line of this code to double the contents of > a and b without naming them directly? > > #create variables a and b > a<-5 > b<-10 > > #store variable names a and b in variables c and d >

[R] Re-assigning variables stored as character strings in another variable

2010-02-22 Thread Anthony Damico
Is there any way to get the last line of this code to double the contents of a and b without naming them directly? #create variables a and b a<-5 b<-10 #store variable names a and b in variables c and d c<-"a" d<-"b" e<-c(c,d) #loop through both variables for (i in e){ #print the numbers five