Skylar Saveland
Skylar Saveland

Reputation: 11464

R - Concatenate integer arrays

How can I join 1:3 and 7:8 to 1 2 3 7 8?

Where is a good resource to pick up peculiars like this?

Upvotes: 4

Views: 16064

Answers (2)

user1613119
user1613119

Reputation: 235

You could do this as well:

 v<-c(1:3)
 v<-c(v, 7:8)

Upvotes: 0

Chase
Chase

Reputation: 69201

c(1:3, 7:8)
[1] 1 2 3 7 8

The help page indicates this is a generic function which combines its arguments.

Upvotes: 10

Related Questions