title: Select vector element based on condition in R
body: <pre><code>info &lt;- c(&quot;1.8 Unspecified Hybrid&quot;, &quot;Hatchback&quot;, &quot;Automatic&quot;, &quot;Grey&quot;, &quot;40,186 km&quot;, &quot;2019 (191)&quot;, &quot;1 owner&quot;, &quot;4 doors&quot;, &quot;5 seats&quot;, &quot;2023 March&quot;)
  </code></pre>
  <p>I have a vector as above. I want to select the element that contains &quot;km&quot; to retrn the character 40,186 km</p>
  <p>How would I go about doing this?</p>
  <p>Thanks</p>