I have a data be like this:
Each same patient has several records at different ages. How can I just keep records of each patient that with their oldest ages in the data? Thank you!
oldest_age <- aggregate(AGE~RANDID,data=df,max)
This was the way I did, but it only kept the age and randid column.