title: Counting Based on 3 Conditions
body: <p>I have a dataset and would like to count 3 separate conditions</p>
  
  <ol>
  <li>Number of Rows with "0s" in both columns <code>coins</code> and <code>copay</code> - counting N/A in either column as a 0</li>
  <li>Number of Rows where <code>coins.copay</code> column = 1, but excludes values that satisfy condition 1</li>
  <li>Number of Rows where <code>coins.copay</code> column = 0, but excludes values that satisfy condition 1</li>
  </ol>
  
  <p>Here's a sample from the much larger dataset:</p>
  
  <pre><code>Plan   Year   Coins   Copay   Type   Coins.Copay
   A     2018     0      NA      HMO        1
   B     2018    10      NA      HMO        1
   C     2017    NA       0      SNP        0
   D     2015    20      20      SNP        0
   E     2016    20       0      HMO        1
   F     2018    10      10      HMO        0
   G     2016    NA      NA      HMO        0
   H     2014    NA      NA      HMO        0
   I     2012    NA      10      PPO        0
   J     2011     0       0      HMO        0
   K     2014     5      10      SNP        0
   L     2013    10      NA      HMO        1
  </code></pre>
  
  <p>Thus, I would like to have the following counts (based on conditions above):</p>
  
  <ol>
  <li>5 (Plans A, C, G, H, J satisfy the condition)</li>
  <li>3 (Plans B, E, L satisfy the condition; Plan A not counted as it satisfied condition 1)</li>
  <li>4 (Plans D, F, I, K satisfy the condition; Plans C, G, H, J not counted as they satisfied condition 1)</li>
  </ol>