Displaying 2 results from an estimated 2 matches for "anothervari".
Did you mean:
anothervar
2004 Jul 08
3
How to pass strings to functions? [once once more, now With content I hope...]
Dear expeRts,
I fail to succesfully pass strings to functions. It comes down to the
observation that
> plot(someVariable,anotherVariable)
works fine, but
> x <- "someVariable"
> y <- "anotherVariable"
> plot(x,y)
does not.
Does this have something to do with the returned value of x being
/"someVariable"/ and not /someVariable/, i.e. without the quotation
marks? Is there any w...
2010 Feb 22
2
Re-assigning variables stored as character strings in another variable
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 and ten using only the variables c and d
#this line works fine