if (FALSE) {
df <- data.frame(Place = rep(1, 2),
Name = c("Lenore Lap", "Casey Cumulative"),
Team = rep("KVAC", 2),
Event = rep("Womens 200 Freestyle", 2),
Finals = 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
# Casey Cumulative's splits, which are already in cumulative
# format, into cumulative format again
df %>%
splits_to_cumulative()
df %>%
splits_to_cumulative(threshold = 20)
}
Run the code above in your browser using DataLab