[R] string concatenation

Jiefei Wang @zwj|08 @end|ng |rom gm@||@com
Thu Nov 5 06:24:17 CET 2020


Hi John,

Try paste0(x,collapse = ", ")

Best,
Jiefei

On Thu, Nov 5, 2020 at 1:16 PM John <miaojpm using gmail.com> wrote:

> Hi,
>
> I have a sequence of characters:
>
> x <- c("Alice", "Bob", "Charles")
>
> How can I produce the following results:
>
> "Alice, Bob, Charles"
>
> ?
>
> paste? merge?
>
> Thank you very much!
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list