Location in a vector of a certain value, applying the mentioned location to extract the value from another vector

Viewed 164

I have a vector

   a <- seq(from =1, to = 25, by = 2)
   [1]  1  3  5  7  9 11 13 15 17 19 21 23 25

and I would like to extract the location number (coordinates) that coincides with the value/s of 11 that occur in the vector, what do I have to do? match points out where it is in the vector but does not provide the coordinates

   match(a, 11)
   [1] NA NA NA NA NA  1 NA NA NA NA NA NA NA

In addition I would like using the coordinates extracted from the prior example to extract the value from another vector (similar coordinates).

2 Answers
Related