I have a tibble containing small mammal trapping effort data that has some errors and I want to remove those records from analysis. I can identify those errors by using either arrange_by() or group_by() for my "trap_id" column. When I arrange that way it is clear to see that the "status" column sometimes has two records in a row that state the trap was "closed" for two calendar days in a row, which is not possible. I want to conditionally filter the data so that for any cases where there are repeating values of "closed" in the "status" column the first record in the repeating series is removed.
How would I do this?
Thanks