Learn R Programming

BAwiR (version 1.4.2)

get_donut_usage_action: Donut chart usage possessions action

Description

This function creates a donut chart that displays the percentage of possessions that each player of a team ends with a particular action (turnover, field goal attempted or free throw attempted) while being on the court.

Usage

get_donut_usage_action(data_usage_act, team_sel, type_play, 
                       language, min_poss, min_perc, size_orl,
                       vjust_title = 1)

Value

A donut chart.

Arguments

data_usage_act

Data frame with the number of possessions that each player ended and the particular action used.

team_sel

String with the team's full name.

type_play

Play type. Options are 'one' for free throws, 'two' for two-point field goals and 'three' for three-point field goals and 'tov' for turnovers.

language

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

min_poss

Minimum number of possessions played.

min_perc

Minimum percentage achieved.

size_orl

Size of the outer ring labels.

vjust_title

Adjust the title vertically when representing turnovers.

Author

Guillermo Vinue with the help of ChatGPT.

Details

Donut charts are an alternative for pie charts, which have a hole in the middle, making them cleaner to read than pie charts.

See Also

get_donut_usage

Examples

Run this code
if (FALSE) {
get_donut_usage_action(acb_usage_act_data_2526, "Valencia Basket", "two", "English", 1, 1, 3)
# For example, the interpretation here is that Sako finishes the 66.67% of his possessions
# scoring a two-point shot.

get_donut_usage_action(acb_usage_act_data_2526, "Valencia Basket", "tov", "English", 1, 1, 5)
}

Run the code above in your browser using DataLab