Skip to content
Prev 82098 / 398513 Next

Construct a data.frame in a FOR-loop

Say I have a FOR-loop for computing powers (just a trivial example)

for(i in 1:5)
{
	x<-i^2
	y<-i^3
}

How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for 
each iteration

Thanks,
Serguei Kaniovski