Hi, 

  Here is my implementation:

> combine <- function(x){
+ odd <- x[1:length(x) %% 2 == 1]
+ even <- x[1:length(x) %%2 == 0]
+ paste0(odd,even)}
> temp <- letters[1:24]
> temp
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r"
"s" "t" "u" "v" "w" "x"
> combine(temp)
 [1] "ab" "cd" "ef" "gh" "ij" "kl" "mn" "op" "qr" "st" "uv" "wx"



--
View this message in context: 
http://r.789695.n4.nabble.com/Paste-every-two-columns-together-tp4702429p4702433.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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