I have a dataframe that looks like this:
Arrival_DateTime = c("2009-01-01 08:35:00", "2009-01-01 10:00:00", "2009-01-01 10:25:00",
"2009-01-02 07:45:00", "2009-01-02 15:32:00", "2009-01-02 11:15:00",
"2009-01-02 12:35:00")
Cust_ID = c("1214", "2643", "31231", "41244", "1214", "15317", "51591")
Wait_Time_Mins = c("54","43","88","94","12","130", "170")
df_have = data.frame(Arrival_DateTime, Cust_ID, Wait_Time_Mins)
and want to convert it so I get the number of customer visits per day, and also their average wait time per day, so it looks something like this:
dates = c("2009-01-01", "2009-01-02")
num_visits = c("3", "4")
avg_wait_time = c("61.7","101.5")
df_want = data.frame(dates, num_visits, avg_wait_time)
How would I go about doing this?
Similarly, is there a way to do monthly aggregations as well?