[R] Help with concatenation and arrays

John Fox jfox at mcmail.cis.mcmaster.ca
Wed Jun 26 22:09:28 CEST 2002


Dear Vlad,

On Wed, 26 Jun 2002 VBMorozov at lbl.gov wrote:

> 1) I have 2 variables, e.g. x<-5; y<-"Char"
> How do I create a new variable which would have both these values in a
> string (e.g. "5Char", or "5 Char", etc ) ??
>

You can use paste to get both of these results:

    >  x<-5; y<-"Char"
    > paste(x, y)
    [1] "5 Char"
    > paste(x, y, sep="")
    [1] "5Char"

John



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list