'How to plot 2 columns from a dataframe into a Pie chart in R shiny app

i have a NBA dataframe with 2 columns : "TEAM" (for team name) and "W" (for the number of wins). Now, what i want, is to plot on a pie/donut chart the first 5 teams and their wins on the pie chart, of course the dataframe is ordered already (with arrange) i just want the "percentage" to be the number of wins instead and the colors would be for each team name.

This is the dataframe table that i want to convert : image

dataframe name : NBA_T_STATS

team name column name : TEAM

number of wins column name : W

Thank you !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source