elo (version 2.1.1)

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

Description

as.matrix converts an Elo object into a matrix of running Elos.

Usage

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

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

# 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, ...)

Arguments

x

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

...

Other arguments (Not in use at this time).

group

A grouping vector, telling which rows to output in the matrix.

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).

Value

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

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
# NOT RUN {
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 DataCamp Workspace