Skip to contents

This function gets NBA scores for the specified seasons. Function pauses for five seconds after each season to prevent timeout issues.

Usage

nba_scores(seasons, season_type = "Regular Season", return_nested = FALSE)

Arguments

seasons

A numeric vector of seasons (e.g., 2024) for which to fetch NBA scores.

season_type

A character string specifying the type of season. Valid options include:

  • "Pre Season" - Pre Season games.

  • "Regular Season" - Regular Season games.

  • "Playoffs" - Playoff games.

  • "All Star" - All Star games.

  • "IST" - NBA Cup games.

  • "PlayIn" - Play In games.

return_nested

A logical value. If FALSE (default), returns a single combined data frame for all seasons. If TRUE, returns a list of data frames, one for each season.

Value

A data frame containing the NBA scores data for the specified seasons.