[R] How does one do simple string concatenation?

Henrique Dallazuanna wwwhsd at gmail.com
Mon Mar 17 12:12:49 CET 2008


Try;

paste(c(c("a","b","c"), "d"), collapse="")

On 17/03/2008, Ajay Shah <ajayshah at mayin.org> wrote:
> How does one convert objects c("a","b","c") and "d" into "abcd"?
>
>    > paste(c("a","b","c"), "d")
>  of course yields
>    [1] "a d" "b d" "c d"
>
>  --
>  Ajay Shah                                      http://www.mayin.org/ajayshah
>  ajayshah at mayin.org                             http://ajayshahblog.blogspot.com
>  <*(:-? - wizard who doesn't know the answer.
>
>  ______________________________________________
>  R-help at 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.
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list