I have a data.frame with some prices per day. I would like to get the average daily price in another column (avg_price). How can I do that ?
                   date   price   avg_price
1   2017-01-01 01:00:00   10      18.75
2   2017-01-01 01:00:00   10      18.75
3   2017-01-01 05:00:00   25      18.75
4   2017-01-01 04:00:00   30      18.75
5   2017-01-02 08:00:00   10      20
6   2017-01-02 08:00:00   30      20
7   2017-01-02 07:00:00   20      20