Calculating xT for passes, carries, etc
Usage
calculate_threat(data, type = "opta")
Arguments
- data
The dataframe that stores your data. Must contain starting x,y locations and ending x,y locations: x
, y
, finalX
, finalY
- type
indicator for what type of data the data. Currently, options include "opta" (default) and "statsbomb"
Value
returns a dataframe object
Examples
if (FALSE) {
endResult <- calculate_threat(test, type = "statsbomb")
endResult
}