swim_place {SwimmeR} | R Documentation |
Add places to swimming results
Description
Places are awarded on the basis of time, with fastest (lowest) time winning. Ties are placed as ties (both athletes get 2nd etc.)
Usage
swim_place(
df,
time_col = Finals,
max_place = NULL,
event_type = "ind",
max_relays_per_team = 1,
keep_nonscoring = TRUE,
verbose = TRUE
)
Arguments
df |
a data frame with results from |
time_col |
the name of a column in |
max_place |
highest place value that scores |
event_type |
either |
max_relays_per_team |
an integer value denoting the number of relays a team may score (usually 1) |
keep_nonscoring |
are athletes in places greater than |
verbose |
should warning messages be posted. Default is |
Value
a data frame modified so that places have been appended based on swimming time
See Also
swim_place
is a helper function used inside of
results_score
Examples
df <- data.frame(Place = c(1, 1, 1),
Name = c("Sally Swimfast", "Bonnie Bubbles", "Kylie Kicker"),
Team = c("KVAC", "UBAM", "MERC"),
Event = rep("Women 200 Freestyle", 3),
Prelims = c("2:00.00", "1:59.99", "2:01.50"),
Finals = c("1:58.00", "1:59.50", "2:00.50"),
Meet = c("Summer 2021", "Fall 2020", "Champs 2020"))
df %>%
swim_place()
df %>%
swim_place(time_col = Prelims)
df %>%
swim_place(time_col = "Prelims")