[R] Combind two different vector

Gabor Grothendieck ggrothendieck at gmail.com
Sun Nov 28 04:11:58 CET 2010


On Sat, Nov 27, 2010 at 1:56 PM, Georg Ruß <research at georgruss.de> wrote:
> On 27/11/10 19:04:27, Serdar Akin wrote:
>>    Hi
>>    No its has to be like this:
>>    a b
>>    1 1
>>    2 2
>>    3 3
>>      4
>>      5
>>      6
>



Assuming the empty cells are to be NAs turn a and b into ts objects
(since ts objects will cbind in the way you like) and finally turn it
back into a matrix:

matrix(cbind(ts(a), ts(b)), nc = 2)



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list