views:

76

answers:

1

I tried using the paste command but it returns the same vector?

x = c("a","b","c")
y = paste(x)
y
[1] "a" "b" "c"
length(y)
[1] 3

I want a single character of "abc"

+7  A: 

The collapse="" options is your friend:

> x <- c("a", "b", "c")
> paste(x, collapse="")
[1] "abc"
> 

[ There is still no rstats tag here. ]

Dirk Eddelbuettel
thanks, what do u mean there is no rstats tag? i added it to my question?
tommy chheng
Yes, at look at the top right: 1477 questions tagged [r] (which is what is used around here) and 28 for [rstats]. We can add as many as we want, but only few make sense. And [r] it is here. Don't get me wrong -- you are free to use whatever tag you want. But given that [r] gets you the attention you want for your questions, why bother with the other one.
Dirk Eddelbuettel
Dirk – what´s the benefit of the rstats tag (except for the fact that "r" is harder to google / search?) Yet, that would be enough for me to use it – even tried to "invent" myself but obviously could not because of my rep ;). Is it meant to be used for all R related questions ?
ran2
There is no benefit to [rstats]. [r] is used here. If you add a new tag that few use (28 vs 1477 as per yesterday's count), you only confuse things. As for Google, that is bogus -- use e.g. rseek.org.
Dirk Eddelbuettel
google is doing a pretty amazing job of picking up R questions from stack overflow. I may see if we can get rseek.org to start searching the stack overflow [r] tagged questions as well. Seems like a good addition to rseek.org.
JD Long
Most excellent idea -- could you contact the powers that be, JD?
Dirk Eddelbuettel