Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] sorry, I forgot the tilde

Vladimir Eremeev

2007-01-29

Replies:




Vladimir Eremeev wrote:
>
> That is
>
> C.Rosa wrote:
>>
>> for (i in c("UK","USA"))
>> output{i}<-summary(lm(y{i} ~ x{i}))
>>
>
> for (i in c("UK","USA")) {
>  lm.txt<-paste("output",i,"<-","lm(","y",i,"~","x",i,")",sep="") # 1.
> produce a character string containing needed expression
>  eval(parse(text=lm.txt))                                
> # 2. parse and evaluate it
> }
>

--
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@(protected)
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.
©2008 r-help.com - Jax Systems, LLC, U.S.A.