[R] Question about for loop?

Andris Jankevics andza at osi.lv
Thu Mar 30 08:43:44 CEST 2006

Hello useRs,

I can't figure out how can I store a data frame of values of X and D  from 
this loop:

Z <- c(1:10)

for (i in 1:(length(Z)-2)) 
	{D <- x[1:(2+i)]; 
	X <- paste("x",sep="",i)
	print (X)
	print (D)

Thank You,

Andris Jankevics

More information about the R-help mailing list