I have a dataframe with three columns: Batch, Trial, Time.
Five Trials (0-4) are ran for each Batch number.
I want to pull out the row with the smallest time from each Batch and put them into a new dataframe.
I'm not sure where to start.
I have a dataframe with three columns: Batch, Trial, Time.
Five Trials (0-4) are ran for each Batch number.
I want to pull out the row with the smallest time from each Batch and put them into a new dataframe.
I'm not sure where to start.
Assuming the dataframe as df.
Try
df.new <- df[ df$Time == ave(df$Time, df$Batch, FUN=min), ])