0

I have vector A = c('a', 'b', 'c', 'd', 'e'), and I want to glue all of these. Like, 'abcde'.

 paste(A)

Didn't work.

 cat(A)

worked, but cat is not a vector making function, rather just for printing. I mean, I can't use cat() like

 A<-cat(A)

this way. Neither

 A<- as.factor(cat(A))

What should I do?

halfer
  • 19,824
  • 17
  • 99
  • 186
서영빈
  • 106
  • 6

1 Answers1

1

Simply:

> paste(A, collapse = "")
[1] "abcde"
dc37
  • 15,840
  • 4
  • 15
  • 32