This must be very simple, but I'm stuck. I have a command line in R defined as a variable of a string of characters. How can I convert the variable so that I can execute it in R? Really appreciate any help, Gang
Gang Chen wrote:> This must be very simple, but I'm stuck. I have a command line in R > defined as a variable of a string of characters. How can I convert > the variable so that I can execute it in R? > >First parse() it then eval() the result -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Can you provide an example of your input and what you expect the output to be. You can always use 'as.numeric'. On 10/29/07, Gang Chen <gangchen at mail.nih.gov> wrote:> This must be very simple, but I'm stuck. I have a command line in R > defined as a variable of a string of characters. How can I convert > the variable so that I can execute it in R? > > Really appreciate any help, > Gang > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
I'm not sure what you mean. You should provide an example (i.e. some code). Julian Gang Chen wrote:> This must be very simple, but I'm stuck. I have a command line in R > defined as a variable of a string of characters. How can I convert > the variable so that I can execute it in R? > > Really appreciate any help, > Gang > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.