0

I have two vectors for example:

  v1 <- c("a","j","d")
  v2 <- c("book","tree","river")

I would like to combine the two vectors keeping the same order:

  v3 <- c("a","book","j","tree","d","river")

I tried:

  c(v1,v2)

but the ordering is wrong

Thank you for your help.

Ronak Shah
  • 355,584
  • 18
  • 123
  • 178
adam.888
  • 7,336
  • 17
  • 63
  • 102

1 Answers1

1
v1 <- c("a","j","d")
v2 <- c("book","tree","river")
c(rbind(v1,v2))
# [1] "a"     "book"  "j"     "tree"  "d"     "river"
Stéphane Laurent
  • 59,551
  • 14
  • 99
  • 196