title: How to group the data frame in R so that resulting table counts the occurrence of positive and negative value of a column
body: <p>I am using this data set (<a href="https://drive.google.com/file/d/1TwfoLzl-dGhSirmmZhb6EJSFw2PLsHAi/view?usp=sharing" rel="nofollow noreferrer">csv file</a>). It is stored in R as a data frame <code>imf.inflation</code>. Now, my grouping command is:</p>
  <pre><code>imf.inflation %&gt;% group_by(country_iso_code) %&gt;% summarise(num_yrs=n())
  </code></pre>
  <p>And produces this table:</p>
  <pre><code># A tibble: 194 x 2
     country_iso_code num_yrs
     &lt;chr&gt;              &lt;int&gt;
   1 ABW                   25
   2 AFG                   18
   3 AGO                   41
   4 ALB                   31
   5 ARE                   41
   6 ARG                   20
   7 ARM                   28
   8 ATG                   41
   9 AUS                   41
  10 AUT                   41
  # ... with 184 more rows
  </code></pre>
  <p>I'd like to extend this grouping command so that the resulting table has additional two columns: (1) one for the count of the occurrence of <strong>positive</strong> numbers in the {value} column, (2) another for the count of the occurrence of <strong>negative</strong> numbers. Thanks!</p>