This is my analysis of the “Free_throws” data file. This data set helps to show freethrow information in the NBA over a 10 year period 2006-2016.
The dataset for this analysis was a collection of free throw data in the NBA over a ten year period, 2006 - 2016. This data set includes columns for the end result of the game, the matchup for the game, the game id, the period within the game, the play that occured to end up in the dataset, the player who made the play, whether the game was during the playoffs or the regular season, the score of the game at the time of the play, the season which that play took place, whether or not the shot was made, and finally the time at which the play occured.
I was able to conclude 5 different findings from this dataset.
The first of which, which is shown in the first chart is the players with the highest number of shot attempts and the individual shooting percentage from the freethrow line over a ten year period (2006 - 2016)
The second finding which is shown in the second chart is the best shooting percentages per quarter over a ten year period. This chart shows quarters 1-8 on the x-axis, quarters 1-4 in the chart represent regulation quarters. Quarters 5-8 in the chart represent overtime periods, 5 being 1 OT and 8 being 4 OT.
The third finding which is shown in the third chart which is a pie chart is the number of free throws made per quarter over a 10 year period (2006-2016)
The fourth finding which is shown in the fourth chart shows the players who have made the most freethrows during a 10 year period, this chart is similar to chart one, when comparing the two you can see that many of the players who are present in chart one ‘highest number of shot attempts’ are present in this chart too.
The fifth and final finding, which is shown in the fifth chart, shows the number of attempts per season over the period of 2006-2016. This chart shows the season with the highest number of attempts as well as the lowest number of attempts. In this case the lowest number of attempts occured during the 2011-2012 season, the reason for this drastically low number in attempts compared to other seasons is due to the NBA lockout which occured during this season.
ggplot(madeShots[1:10,], aes(x = reorder(player, -percentage), y = percentage)) +
geom_bar(colour = "black", fill = "orange", stat = "identity") +
labs(title = "Free Throw Percentages of Players with Highest Attempts (Top 10)", x = "Player Names & Total Free Throw Attempts", y = "Shooting Percentages") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_light() +
coord_flip()+
geom_text(aes(label = scales::comma(shots_taken), hjust = 1)) +
scale_y_continuous(breaks = c(0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100))
ggplot(quarterShots, aes(x = period, y = percentage, fill = playoffs))+
geom_bar(position = "dodge",stat = "identity") +
labs(title = "Free Throw Percentages per Quarter", x = "Quarter (5-8 are overtime periods,5 = 1st OT ect...)",
y = "Free Throw Percetntages") +
scale_y_continuous(breaks = c(0,10,20,30,40,50,55,60,65,70,75,80, 85, 90))+
scale_x_continuous(breaks = c(1,2,3,4,5,6,7,8)) +
scale_fill_brewer( palette = "Set1")+
theme_clean() +
theme(plot.title = element_text(hjust = 0.5))
plot_ly(quarterShots, labels = ~quarterOrder, values = ~shots_scored) %>%
add_pie(hole = 0.6) %>%
layout(title = "Free Throws Made Per Quarter (Regular Season + Playoffs") %>%
layout(annotations = list(text = paste0("Total Makes in all Quarters: \n",
scales::comma(sum(quarterShots$shots_taken))),
"showarrow" = F ))
ggplot(madeShots[1:10,], aes(x = player, y = shots_scored,)) +
geom_bar(colour = "orange", fill = "white", stat = "identity") +
coord_flip() +
geom_text(aes(label = scales::comma(shots_scored), hjust = 1)) +
labs(title = "Most Free Throws Made (2006 - 2016)", x = "Player Name",
y = "Shots Made") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_minimal()
ggplot(top_seasons, aes(x = season, y = n, group = 1))+
geom_line(aes(color = season), size = 2)+
geom_point(shape = 21, size = 4, color = 'red', fill = 'white') +
theme_light() +
scale_y_continuous(labels = comma) +
labs(x = "Season", y = "Free Throw Attempts", title = "Free Throw Attempts per Season (2006-2016)") +
geom_point(data = hi_low, aes(x = season, y = n), shape = 21, size = 4, fill = "red", color = "red") +
geom_label_repel(aes(label = n), box.padding = 1, point.padding = 1, size = 4, color = "Grey50", segment.color = "black")