scores {combinedevents}R Documentation

Calculate scores for track and field combined events

Description

scores() calculates scores for track and field combined events competitions.

Usage

scores(marks, gender, combined_event = NULL, seconds = FALSE)

Arguments

marks

a numeric or character vector of track and field marks/performances

gender

gender of athlete; either "male" or "female"

combined_event

an optional character string indicating the combined events competition. For gender = "male", the options are "decathlon"/"outdoor decathlon", "outdoor pentathlon", "heptathlon"/"indoor heptathlon", and "indoor pentathlon". For gender = "female", the options are "heptathlon"/"outdoor heptathlon", "decathlon"/"outdoor decathlon", and "pentathlon"/"indoor pentathlon". If combined_event = NULL, the elements of marks must be named.

  • For gender = "male", the allowed names for the elements of marks are `100m`, LJ, SP, HJ, `400m`, `110mH`, DT, PV, JT, `1500m`, `200m`, `60m`, `60mH`, and `1000m`.

  • For gender = "female", the allowed names are `100m`, LJ, SP, HJ, `400m`, `100mH`, DT, PV, JT, `1500m`, `200m`, `60mH`, and `800m`.

seconds

a logical; if TRUE, will return all track event marks in seconds

Value

A list of class "combined_events" (or "combined_events_null" if combined_event = NULL) with the following fields:

results

if called with non-NULL combined_event, a data frame with columns for the specified combined event containing the names of those events, mark for the input marks/performances, and score for the resulting scores based on those marks. The last row of the data frame gives the total score for the specified combined events competition. If combined_event = NULL, a data frame with columns event, mark, and score.

marks

the vector of marks for the specified combined event. If not all marks were supplied to scores(), then there will be NA values for those events with missing marks. If combined_event = NULL, the vector of marks.

scores

the vector of scores based on the input marks for the specified combined event. If not all marks were supplied to scores(), then there will be scores with NA values for those events with missing marks. If combined_event = NULL, the vector of scores.

score_total

if called with non-NULL combined_event, an integer representing the overall score for the specified combined events competition

call

the matched call

References

International Association of Athletics Federation (2001). IAAF Scoring Tables for Combined Events.

Examples

# Men's decathlon
scores(marks = c(`100m` = 11.61, LJ = 7.32, SP = 13.17, HJ = 1.9,
                 `400m` = 49.96, `110mH` = 15.32, DT = 38.18, PV = 4.6,
                 JT = 58.98, `1500m` = "4:39.34"),
       gender = "male", combined_event = "decathlon")

# Women's heptathlon
scores(c(14.11, 1.95, 13.96, 25.61, 6.44, 45.98, "2:07.26"),
       "female", "heptathlon")

# Men's events
scores(c(`60m` = 7.09, LJ = 7, LJ = 7.03, SP = 11.8, HJ = 2,
         `60mH` = 8.30, `60mH` = 9.31, PV = 4.30, `1000m` = "2:40.00"),
       gender = "male")

[Package combinedevents version 0.1.1 Index]