Title: | Generate Pizza Chart: Player Stats 0-100 |
---|---|
Description: | Create an interactive pizza chart visualizing a specific player's statistics across various attributes in a sports dataset. The chart is constructed based on input parameters: 'data', a dataframe containing player data for any sports; '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, with statistics ranging between 0 and 100; 'name_col', specifying the name of the column in the dataframe that contains the player names; and 'player_name', representing the specific player whose statistics will be visualized in the chart, serving as the chart title. |
Authors: | Amal Panwar [aut, cre]
|
Maintainer: | Amal Panwar <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-02-22 04:25:09 UTC |
Source: | https://github.com/cran/PlayerChart |
Create a pizza chart for sports player.
player_pizza_chart(data, player_stats_col, name_col, player_name)
player_pizza_chart(data, player_stats_col, name_col, player_name)
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. |
an interactive pizza chart for a player.
# 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')
# 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')