title: Plot only TRUE values from a logical vector in R
body: <p>I have a vector of logical values:</p>
  
  <pre><code>whatever &lt;- c(TRUE, FALSE, FALSE, TRUE, TRUE)
  </code></pre>
  
  <p>When I plot that vector, R draws a symbol at <code>y = 1</code> for all the <code>TRUE</code> values and at <code>y = 0</code> for all the <code>FALSE</code> values:</p>
  
  <pre><code>plot(whatever)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/woHkQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/woHkQ.png" alt="enter image description here"></a></p>
  
  <p>What I want is a symbol for only the <code>TRUE</code> values at <code>y = 4</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/T13JM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T13JM.png" alt="enter image description here"></a></p>
  
  <p><em>I'm looking for a solution in base R.</em></p>