Learn R Programming

BAwiR (version 1.4.2)

get_sticker: Player's sticker

Description

This function creates players' cards (a kind of sticker) that bring together three of the concepts considered most important in basketball analytics. These are team efficiency (how many points the team scores and receives per possession), the player's shooting context (from where and with what percentage they shoot) and the player's use of possessions (how they end the possessions they execute).

Usage

get_sticker(data_team_eff, data_team, player_sel, language = "English",
            change_hjust_perc = FALSE, size_head = c(0.4, 0.3, 5.6, 3.5), 
            size_eff = 2, size_cont_us = c(2.3, 1.7), size_plot_tit = 8)

Value

A plot.

Arguments

data_team_eff

Data frame with the efficiency statistics.

data_team

Data frame with the context and usage statistics.

player_sel

Player of interest.

language

Language of the titles. Valid options are 'English' and 'Spanish' so far.

change_hjust_perc

Logical to change the position of the win percentage sentence.

size_head

Vector with the sizes of headers text.

size_eff

Number with the size of the efficiency text.

size_cont_us

Vector with the sizes of context and usage text.

size_plot_tit

Number with the size of the plot titles.

Author

Guillermo Vinue

Examples

Run this code
if (FALSE) {
# The efficiency data frame must have this type of structure:
data_team_eff <- data.frame(team = "Real Madrid", 
                            win_perc = "83.3% (5/6)",
                            pts_poss = 1.14,
                            pts_poss_opp = 1.04)

get_sticker(data_team_eff, acb_sticker_data_2526, "A. Abalde", language = "English")
get_sticker(data_team_eff, acb_sticker_data_2526, "A. Abalde", language = "Spanish", TRUE)
}

Run the code above in your browser using DataLab