My dataframe currently looks like this:
Tree Cookie Age
C1T1 A 10
C1T1 A 20
C1T1 A 30
C1T1 B 15
C1T1 B 20
C1T1 B 25
C1T2 A 12
C1T2 A 20
C1T2 B 5
C1T2 B 13
So for each "Tree" I have several "Cookies", and for each cookie I have different ages (basically representing different parts of the tree's life). I would like to add another column that bins each tree by its max age - the oldest age of the oldest cookie, in this case it would be the last age of cookie A in both trees (so will classify a tree as "young" if the max age is < 40, "mid-age" if max age is > 40 and < 120, and "old" if max age is > 120). Any advice on this is greatly appreciated!