Description Usage Arguments Details Value Examples
Pulls players latest scores from an eloTable object until specified time. If no scores exist for an individual prior to that time in the table then the initial value is returned.
1 2 | extractScores(eloTab, tObj = eloTab$datetime["end"],
players = eloTab[["players"]])
|
eloTab |
an object of the class "eloTable" from which ratings are to be extracted. |
tObj |
an element of the class "POSIXct" for which only scores occuring prior to within the eloTable will be used. |
players |
A character list of players for which scores are obtained |
Using the datetime parameter as a cieling for elo ratings this function will return the latest rating for each player in the eloTable object which has occured on or before that time. If no score has occured prior to the specified time than the initial score is returned for that player with a value of NA for the time.
A data frame containing the latest rating for each player up to the datetime parameter as well as the time which that rating was last updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # generate generic data
interactions <- data.frame (a = sample (letters [1:10], 100, T),
b = sample (letters [1:10], 100, T),
o = sample (c(-1,-1,0,1,1), 100, T),
d = Sys.time () + runif (100, 40, 160))
# convert to interData object
id1 <- intTableConv (interactions)
# produce eloTable object
et1 <- eloTable (id1)
# get latest scores
extractScores (et1)
# only scores before median
extractScores (et1, tObj = median (et1$eloTable$datetime, na.rm = T))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.