title: Get index of a specific element in vector using %>% operator
body: <p>I want the index of an element in a vector x</p>
  
  <pre><code>x &lt;- c("apple", "banana", "peach", "cherry")
  </code></pre>
  
  <p>With base R i would do that</p>
  
  <pre><code>which(x == "peach")
  </code></pre>
  
  <p>But as my x is at the end of a pipe I would like to get the index the magrittr way.</p>
  
  <pre><code>x %&gt;% getIndex("peach")
  </code></pre>
  
  <p>My desired output is 3.</p>