How can I get a tbl of per game career stats for every (or almost every) NBA player in history?

105 Views Asked by At

I've tried this using nbastatR:

library(nbastatR)
assign_nba_players()
players <- df_dict_nba_players$idPlayer
nba_careers <- players_careers(player_ids= players, modes="PerGame")

But it just ran for multiple days straight. Eventually, I checked Task Manager and saw that "RStudio R Session" was taking up 0 computing power. So I terminated the program. This appears to be a good alternative, but I'm not sure how to get the csv file I need and convert it into a tbl in RStudio. I'm only a few weeks old to R, so any help would be greatly appreciated. Thanks!

1

There are 1 best solutions below

1
Mark White On

I've got some code using rvest to scrape Basketball-Reference here, that gets individual-level statistics for box scores by year: https://github.com/markhwhiteii/blog/blob/master/sloppy_play/sloppy_scraping.R