salcaraz at obelix.umh.es
2008-Apr-02 16:51 UTC
[R] problems with 'eval' and 'parse' with strings
Hi R-friends: I don't understand very well the parser. if I do: p="v=" q=5 eval(parse(text=paste(p,q,sep=""))) ... then the value of v is 5, OK. but I can't with strings, for example: p="v=" q="hello friend" eval(parse(text=paste(p,q,sep=""))) ...... error and, I would need that v has the value "hello friend" Could anyone help me, please? Thank you in advance /salva
Richard.Cotton at hsl.gov.uk
2008-Apr-02 17:13 UTC
[R] problems with 'eval' and 'parse' with strings
> p="v=" > q=5 > eval(parse(text=paste(p,q,sep=""))) > > ... then the value of v is 5, OK. > > but I can't with strings, for example: > > p="v=" > q="hello friend" > eval(parse(text=paste(p,q,sep=""))) > > ...... errorTry: eval(parse(text=paste(p,"'",q,"'",sep=""))) Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}