I have researched "batch variables" but I'm still not fully comfortable with their use yet.
I have a data frame with a column filled with different phone numbers. For example:
111-111-1111
111-111-1111
222-222-2222
222-222-2222
222-222-2222
222-222-2222
333-333-3333
333-333-3333
333-333-3333
And another column that shows the date that the calls were made, respectively. For example:
09/01/15
09/02/15
09/03/15
09/04/15
09/05/15
09/06/15
09/07/15
09/08/15
09/09/15
I would like to get a view of how many days there are between calls per mobile device phone number. Of course, this example is very simple. However, I have a data set with 27,000 entries. I need help with creating batch variables and loops (if necessary).
I am using the "lubridate" packages for the date reading and the "plyr" package for the count function which is of interest to me so I can get a view on how many times this calls repeat.
Goal: Find the average time (days) between Call 1 and Call 2, between Call 2 and Call 3, between Call i and Call i+1.
I am a very new R user. I have searched extensively for a solution to this type of problem. Thank you to anyone willing to help.