-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample_script.R
executable file
·101 lines (64 loc) · 1.92 KB
/
example_script.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
library(NBAr)
library(tidyverse)
#devtools::install_github("PatrickChodowski/NBAr")
season <- 2018
gamelist<- c(21800001:21800003)
game_id = 21800001
#########################
### Boxscores:
#########################
traditional <- map(gamelist, ~get_boxscore(.,boxscore_type = 'traditional')) %>% compact() %>% bind_rows()
#########################
### Matchups
#########################
matchup <- get_matchups(game_id)
#########################
### Play by play:
#########################
pbp2 <- map(gamelist, ~get_playbyplay2(.)) %>% compact() %>% bind_rows()
#########################
### Lineups:
#########################
lineups <- get_lineups(season,5,'Base')
bulls_lineups <- get_lineups(season,5,'Base', team_id = 1610612741)
#########################
### On/Off court:
#########################
onoff_bulls <- get_on_off(season,1610612741)
#########################
### Players list
#########################
players <- get_players(season)
player_bio <- get_playerbio(season)
#########################
### Shotcharts
#########################
shots_abrines <- get_shotchart(203518, season)
#########################
### Schedule
#########################
schedule <- get_schedule(season)
#########################
### Tracking data
#########################
tracking = get_tracking(season, 'Team', measure_type = 'Defense')
#########################
### Playtype data
#########################
playtype <- get_playtype(season, 'T', 'Postup')
#########################
### Defense data
#########################
defense <- get_defense(season, 'Team', 'Overall')
#########################
### General data
#########################
general <- get_general(season, type = 'Team', 'Base')
#########################
### Hustle data
#########################
hustle <- get_hustle(21800001)
#########################
### Shooting data
#########################
shooting <- get_shooting(season, 'Team', "By+Zone", "Base")