Calculating New and Returning Customers in R

Hamza Rafiq
Towards Data Science
4 min readMay 22, 2019

--

I recently came across an issue in which I wanted to calculate new and returning customers. So, I naturally googled about it and was surprised to see that I could not find any solutions on it in R. This has generally been the issue with most blogs/tutorials on R, that they are not very business orientated.

Since I couldn't find a solution online, I started working on it myself. I was able to figure the solution out pretty quickly in Excel and Power BI using DAX and Power Pivot but I wanted to do it in R. Actually, I am a bit embarrassed to admit that…

--

--