I have a large dataset of claims data. I would like to filter out multiple claims from the same claimant (i.e. ExternalLeaveId1
) based on the maximum MaxApprovedDate
and the minimum MinApprovedDate
.
For example, in excel I have the following:
ExternalLeaveId1 WorkTypeDescription MinApprovedDate MaxApprovedDate
112 Continuous 9/10/2017 9/18/2017
112 Continuous 8/30/2017 10/10/2017
112 Continuous 10/1/2017 10/2/2017
112 Continuous 8/30/2017 10/9/2017
I would like to filter an only show the second row which has the min approved date and max approved date:
ExternalLeaveId1 WorkTypeDescription MinApprovedDate MaxApprovedDate
112 Continuous 8/30/2017 10/10/2017
Is there any way to do this in R?