Package 'NBAloveR'

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

Help Index


franchise data set

Description

Data set of NBA franchises

Usage

franchise

Format

A data.frame with 13 columns

Franchise

Franchise name

Lg

League

From

Year the team established

To

To year

Years

Years

G

Games

W

Wins

L

Losses

Per

Win Percentage

Playoffs

Playoffs

Division

Division titles

Conference

Conference titles

Champions

Champions

Source

Basketball Reference


Season Matchups

Description

Season Matchups and results of a given team

Usage

getMatchups(team_code, season)

Arguments

team_code

Team code consisting 3 characters

season

Season number

Value

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

Author(s)

Koki Ando

See Also

https://www.basketball-reference.com/teams/

Examples

## Not run: 
 bos19 <- getMatchups(team_code = "bos", season = 2019)
 head(bos19)

## End(Not run)

Standing Data

Description

Standing data

Usage

getStandings(year, conf = c("East", "West", "All"))

Arguments

year

Season number consisting 4 digits

conf

Conference to fetch information for. Valid values are East, West or All

Value

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

Author(s)

Koki Ando <[email protected]>

See Also

https://www.basketball-reference.com/leagues/NBA_2019_standings.html

Examples

## Not run: 
  Standings06 <- getStandings(year = 2006, conf = "All")
  head(Standings06)

## End(Not run)

Stats Leader

Description

Stats Leader data

Usage

getStatsLeader(
  stats_type = c("PTS", "G", "MP", "FG", "FT", "TRB", "AST", "STL", "BLK", "TOV", "PF",
    "FG3"),
  period = c("career", "season", "game")
)

Arguments

stats_type

Stats type. PTS, G, MP, FG, FT, TRB, AST, STL, BLK, TOV, PF or FG3

period

Period. career, season or game

Value

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.

Author(s)

Koki Ando <[email protected]>

See Also

https://www.basketball-reference.com/leaders/

Examples

## Not run: 
 pts_leader = getStatsLeader(stats_type = "PTS", period = "season")
 head(pts_leader)

## End(Not run)

Stats Per Game for a given player

Description

Function for getting given player's stats per game

Usage

getStatsPerGame(player, season, span = 1)

Arguments

player

Player name to fetch information for

season

Season number

span

Duration of season(s). Defaults 1.

Value

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

Author(s)

Koki Ando <[email protected]>

Examples

## Not run: 
RayAllen <- getStatsPerGame(player="Ray Allen", season=2008, span=1)
head(RayAllen)

## End(Not run)

Career Stats Summary

Description

Career stats summary of a given player

Usage

getStatsSummary(player)

Arguments

player

Player name

Value

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

Author(s)

Koki Ando <[email protected]>

Koki Ando <[email protected]>

See Also

https://www.basketball-reference.com

Examples

## Not run: 
 kobe_summary  = getStatsSummary(player = "Kobe Bryant")
 head(kobe_summary)

## End(Not run)

Franchise History Data

Description

Franchise's season data

Usage

getTeamHistory(team_code)

Arguments

team_code

Team code consisting of 3 characters to fetch information for

Value

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

Author(s)

Koki Ando <[email protected]>

See Also

https://www.basketball-reference.com/teams/

Examples

## Not run: 
  BostonCeltics <- getTeamHistory(team_code = "bos")
  head(BostonCeltics)

## End(Not run)

Players' Salary

Description

Players' salary data for a given team

Usage

getTeamSalary(team_code)

Arguments

team_code

Team code consisting of 3 characters to fetch information for

Author(s)

Koki Ando <[email protected]>

See Also

https://www.basketball-reference.com/contracts/

Examples

## Not run: 
 salary_phi <- getTeamSalary(team_code = "phi")
 head(salary_phi)

## End(Not run)

HallOfFame data set

Description

Data set of players in the Naismith Memorial Basketball Hall of Fame

Usage

HallOfFame

Format

A data.frame with 4 columns

Year

Year

Inductee

Name of inductee

Pos

Position

Achievements

Achievements

Source

wikipedia


NBAloveR: Provides data access to basketball data

Description

R package that provides an interface to online basketball data. This package allows R users to download publicly available data on basketball.

Author(s)

Koki Ando [email protected]


players data set

Description

Data set of all NBA players

Usage

players

Format

A data.frame with 13 columns

Player

Name of Player

POS

Position of given player

HT

Height

WT

Weight

Age

Age

Teams

Team(s) the given player belongs to

GP

Games played

YOS

Year of seasons

PreDraftTeam

Pre-draft team

Draft.Status

Draft status

Nationality

Nationality

Year

Year

RookieYear

Rookie year

Source

Basketball Real GM


Visualization of Stats comparison

Description

Easy stats comparison function, which includes simple line and point plots

Usage

statsCompare(player_list = c(), age = FALSE)

Arguments

player_list

List of players

age

Age. valid values are TRUE or FALSE

Value

This function returns a point and line plot showing transitions of PPG stats of given players.

Author(s)

Koki Ando <[email protected]>

Examples

## Not run: 
  statsCompare(player_list = c("Ray Allen", "Klay Thompson", "Stephen Curry"), Age=TRUE)

## End(Not run)