[R] [BASIC] Solution of combining two strings

John cyracules at yahoo.co.uk
Fri Dec 3 16:33:07 CET 2004


You can try the following code:

R> string3 <- paste(string1, string2, sep="")
R> ?paste

Have a look at the following functions too which I
found useful when I wanted to use 'paste':

R> ?assign
R> ?sub
R> ?gsub

Please don't forget to read the posting guide.

http://www.R-project.org/posting-guide.html

John

ps. I hope that you haven't received any "vitriolic"
and "curt" responses to your basic question as some
questioners sometimes do.

 --- Ben-Yang Liao <liaoby at umich.edu> wrote:
> Hello,
> 
> I would like to combine two strings while using R.
> For instance,
> string1 <- "abcde"
> string2 <- "WXYZ"
> I'd like to combine string1 and string2 into Sting3;
> and string3 should be "abcdeWXZY".
> Would you please tell me how to do it?
> Thank you very much
> 
> Ben-Yang




More information about the R-help mailing list