Petr, thanks for pointing that out. Jim, you are exactly right! Thank you
for catching that. I did not realize in the other replies that they were
using log and not ln.
David, thank you for the lessons. I will improve my question asking skills.
Thanks to all,
Xu
On Tue, Nov 29, 2011 at 9:31 AM,
On Nov 29, 2011, at 2:30 AM, Xu Wang wrote:
David,
Did my reply get orphaned
All replies are "orphaned". You are asked to include context if your
question relies on code that has previously been posted.
or are you trying to help me realize that asking
why something does not work is not
On 11/29/2011 06:30 PM, Xu Wang wrote:
David,
Did my reply get orphaned or are you trying to help me realize that asking
why something does not work is not a straightforward question? I'll try to
cover both bases.
I'll focus just on the first case that I don't understand. Suppose we have
s<- "l
Hi
>
> Did my reply get orphaned or are you trying to help me realize that
asking
> why something does not work is not a straightforward question? I'll try
to
> cover both bases.
>
> I'll focus just on the first case that I don't understand. Suppose we
have
> s<- "ln(a+b)"
> a<-1
> b<-2
> e
David,
Did my reply get orphaned or are you trying to help me realize that asking
why something does not work is not a straightforward question? I'll try to
cover both bases.
I'll focus just on the first case that I don't understand. Suppose we have
s<- "ln(a+b)"
a<-1
b<-2
eval(parse(text=s))
E
> 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))
> >
Hm, try to set an object s before calling.
Regards
Petr
> __
> R-help@r-project.org mailing list
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
___
Why don't the following two commands work?
eval(parse(text=s))
eval(as.expression(s))
--
View this message in context:
http://r.789695.n4.nabble.com/Transforming-a-string-into-a-command-tp4112183p4118243.html
Sent from the R help mailing list archive at Nabble.com.
_
?eval
s<- expression(log(a+b))
a<-1
b<-2
eval(s)
Andrija
On Sun, Nov 27, 2011 at 11:16 AM, Victor wrote:
> I would like to make a string executable, e.g,
>
> s<- "ln(a+b)"
> a<-1
> b<-2
>
> execute string s to obtain ln(a+b)
>
> How can I make it?
>
> Ciao fron Rome
> Vittorio
>
> ___
This is one way to do it.
a = 1
b = 2
c = parse(text = "log(a + b)")
eval(c)
Hope this helps.
Cheers,
On 27/11/2011 11:16 a.m., Victor wrote:
I would like to make a string executable, e.g,
s<- "ln(a+b)"
a<-1
b<-2
execute string s to obtain ln(a+b)
How can I make it?
Ciao fron Ro
I would like to make a string executable, e.g,
s<- "ln(a+b)"
a<-1
b<-2
execute string s to obtain ln(a+b)
How can I make it?
Ciao fron Rome
Vittorio
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
11 matches
Mail list logo