Filter data based on lowest value

First of all, don't post screenshots of your data. Provide reproducible examples. It makes it easier for people to answer your question:

Here is an example of what you are after using the iris dataset. You can adapt it to your problem.

library(dplyr)
iris %>% 
  group_by(Species) %>% 
  arrange(Petal.Length) %>% 
  slice(1)

For you, group by the PatientID, then arrange by the date or exam count.

1 Like