Description Usage Arguments Details Value Author(s) Examples
extract Elo ratings from elo object
1 2 3 4 5 6 7 8 | extract_elo(
eloobject,
extractdate = eloobject$misc["maxDate"],
standardize = FALSE,
IDs = NULL,
NA.interpolate = FALSE,
daterange = 1
)
|
eloobject |
result from |
extractdate |
character, date on which Elo ratings should be obtained, defaults to the last day in the data set |
standardize |
logical, should the returned ratings be scaled between 0 and 1. Default is |
IDs |
character, specify IDs for which ratings are returned. By default, returns all that were present on the date or at least on one day of the date range |
NA.interpolate |
if |
daterange |
if averaged ratings are desired, supply here the number of days from |
extractdate
can be also a vector of dates. In this case, the IDs
argument has to be either a vector of length 1 (i.e. a single individual) or a vector of the same length as extractdate
. In the first case, the ratings for the same individual are returned on the dates specified in extractdate
. In the second case, dates and IDs are matched, i.e. the rating of the individual on that date is returned in the same order as the dates/IDs vectors.
named (IDs) vector of (average) Elo ratings, or an unnamed vector of ratings (if length of extracte
is larger than 1)
Christof Neumann
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | data(adv)
SEQ <- elo.seq(winner=adv$winner, loser=adv$loser, Date=adv$Date)
extract_elo(SEQ, "2010-01-30")
extract_elo(SEQ, "2010-01-30", standardize=TRUE)
# same ratings (regardless of NA.interpolate),
# since "g" was observed on both days
extract_elo(SEQ, "2010-01-29", IDs="g")
extract_elo(SEQ, "2010-01-29", IDs="g", NA.interpolate=TRUE)
extract_elo(SEQ, "2010-01-31", IDs="g")
extract_elo(SEQ, "2010-01-31", IDs="g", NA.interpolate=TRUE)
# different ratings (depending on NA.interpolate),
# since "g" was not observed that day
extract_elo(SEQ, "2010-01-30", IDs="g")
extract_elo(SEQ, "2010-01-30", IDs="g", NA.interpolate=TRUE)
extract_elo(SEQ, "2010-01-10", daterange=5)
extract_elo(SEQ, "2010-01-10", daterange=5, NA.interpolate=TRUE)
# and for multiple dates and a single IDs
dates <- sample(adv$Date, size = 10, replace = TRUE)
ids <- "b"
extract_elo(eloobject = SEQ, extractdate = dates, standardize = FALSE, IDs = ids)
# and for multiple dates and IDs
dates <- sample(adv$Date, size = 10, replace = TRUE)
ids <- sample(colnames(advpres)[2:8], size = 10, replace = TRUE)
extract_elo(eloobject = SEQ, extractdate = dates, standardize = FALSE, IDs = ids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.