if (FALSE) {
df <- data.frame(Place = 1,
Name = "Sally Swimfast",
Team = "KVAC",
Event = "Womens 200 Freestyle",
Finals_Time = "1:58.00",
Split_50 = "28.00",
Split_100 = "59.00",
Split_150 = "1:31.00",
Split_200 = "1:58.00")
df %>%
splits_to_lap
df <- data.frame(Place = rep(1, 2),
Name = c("Lenore Lap", "Casey Cumulative"),
Team = rep("KVAC", 2),
Event = rep("Womens 200 Freestyle", 2),
Finals_Time = rep("1:58.00", 2),
Split_50 = rep("28.00", 2),
Split_100 = c("31.00", "59.00"),
Split_150 = c("30.00", "1:29.00"),
Split_200 = c("29.00", "1:58.00")
)
# since one entry is in lap time and the other is cumulative, need to
# set threshold value
# not setting threshold will produce bad results by attempting to convert
# Lenore Lap's splits, which are already in lap format, into lap format
# again
df %>%
splits_to_lap()
df %>%
splits_to_lap(threshold = 35)
}
Run the code above in your browser using DataLab