I have a dataframe that includes a column 'names' with multiple instances of a given name, against which another column, 'time' has various times. I'm trying to convert this raw data into another dataframe that lists only unique values for the names, and gives minimum and maximum values for times in separate columns, as well as a count of instances of each name from the original dataframe. I want the final dataframe to be sorted by min.time, smallest to largest.
For example:
So far I have got the unique list of names and the count of each to work, but I can't figure out how to find the minimum and maximum time value for each unique name. Any suggestions would be much appreciated.