Title: | Calculate Scores and Marks for Track and Field Combined Events |
Version: | 0.1.1 |
Description: | Includes functions to calculate scores and marks for track and field combined events competitions. The functions are based on the scoring tables for combined events set forth by the International Association of Athletics Federation (2001). |
License: | GPL-3 |
URL: | https://katie-frank.github.io/combinedevents/, https://github.com/katie-frank/combinedevents |
BugReports: | https://github.com/katie-frank/combinedevents/issues |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.1 |
Imports: | lubridate, magrittr, rlang, stats, stringr |
Suggests: | knitr, rmarkdown, testthat, spelling, covr |
Depends: | R (≥ 2.10) |
Language: | en-US |
NeedsCompilation: | no |
Packaged: | 2021-02-03 22:05:17 UTC; katiefrank |
Author: | Katie Frank |
Maintainer: | Katie Frank <katiexfrank@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2021-02-03 22:20:02 UTC |
combinedevents: Calculate Scores and Marks for Track and Field Combined Events
Description
The package includes functions to calculate scores and marks for track and field combined events competitions. The functions are based on the scoring tables for combined events set forth by the International Association of Athletics Federation (2001).
Author(s)
Maintainer: Katie Frank katiexfrank@gmail.com
References
International Association of Athletics Federation (2001). IAAF Scoring Tables for Combined Events.
See Also
Useful links:
Report bugs at https://github.com/katie-frank/combinedevents/issues
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Combined events results
Description
combined_events()
is a generic function used to present results
of calls to scores()
and marks()
.
Usage
combined_events(marks, scores, event_names, event, seconds, ...)
Arguments
marks |
a numeric vectors of marks |
scores |
an integer vector of scores |
event_names |
a character vector of event names |
event |
a character string indicating the combined events competition |
seconds |
a numeric (either 0 or 1) |
... |
other arguments passed on to methods |
Value
An object of class "combined_events
".
The default method returns a list of that class.
See Also
Combined events null results
Description
combined_events_null()
is a generic function used to present results
of calls to scores()
and marks()
where in those calls combined_event = NULL
.
Usage
combined_events_null(marks, scores, event_names, seconds, ...)
Arguments
marks |
a numeric vector of marks |
scores |
an integer vector of scores |
event_names |
a character vector of event names |
seconds |
a numeric (either 0 or 1) |
... |
other arguments passed on to methods |
Value
An object of class combined_events_null
.
The default method returns a list of that class.
See Also
Men's decathlon performances
Description
A dataset containing the performances of 23 athletes in the men's decathlon at the 2016 Summer Olympics.
Usage
dec
Format
A data frame with 23 rows and 24 variables. The variables
`100m`
, LJ
, SP
, HJ
, `400m`
, `110mH`
,
DT
, PV
, JT
, and `1500m`
correspond to the performances
of the athletes for the ten events comprising the decathlon. Those
variables ending in _p
(e.g., `100m_p`
) represent the
points athletes earn for their performances in each of the ten events.
A full description of the 24 variables is below.
- rank
rank of athlete
- athlete
name of athlete
- nationality
nationality of athlete
- score_total
overall score
- 100m
100m result, in seconds
- 100m_p
100m points
- LJ
long jump result, in meters
- LJ_p
long jump points
- SP
shot put result, in meters
- SP_p
shot put points
- HJ
high jump result, in meters
- HJ_p
high jump points
- 400m
400m result, in seconds
- 400m_p
400m points
- 110mH
110m hurdles result, in seconds
- 110mH_p
110m hurdles points
- DT
discus throw result, in meters
- DT_p
discus throw points
- PV
pole vault result, in meters
- PV_p
pole vault points
- JT
javelin throw result, in meters
- JT_p
javelin throw points
- 1500m
1500m result, in the format mm:ss.ms
- 1500m_p
1500m points
Source
https://en.wikipedia.org/wiki/Athletics_at_the_2016_Summer_Olympics_%2D_Men%27s_decathlon
Calculate marks for track and field combined events
Description
marks()
calculates marks for track and field combined events competitions.
Usage
marks(scores, gender, combined_event = NULL, seconds = FALSE)
Arguments
scores |
a numeric vector of track and field scores |
gender |
gender of athlete; either " |
combined_event |
an optional character string indicating the
combined events competition. For
|
seconds |
a logical; if |
Details
marks()
performs the opposite action of scores()
:
you give it the scores you want to obtain, and it gives you the marks you
need to achieve those scores. For track events, marks()
returns the
slowest time needed to achieve the input score. Similarly, for jumping and
throwing events, marks()
returns the shortest distance necessary to
achieve the input score.
For some events, when a score is given to marks()
, the score returned may
be different from the one input because some scores are not actually
possible (due to rounding of track and field marks). When an impossible
score is given to marks()
, the function will return the closest higher
score that corresponds to a mark.
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 |
marks |
the vector of marks based on the input scores for the specified combined event.
If not all scores were supplied to |
scores |
the vector of scores for the specified combined event. If not all scores
were supplied to |
score_total |
if called with non-NULL |
call |
the matched call |
References
International Association of Athletics Federation (2001). IAAF Scoring Tables for Combined Events.
Examples
# Men's heptathlon
marks(scores = rep(800, 7),
gender = "male", combined_event = "heptathlon")
# Women's pentathlon
marks(scores = c(`60mH` = 981, HJ = 875, SP = 799, LJ = 956, `800m` = 1000),
"female", "pentathlon")
# Men's events
marks(scores = c(LJ = 790, LJ = 810, HJ = 850, HJ = 900, PV = 900, PV = 915),
"male")
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 " |
combined_event |
an optional character string indicating the
combined events competition. For
|
seconds |
a logical; if |
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 |
marks |
the vector of marks for the specified combined event. If not all marks were
supplied to |
scores |
the vector of scores based on the input marks for the specified combined event.
If not all marks were supplied to |
score_total |
if called with non-NULL |
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")