'Collapsing Rows of a Data Frame Based on Date in R [duplicate]
I have a data frame that has multiple elevations for each date, like the one below. It has over 500,000 entries, so I'd like to collapse the rows into one row for each date and replace the elevation with the mean elevation for that date. How can I do this in R? Thanks for any help!
| Date | Elevation |
|---|---|
| 2007-10-01 | 773.64 |
| 2007-10-01 | 773.66 |
| 2007-10-01 | 773.68 |
| 2007-10-02 | 774.24 |
| 2007-10-02 | 774.25 |
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
