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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to