vendredi 13 juillet 2018

Finding max of column by group with condition

I have a data frame like this:

enter image description here

for each gill, I would like to find the maximum time for which the Diameter is different from 0. I have tried to use the function aggregate and the dplyr package but this did not work. A combinaison of for, if and aggregate would probably work but I did not find how to do it.

I'm not sure of the best way to approach this. I'd appreciate any help.

Aucun commentaire:

Enregistrer un commentaire