title: Error in for loop in r
body: <p>I am working with a data frame called bumpus. When I try to select only certain rows using <code>for</code> and <code>if</code> statements I get an error: </p>
  
  <pre><code>Error: unexpected '{' in "for(i in 1:(nrow(bumpus)){" 
  </code></pre>
  
  <p>Could you please help me to figure out what is it that I am missing? Here is my for loop:</p>
  
  <pre><code>for(i in 1:(nrow(bumpus)) {
      if(bumpus[i,2]=="m")
      {
      bumpus_males&lt;-bumpus[i,]
      }
  }
  </code></pre>