R: how can I concatenate a list?

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-05-02T03:16:31Z Indexed on 2010/05/02 3:27 UTC
Read the original article Hit count: 251

Filed under:
|
|

I'm trying to produce a single variable which is a concatenation of two chars e.g to go from "p30s4" "p28s4" to "p30s4 p28s4". I've tried cat and paste as shown below. Both return empty variables. What am I doing wrong?

> blah = c("p30s4","p28s4")
> blah
[1] "p30s4" "p28s4"

> foo = cat(blah)
p30s4 p28s4
> foo
NULL

> foo = paste(cat(blah))
p30s4 p28s4
> foo
character(0)

© Stack Overflow or respective owner

Related posts about r

    Related posts about list