[R] difficult R-problem

Christian Hennig hennig at stat.math.ethz.ch
Fri Feb 15 13:37:23 CET 2002


Why don't you want to have RQuadratStep as an array or a list?
The problem would vanish then, wouldn't it?

On Fri, 15 Feb 2002, Andreas Pauling wrote:

> Hi there
> 
> In the course of my diploma thesis in climatology I have encountered
> 
> a difficult R-Problem that I cannot solve. I want to fill R-Objects
> 
> (whose names should depend on j) with numbers at the i-th position.
> 
> The resulting Objects should be something like:
> 
> RQuadratStep1, RQuadratStep2, RQuadratStep3 ... filled with Elements like
> 
> c(0.324, 0.456, 0.657 ...)
> 
> Below is a short version of how I have tried to solve it but I don't
> 
> know how to insert numbers at the i-th place. The problem seems to be
> 
> the "assign" line. Thanks a lot for all hints.
> 
> for(j in 1:10) {
> 
>   for(i in 1:30)  {
> 
>     fit<-lm(annJMSLTv.box~.,data=data.frame(annJMSLTv.box=annJMSLTv.box[,i],allTreerings[,1:15])
> 
>     backfit<-step(fit,trace=F,steps=1)
> 
>     assign(eval(parse(text=paste("RQuadratStep",j,sep=""))),round(summary(fit)$r.squared, dig=3))
> 
>   }
> 
> }
> 
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-- 
***********************************************************************
Christian Hennig
Seminar fuer Statistik, ETH-Zentrum (LEO), CH-8092 Zuerich (current)
and Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
hennig at stat.math.ethz.ch, http://stat.ethz.ch/~hennig/
hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/
#######################################################################
ich empfehle www.boag.de


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list