I know this is very basic--I'm wondering if there is a  way to write data frames as outputs from a loop.
In other words, take this simple example:
 
> a <- data.frame(x = c(1,2,3,4), y = c(1,2,1,2))
 
Given a, how would you write a loop that creates two data frames, x and y, where the first column is a column of a and the second column is two times the first column, or:
 
> x
  x.1 x.2
1   1   2
2   2   4
3   3   6
4   4   8

 
and 
 
> y
  y.1 y.2
1   1   2
2   2   4
3   1   2
4   2   4

 


DISCLAIMER: This e-mail message and any attachments are inte...{{dropped}}


