I\'m trying to calculate the minimum values of a numeric column for each level of a factor, while keeping values of another factor in the resulting data frame.
Well, a few minutes more searching would have gotten me there... this answer seems to do the trick:
merge(dat, aggregate(value ~ code, dat, min))