knitr::opts_chunk$set(echo = TRUE)
install.packages("future") devtools::install_github("abresler/nbastatR")
library(nbastatR) library(future) library(tidyverse) plan(multiprocess) logs_2019 <- nbastatR::game_logs(seasons = 2019) glimpse(logs_2019)
logs_2019 %>% count(idGame)
ids <- unique(logs_2019$idGame)[1:10] play_by_play_sample <- play_by_play(ids) glimpse(play_by_play_sample)
play_by_play_sample %>% summarize( home_events = sum(!is.na(descriptionPlayHome)), visitor_events = sum(!is.na(descriptionPlayHome)), both_events = sum(!is.na(descriptionPlayHome) & !is.na(descriptionPlayVisitor)) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.