Question
a) Retrieve the NBA data for the 2007-2008 season.
b) Subset the data for your favorite team. Show the code you used to find:
o Which player has the best three point percentage?
o Which player has played the largest number of minutes?
o Which player has the most "Steals"?
c) Show 5 teams for the 2007-2008 season that have the most wins in descending order.
d) Use at least 5 Google charts (your choice) to show relevant data from this dataset.
e) Use gvisGeoChart function to display the location on the world map of the last 5 Basketball World Cup Champions
Please include the R code source file (including packages/libraries used, etc.) and screenshots of the outputs.
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
Sports Analytics# Importing the Sports Analytics library
library("SportsAnalytics")
# a) Retrieve the NBA data for the 2007-2008 season.
nba_data_07_08<-fetch_NBAPlayerStatistics("07-08")
# b) Subset the data for your favorite team. Show the code you used to find:
# Subsetting the data for favoriate team
BOS_data_07_08<-nba_data_07_08[nba_data_07_08$Team=="BOS",]
# Which player has the best three point percentage?
BOS_data_07_08$three_point_per<-(BOS_data_07_08$ThreesMade/BOS_data_07_08$ThreesAttempted)*100
best_threes<-max(BOS_data_07_08$three_point_per,na.rm = TRUE)
BOS_data_07_08[which(BOS_data_07_08$three_point_per==best_threes),"Name"]
## [1] "Ray Allen"
# Which player has played the largest number of minutes?
max_minutes<-max(BOS_data_07_08$TotalMinutesPlayed)
BOS_data_07_08[which(BOS_data_07_08$TotalMinutesPlayed==max_minutes),"Name"]
## [1] "Paul Pierce"
# Which player has the most "Steals"?
max_steals<-max(BOS_data_07_08$Steals)
BOS_data_07_08[which(BOS_data_07_08$Steals==max_steals),"Name"]...
By purchasing this solution you'll be able to access the following files:
Solution.docx and Solution.R.