Skip to content
Back to formatted view

Raw Message

Message-ID: <2DAC09F0-3626-4698-8DE1-027A89DC6810@xs4all.nl>
Date: 2012-09-14T16:25:18Z
From: Berend Hasselman
Subject: concatenating two vectors
In-Reply-To: <1347627269256-4643139.post@n4.nabble.com>

On 14-09-2012, at 14:54, ?zg?r Asar wrote:

> Dear all,
> 
> I want to concatenate the elements of two vectors such as
> 
> a<-c("a1","a2")
> b<-c("b1","b2")
> 
> and obtain
> 
> "a1b1", "a1b2","a2b1","a2b2"
> 
> I tried the paste and paste0 functions, but they yielded elementwise
> concatenation such as

This is also an option

sort(outer(a,b,paste0))

Berend