Learn R Programming

elo (version 3.0.2)

elo.run.helpers: Helper functions for elo.run

Description

as.matrix converts an Elo object into a matrix of running Elos. These are the Elos at the time of grouping, but before any regression takes place.

Usage

# S3 method for elo.run
as.matrix(x, ...)

# S3 method for elo.run.regressed as.matrix(x, ...)

# S3 method for elo.run as.data.frame(x, ...)

final.elos(x, ...)

# S3 method for elo.run final.elos(x, ...)

# S3 method for elo.run.regressed final.elos(x, regressed = FALSE, ...)

Value

A matrix, a data.frame, or a named vector.

Arguments

x

An object of class "elo.run" or class "elo.run.regressed".

...

Other arguments (Not in use at this time).

regressed

Logical, denoting whether to use the post-regressed (TRUE) or pre-regressed (FALSE) final Elos. Note that TRUE only makes sense when the final Elos were regressed one last time (i.e., if the last element of the regress()) vector yields TRUE).

Details

as.data.frame converts the "elos" component of an object from elo.run into a data.frame.

final.elos is a generic function to extract the last Elo per team.

See Also

elo.run

Examples

Run this code
e <- elo.run(score(points.Home, points.Visitor) ~ team.Home + team.Visitor + group(week),
             data = tournament, k = 20)
head(as.matrix(e))
str(as.data.frame(e))
final.elos(e)

Run the code above in your browser using DataLab