title: how to realize countifs function (excel) in R
body: <p>I have a dataset containing 100000 rows of data. I tried to do some <code>countif</code> operations in Excel, but it was prohibitively slow. So I am wondering if this kind of operation can be done in R? Basically, I want to do a count based on multiple conditions. For example, I can count on both occupation and sex</p>
  
  <pre><code>row sex occupation
    1   M    Student
    2   F    Analyst
    2   M    Analyst
  </code></pre>