[R] Merging vector data into one file

Dieter Menne dieter.menne at menne-biomed.de
Mon Feb 1 08:20:27 CET 2010



Altaweel, Mark R. wrote:
> 
> 
> I had another question. If you had say a vector (e.g., called data)  
> with 235 elements and each element looked like the following
> 
> data[[1]]
> Column A-B    Column Z-S    Column A-S....
> 1	                  2                        5 .......
> 
> 
> data[[2]]
> Column Z-B    Column A-S    Column A-B....
> 2	                  1                        3 .......
> 
> result=data[[1]] + data[[2]].......
> 
> Column A-B    Column Z-S    Column A-S    Column Z-B.........
> 4                        2                        6			      2.......
> 
> 

Add the columns from [1] that are not in [2], and set these to NA. Then use
rbind, followed by rowsum or some other accumulating function.

Dieter



-- 
View this message in context: http://n4.nabble.com/Merging-vector-data-into-one-file-tp1458475p1458503.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list