Learn R Programming

PlayerRatings (version 1.1-0)

hist.rating: Histogram Plotting for a Rating Object

Description

Plot histograms of estimated ratings or other features, including full history progressions.

Usage

# S3 method for rating
hist(x, which = "Rating", tng=15, history = FALSE, log = FALSE, 
  xlab = which, main = paste(x$type," Ratings System"), density = FALSE, 
  add = FALSE, …)

Arguments

x

An object of class "rating".

which

The variable to be plotted.

tng

A single value. If the number of games played by the player is below this value, the player is not depicted on the plot.

history

If TRUE, a histogram is plotted for every single time point. Only available if the history was retained in x.

log

The log(x+1) transform. May be useful if plotting e.g. the number of games.

xlab,main

Graphical parameters.

density

If TRUE, plot a density estimate rather than a histogram.

add

Add to an existing plot? Only relevant for density estimates.

Other parameters to be passed through to plotting functions.

See Also

plot.rating

Examples

Run this code
# NOT RUN {
afl <- aflodds[,c(2,3,4,7)]
robj <- steph(afl)
hist(robj, xlim = c(1900,2500), density=TRUE)

afl <- aflodds[,c(2,3,4,7)]
robj <- steph(afl, history=TRUE)
hist(robj, history=TRUE, xlim = c(1900,2500), density=TRUE)

robj <- elom(riichi)
hist(robj, xlim = c(1100,1900))

robj <- elom(riichi, history=TRUE)
hist(robj, history=TRUE, xlim = c(1100,1900))
# }

Run the code above in your browser using DataLab