form_to_int: From Vector To Integer

Description Usage Arguments Value Examples

View source: R/classify_form_info.R View source: R/optimize_calculation.R

Description

A function that converts a form vector e.g. 'WLD' into an integer value defined by the function default values for win / lose / draw.

Usage

1
2
3
form_to_int(oldForms, winPoints = 2, drawPoints = 1, losePoints = 0)

form_to_int(oldForms, winPoints = 2, drawPoints = 1, losePoints = 0)

Arguments

oldForms

A character string which contains either 'W', 'L', or 'D' of arbitrary length

winPoints

An integer defining the points accredited for a win.

drawPoints

Same as above for a draw.

losePoints

Same as above for a loss.

Value

An integer value defining the value of a teams form

Examples

1
 footballstats::form_to_int('WLDW')

ntyndall/footballstats documentation built on Aug. 13, 2019, 1:36 p.m.