
<h2><code>str_which()</code>: Find positions matching a pattern</h2>
<p>Now you want to identify the positions of the words in a vector of
fruit names that contain an “a”.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="co"># base</span></span>
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a><span class="fu">grep</span>(<span class="at">pattern =</span> <span class="st">&quot;a&quot;</span>, <