Skip to content
Prev 106704 / 398525 Next

How to write string dynamicly?

Hi Gabor:
          Thank you!  But it didn't work. Since lda() takes the variable 
name as the input parameter. So what I was trying to do is "make the name 
dynamically". I used sprintf() to generate a variable name, such as "V16". 
But it seems that the function doesn't recognize the generated name. For 
example, lda(V16,data=mydata) works, But,
lda(sprintf("V%d",k),data=mydata) does not work, where k=16.  So I guess the 
name generated by sprintf is not the parameter wanted. But I have no idea 
about it.

Best,

Feng


----- Original Message ----- 
From: "Gabor Grothendieck" <ggrothendieck at gmail.com>
To: "Feng Qiu" <fqiu at gatech.edu>
Cc: <r-help at stat.math.ethz.ch>
Sent: Wednesday, December 27, 2006 1:56 PM
Subject: Re: [R] How to write string dynamicly?