How to execute a character vector in R?

I tried using the paste command, but does it return the same vector?

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

I need one character "abc"

+3
source share
1 answer

Parameters collapse=""are your friend:

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

[There is still no tag rstats. ]

+7
source

Source: https://habr.com/ru/post/1754515/


All Articles