Learn R Programming

StatsBombR (version 0.1.0)

getpositioncategory: This function returns the players' id and 1 of 6 position categories based on when they play in each most often.

Description

For use with the all StatsBomb data. After StatsBomb data is read in from the JSON file, this function will return a dataframe of all of the player ids and their position category.

Usage

get.positioncategory(events)

Arguments

events

Dataframe of event object gathered from the StatsBomb API, need the position.name and the player ids for all events.

Value

df

Returns a data frame with all of the player ids and position categories.

References

See Also

Examples

Run this code
# NOT RUN {
events <- StatsBombFreeEvents()
positions <- get.positioncategory(events)
# }

Run the code above in your browser using DataLab