[R] Reconstruct a dataset

Lisa lisajca at gmail.com
Tue Dec 15 23:04:44 CET 2009


Dear all,

I have a dataset that looks like this:

inividual   var1  var2   …
1              1     1   …
2              1     2   …  
3              2     1   …  
4              2     2   …  
…              …     …   …

I will random sample 2 individuals from this dataset based on a set of
random numbers, e.g., 

rn1 <- c(0, 0, 1, 1),  rn2 <- c(0, 0, 2, 0), rn3 <- c(1, 0, 0, 1), rn4 <-
c(0, 1, 1, 0),…

After reconstructed the samples, I have a dataset that looks like this:

id  var1.1  var1.2  var2.1  var2.2  …
1        2       2       1       2  …
2        2       2       1       1  … 
3        1       2       1       2  … 
4        1       2       2       1  … 
…        …       …       …       …  …

Please ignore the bold and italic fond styles, I just want to make my
problem clear.

Can anyone please help how to get this done? Your help would be greatly
appreciated. 

Lisa 


-- 
View this message in context: http://n4.nabble.com/Reconstruct-a-dataset-tp964699p964699.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list