Skip to content
Prev 180496 / 398525 Next

creating and then executing command strings

On Fri, May 15, 2009 at 3:38 PM, Romain Francois
<romain.francois at dbmail.com> wrote:
Thanks you so much! I used the first version and it worked.

What puzzles me, is that I am not able to use <- instead of = (my R
book says the two can be exchanged) or break the command into
different parts and execute them one after another.

I get various error messages when I try:

eval( parse( text <- paste("avg_",colname, " <- 0;", sep='') ) )

or

text = paste("avg_",colname, " <- 0;", sep='')
parse(text)
eval(parse(text))

Anyway, thanks a lot - you greatly improved the likelihood of me not
working on the weekend!

Best - P