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
>
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
2 matches
Mail list logo