I'm working wither temperature and snow melt. I have some issues with removing specific ID values by e specific date. Here is a part of my Date. Frame:
I have calculated the onset of snowmelt and need to remove all dates before the first date of snowmelt at each location. The mean onset of snowmelt in the three locations is Top - 07.05.2021, Middle- 14.05.2021, and Bottom - 21.05.21
After some R-codes I would like to get this DataFrame:
I did running this R-code:
df1 <- climate_2021 %>% group_by(Location) %>%filter(Date >= "2021.05.21" & Location == "Bottom" | Date >= "2021.05.14" & Location == "Middle" | Date >= "2021.05.07" & Location == "Top")
Then I get, an error in the date, comparison (<=) is possible only for atomic and list types.
What can I do to figure this out?