Title: | Help Basketball Data Analysis |
---|---|
Description: | Provides interface to the online basketball data resources such as Basketball reference API <https://www.basketball-reference.com/> and helps R users analyze basketball data. |
Authors: | Koki Ando [aut, cre] |
Maintainer: | Koki Ando <[email protected]> |
License: | GPL-2 |
Version: | 0.1.3.3 |
Built: | 2024-11-16 03:34:32 UTC |
Source: | https://github.com/koki25ando/nbalover |
Data set of NBA franchises
franchise
franchise
A data.frame with 13 columns
Franchise name
League
Year the team established
To year
Years
Games
Wins
Losses
Win Percentage
Playoffs
Division titles
Conference titles
Champions
Basketball Reference
Season Matchups and results of a given team
getMatchups(team_code, season)
getMatchups(team_code, season)
team_code |
Team code consisting 3 characters |
season |
Season number |
This function returns data.frame
including columns:
"G" - Games
"Date" - Date
"StartTime" - Time-zone ET
"Opponent" - Opponent Team
"Result" - Game Result
"OT" - Over Time
"Tm" - Points
"Opp" - Opponent Points
"W" - Wins
"L" - Losses
"Streak" - Streaks
Koki Ando
https://www.basketball-reference.com/teams/
## Not run: bos19 <- getMatchups(team_code = "bos", season = 2019) head(bos19) ## End(Not run)
## Not run: bos19 <- getMatchups(team_code = "bos", season = 2019) head(bos19) ## End(Not run)
Standing data
getStandings(year, conf = c("East", "West", "All"))
getStandings(year, conf = c("East", "West", "All"))
year |
Season number consisting 4 digits |
conf |
Conference to fetch information for. Valid values are East, West or All |
This function returns data.fram
including columns:
"Team" - Team
"W" - Wins
"L" - Losses
"Per" - Win-Loss Percentage
"GB" - Games Behind
"PW" - Pythagorean Wins, expected wins based on points scored and allowed
"PL" - Pythagorean Lossed, expected losses based on points scored and allowed
"PSG" - Points Per Game
"PAG" - Opponent Points Per Game
Koki Ando <[email protected]>
https://www.basketball-reference.com/leagues/NBA_2019_standings.html
## Not run: Standings06 <- getStandings(year = 2006, conf = "All") head(Standings06) ## End(Not run)
## Not run: Standings06 <- getStandings(year = 2006, conf = "All") head(Standings06) ## End(Not run)
Stats Leader data
getStatsLeader( stats_type = c("PTS", "G", "MP", "FG", "FT", "TRB", "AST", "STL", "BLK", "TOV", "PF", "FG3"), period = c("career", "season", "game") )
getStatsLeader( stats_type = c("PTS", "G", "MP", "FG", "FT", "TRB", "AST", "STL", "BLK", "TOV", "PF", "FG3"), period = c("career", "season", "game") )
stats_type |
Stats type. PTS, G, MP, FG, FT, TRB, AST, STL, BLK, TOV, PF or FG3 |
period |
Period. career, season or game |
This function returns data.frame
including columns:
"Player" - Player Name
"Season" - Season number
"stats" - Stats Type
"value" - Value of record
"period" - Period. career, season or game.
Koki Ando <[email protected]>
https://www.basketball-reference.com/leaders/
## Not run: pts_leader = getStatsLeader(stats_type = "PTS", period = "season") head(pts_leader) ## End(Not run)
## Not run: pts_leader = getStatsLeader(stats_type = "PTS", period = "season") head(pts_leader) ## End(Not run)
Function for getting given player's stats per game
getStatsPerGame(player, season, span = 1)
getStatsPerGame(player, season, span = 1)
player |
Player name to fetch information for |
season |
Season number |
span |
Duration of season(s). Defaults 1. |
This function returns data.frame
including columns:
G
Date
Age
Tm
Home
Opp
GS
MP
FG
FGA
FGP
3PM
3PA
3PP
FT
FTA
FTP
ORB
DRB
TRB
AST
STL
BLK
TOV
PF
PTS
GmSc
Koki Ando <[email protected]>
## Not run: RayAllen <- getStatsPerGame(player="Ray Allen", season=2008, span=1) head(RayAllen) ## End(Not run)
## Not run: RayAllen <- getStatsPerGame(player="Ray Allen", season=2008, span=1) head(RayAllen) ## End(Not run)
Career stats summary of a given player
getStatsSummary(player)
getStatsSummary(player)
player |
Player name |
This function returns data.frame
including columns:
Season
Age
Tm
Lg
Pos
G
GS
MP
FG
FG
3P
3PA
3P
2P
2PA
2P
eFG
FT
FTA
FT
ORB
DRB
TRB
AST
STL
BLK
TOV
PF
PTS
Koki Ando <[email protected]>
Koki Ando <[email protected]>
https://www.basketball-reference.com
## Not run: kobe_summary = getStatsSummary(player = "Kobe Bryant") head(kobe_summary) ## End(Not run)
## Not run: kobe_summary = getStatsSummary(player = "Kobe Bryant") head(kobe_summary) ## End(Not run)
Franchise's season data
getTeamHistory(team_code)
getTeamHistory(team_code)
team_code |
Team code consisting of 3 characters to fetch information for |
This function returns data.frame
including columns:
Season
Lg
Team
W
L
W/L
Finish
SRS
Pace
RelativePage
ORtg
RelativeORtg
DRtg
RelativeDRtg
Playoffs
Coaches
TopWinShare
Koki Ando <[email protected]>
https://www.basketball-reference.com/teams/
## Not run: BostonCeltics <- getTeamHistory(team_code = "bos") head(BostonCeltics) ## End(Not run)
## Not run: BostonCeltics <- getTeamHistory(team_code = "bos") head(BostonCeltics) ## End(Not run)
Players' salary data for a given team
getTeamSalary(team_code)
getTeamSalary(team_code)
team_code |
Team code consisting of 3 characters to fetch information for |
Koki Ando <[email protected]>
https://www.basketball-reference.com/contracts/
## Not run: salary_phi <- getTeamSalary(team_code = "phi") head(salary_phi) ## End(Not run)
## Not run: salary_phi <- getTeamSalary(team_code = "phi") head(salary_phi) ## End(Not run)
Data set of players in the Naismith Memorial Basketball Hall of Fame
HallOfFame
HallOfFame
A data.frame with 4 columns
Year
Name of inductee
Position
Achievements
wikipedia
R package that provides an interface to online basketball data. This package allows R users to download publicly available data on basketball.
Koki Ando [email protected]
Data set of all NBA players
players
players
A data.frame with 13 columns
Name of Player
Position of given player
Height
Weight
Age
Team(s) the given player belongs to
Games played
Year of seasons
Pre-draft team
Draft status
Nationality
Year
Rookie year
Basketball Real GM
Easy stats comparison function, which includes simple line and point plots
statsCompare(player_list = c(), age = FALSE)
statsCompare(player_list = c(), age = FALSE)
player_list |
List of players |
age |
Age. valid values are TRUE or FALSE |
This function returns a point and line plot showing transitions of PPG stats of given players.
Koki Ando <[email protected]>
## Not run: statsCompare(player_list = c("Ray Allen", "Klay Thompson", "Stephen Curry"), Age=TRUE) ## End(Not run)
## Not run: statsCompare(player_list = c("Ray Allen", "Klay Thompson", "Stephen Curry"), Age=TRUE) ## End(Not run)