I've looked here and here for answers, but I have not gotten what I've needed to summarize my dataframe. I think this answer is the closest to what I need.
I want to see the number of times a client has ordered in a particular month, and then how many of the unique ids occurred within the month. The "id" is the unique client id, and "date" is when the transaction occurred.
Here is what the data looks like:
Sample Data:
id date
1 3/12/2016
2 3/14/2016
3 3/11/2016
1 4/19/2016
1 4/21/2016
3 5/21/2016
2 6/7/2016
1 6/8/2016
And what I would like the result to be is:
Result:
date percent
03-2016 100%
04-2016 33%
05-2016 33%
06-2016 66%
For reference:
length(unique(df$id)) = 3
Suggestions on what I should be doing?