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
  • 377,200
  • 20
  • 156
  • 213
adam.888
  • 7,686
  • 17
  • 70
  • 105

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
  • 75,186
  • 15
  • 119
  • 225