[R] Combind two different vector

Gabor Grothendieck
Sun, 28 Nov 2010 03:11:58 -0000

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