detect</span>(fruit, <span class="at">pattern =</span> <span class="st">&quot;a&quot;</span>)</span>
<span id="cb2-9"><a href="#cb2-9" tabindex="-1"></a><span class="co">#&gt; [1] TRUE TRUE TRUE TRUE</span></span></code></pre></div>
<p>In base you would use <code>grepl()</code> (see the “l” and think
logical) while in stringr you use <code>str_detect()</code> (see the
verb “detect” and think of a yes/no action).</p>
</div>
<div id="str_which-find-positions-matching-a-pattern" class="section level2">