title: For values in list above a number set boolean (true, false) in R
body: <p>Suppose, I have a list </p>
  
  <pre><code>a &lt;- c(3, 5, 2, 7, 9)
  </code></pre>
  
  <p>and I want to do a vector operation, something like: </p>
  
  <p><code>a_greater_than_five &lt;- a[a&gt;5]</code></p>
  
  <p>but I want results something like below:</p>
  
  <pre><code>a_greater_than_five &lt;- c(false, false, false, true, true).
  </code></pre>
  
  <p>Something similar to numpy in python: <a href="https://stackoverflow.com/q/20229822/2783516">Check if all values in list are greater than a certain number</a></p>