player_pizza_chart {PlayerChart}R Documentation

Create a pizza chart for sports player.

Description

Create a pizza chart for sports player.

Usage

player_pizza_chart(data, player_stats_col, name_col, player_name)

Arguments

data

an input dataframe containing the player data.

player_stats_col

a vector specifying the names of the columns from the dataframe that will be used to create slices in the pizza chart. Stats must be between 0 to 100.

name_col

specifies the name of the column in the dataframe that contains the player names.

player_name

specifies the name of the player (or the value of 'name_col' parameter) whose statistics will be visualized in the chart.

Value

an interactive pizza chart for a player.

Examples


# Create a generic dataframe for the example
player_data <- data.frame(
  Name = c('Player1', 'Player2', 'Player3'),
  Crossing = c(70, 80, 85),
  Finishing = c(75, 85, 80),
  Volleys = c(65, 70, 75),
  FK_Accuracy = c(70, 75, 80)
)

player_pizza_chart(player_data,
player_stats_col=c('Crossing', 'Finishing', 'Volleys', 'FK_Accuracy'),
                   name_col = 'Name', player_name = 'Player1')

[Package PlayerChart version 1.0.0 Index]