Skip to contents

This function gets NBA shot data for the specified seasons and returns a data frame. Function pauses for five seconds after each season to prevent timeout issues.

Usage

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

Arguments

seasons

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

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 named a data frame containing NBA shots data for the specified seasons.