Skip to content
Back to formatted view

Raw Message

Message-ID: <005101c7296a$212df280$bfcc4dc7@Aglog>
Date: 2006-12-27T03:37:35Z
From: Feng Qiu
Subject: How to write string dynamicly?

Hi everyone:
         I'm trying to compose a string dynamicly for the parameter input of 
some function. For example:
In package MASS, function lda() require to input the name of predictor 
variable. Let's say the 16th column is the predictor variable. Then we call 
the function like this: lda(V16~., data=mydata). I don't want to hard-code 
the call, instead, I would like to use a dynamic expression for this 
parameter so that I can use my program on different set of data.
        I guess there are some function that can do this, but I didn't find 
it in "Introduction to R" so far, could someone please tell me this kind of 
function? Thank you!

Best,

Feng