Using regex to extract email address after @ in dplyr pipe and then groupby to count occurrences
<p>I have dataframe which has column called email. I want to find email addresses after @ symbol and then group by e.g (gmail,yahoo,hotmail) and count the occurrences of the same. </p>

<pre><code> registrant_email 
 chamukan@yahoo.com     
 tmrsons1974@yahoo.com     
 123ajumohan@gmail.com     
 123@websiterecovery.org     
 salesdesk@2techbrothers.com       
 salesdesk@2techbrothers.com   
</code></pre>

<p>Now I can extract emails after @ using below code</p>

<pre><code>sub(".*@", "", df$registrant_email)
</code></pre>

<p>How can I use it in dplyr pipe and then count occurrences of each email address</p>