Reputation: 721
I want to pick elements from a vector and exclude 3 values by what position they got.
I know about the x[-n] function to exclude a single value but I don´t know how to exclude more than one.
Upvotes: 2
Views: 5560
Reputation: 81693
You could use the c
function to combine the values into a vector:
a <- 1:10
a[-c(1,2,3)]
[1] 4 5 6 7 8 9 10
Upvotes: 10