[R] rbind
Torsten Hothorn
Torsten.Hothorn at rzmail.uni-erlangen.de
Fri Jun 21 12:20:11 CEST 2002
> x<- data.frame(w=NULL)
> for(i in 1:3)
> ja <- b.70[i:(i+1),2:3]
> af <- log(ja[2,]/ja[1,])
> x <- rbind(x,af)
>
maybe you should tell "for" to loop over the second and third line, too
for(i in 1:3) {
ja <- b.70[i:(i+1),2:3]
af <- log(ja[2,]/ja[1,])
x <- rbind(x,af)
}
Torsten
> But this saves only the last value of 'af' in 'x'
> > x
> ARG AUS
> 1963 -0.06313723 0.04366118
>
> So, how can I preserve the old values of x?
>
> Thanks a lot
> Patrick
>
> -------------
> Patrick Hausmann
> Friedrich-Wilhelm Str. 37 - D-28199 Bremen
> Tel. +49 421 5980631 - Fax. +49 421 5980632
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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