Packages I'm working with:
- dplyr
- lubridate
Starting data set I'm working with:
Employee_ID Start_Date End_Date
1 2/1/2013 12/31/9999
2 5/14/2013 10/5/2017
3 9/7/2014 8/30/2017
Data set I'm looking to create from the starting data set:
Date Active_Employee_Count
12/31/2013 2
12/31/2014 3
12/31/2015 3
12/31/2016 3
12/31/2017 1
Explanation
I'd like to be able to get the counts of active employees on December 31st of each year. I'm using the dplyr and lubridate packages to try to do this, but I'm struggling. I know of the filter, group_by, summarise, mutate, and distinct functions, but I'm not sure these are sufficient to do this task. The main challenge I'm facing is how do I somehow work into the process these December 31st dates? Do I need to create some sort of array of dates (12/31/2013, 12/31/2014, etc) and then somehow use that to do this?