[R] problem with parse

2005-11-22 Thread Antje Döring
Hi there again,

 

I have a problem with the parse-command. 

 

First of all, I show you in a simplified way, what I am trying to do and what 
R answers:

 

 test

 [1] u.g$par1, u.g$par2
 mode(test)

 [1] character

 ausdruck - parse(text = test)

 Error in parse(file, n, text, prompt) : syntax error in u.g$par1,

 

That is what I did and I can't find the mistake. I just want to have test 
without quotes (to do eval(ausdruck) later) but somehow it doesn't work.

 

Is there anything I have overlooked? Can't I put special characters like $ or 
, into this test-character?

 

Thanks a lot for your help.

 

Best, Antje


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problem with parse

2005-11-22 Thread Marc Kirchner
Hello Antje,

 Is there anything I have overlooked? Can't I put special characters
 like $ or , into this test-character?

If I understand ?parse correctly, you are supposed to pass a valid R
expression to it and 
u.g$par1, u.g$par2
is not as the comma is not a valid delimiter here.
However,

 parse(text=u.g$par1; u.g$par2)
expression(u.g$par1, u.g$par2)

does work (note the semicolon instead of the comma) and 
might be what you want.

Regards,
Marc

-- 

Dipl. Inform. Med. Marc Kirchner
Interdisciplinary Centre for Scientific Computing (IWR)
Multidimensional Image Processing
INF 368
University of Heidelberg
D-69120 Heidelberg
Tel: ++49-6221-54 87 97
Fax: ++49-6221-54 88 50
[EMAIL PROTECTED]



signature.asc
Description: Digital signature
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html