i have a data frame that contains lap times of the same race for the last 10 years (1 race a year from 2007 to 2017) i am trying to extract the fastest time of each race from each year. i thought that using min()
would do the trick but it does not as it finds the smallest values within all the lap times from all the years. here is the code:
FL2007 = subset(AusLapTimes, AusLapTimes$Time.Seconds == min(AusLapTimes$Time.Seconds) & AusLapTimes$year == 2007)
2007 happens to be the year where the fastest lap of all time within the range occured so i do get data within the FL2007 DF but when i ran this:
FL2008 = subset(AusLapTimes, AusLapTimes$Time.Seconds == min(AusLapTimes$Time.Seconds) & AusLapTimes$year == 2008)
FL2009 = subset(AusLapTimes, AusLapTimes$Time.Seconds == min(AusLapTimes$Time.Seconds) & AusLapTimes$year == 2009)
the 2 extra DFs get created but with no values to display as the fasest ever lap was in 2007.
help please!