[R] Transforming a string into a command
petr.pikal at precheza.cz
Tue Nov 29 11:01:25 CET 2011
> Did my reply get orphaned or are you trying to help me realize that
> why something does not work is not a straightforward question? I'll try
> cover both bases.
> I'll focus just on the first case that I don't understand. Suppose we
> s<- "ln(a+b)"
> Error in eval(expr, envir, enclos) : could not find function "ln"
What is function ln supposed to do and to what package it belongs. I get
No documentation for ‘ln’ in specified packages and libraries:
you could try ‘??ln’
but it does not mean that ln is not used elsewhere.
> Perhaps it's because I don't understand eval well (any good references
> reading up on eval, parse, substitute, etc.?). But I expected it to
> the same as the following line:
> David Winsemius wrote
> > On Nov 29, 2011, at 2:00 AM, Xu Wang wrote:
> >> Why don't the following two commands work?
> >> eval(parse(text=s))
> >> eval(as.expression(s))
> > Can you think of anything else we might need to know in order to
> > answer that question?
> > --
> > David Winsemius, MD
> > West Hartford, CT
> > ______________________________________________
> > R-help@ 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.
> View this message in context:
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help