R: how can I concatenate a list?
- by John
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)