Description Usage Arguments Details Examples
Using the player elo ratings of an "eloTable" object, plots a time series graph showing changes in individuals scores. Specified players must have at least one score in the specified time range.
1 2 3 4 5 6 7 | ## S3 method for class 'eloTable'
plot(eloTab, start.time = eloTab[[2]][1],
end.time = eloTab[[2]][2], players = eloTab[[1]],
col = 1:length(eloTab[[1]]), xlab = "Time", ylab = "Rating",
main = "Elo Rating Across Time", xlim = range(wEloTab$datetime),
ylim = range(wEloTab$score), lty = 1, lwd = 1, legend = T,
legend.pos = "topleft", bty = "o", ...)
|
eloTab |
object of the class "eloTable" to build a plot with. |
start.time |
object of the class "POSIXct" for whcih only scores occuring after this time are graphed. |
end.time |
object of the class "POSIXct" for whcih only scores occuring before this time are graphed. |
players |
character indicating the players in eloTab to graph. |
col |
vector of length equal to the players argument that correspond to the colors to be used in the visualization for each player. |
xlab |
a label for the x axis, defaults to "Time". |
ylab |
a label for the y axis, defaults to "Rating". |
main |
a main title for the plot. |
xlim |
the x limits (x1, x2) of the plot. Note that x1 > x2 is allowed and leads to a 'reversed axis'. |
ylim |
the y limits of the plot. |
lty,lwd |
the line types and widths for lines appearing in the legend. |
legend |
logical indicating wether to include legend. |
legend.pos |
the position of the legend on the graph |
bty |
the type of box to be drawn around the legend. The allowed values are "o" (the default) and "n". |
... |
additional parameters to be passed to the base plot function. |
Plotting an eloTable object builds a time series line graph for each player across the range of dates in the eloTable. The players and dates used may be adjusted as well as the colors to be used. Additional paramters may be used to pass arguments to the plot.xy, lines and legend functions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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)
# plot all scores
plot (et1)
# plot only three players
plot (et1, players = et1$players [1:3], lty = 3, lwd = 5)
# plot only scores before median
plot (et1, end.time = median (et1$eloTable$datetime, na.rm = T), lty = 6,
main = 'Elo Rating up to Median Date', legend.pos = "bottomleft")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.