我的数据框如下:
GRID_TYPE GAME_ID GAME_EVENT_ID PLAYER_ID PLAYER_NAME TEAM_ID TEAM_NAME PERIOD
1 Shot Chart Detail 0021500003 6 201939 Stephen Curry 1610612744 Golden State Warriors 1
2 Shot Chart Detail 0021500003 9 201939 Stephen Curry 1610612744 Golden State Warriors 1
3 Shot Chart Detail 0021500003 14 201939 Stephen Curry 1610612744 Golden State Warriors 1
4 Shot Chart Detail 0021500003 19 201939 Stephen Curry 1610612744 Golden State Warriors 1
5 Shot Chart Detail 0021500003 36 201939 Stephen Curry 1610612744 Golden State Warriors 1
6 Shot Chart Detail 0021500003 38 201939 Stephen Curry 1610612744 Golden State Warriors 1
7 Shot Chart Detail 0021500069 5 201939 Stephen Curry 1610612744 Golden State Warriors 1
8 Shot Chart Detail 0021500069 164 201939 Stephen Curry 1610612744 Golden State Warriors 2
9 Shot Chart Detail 0021500069 195 201939 Stephen Curry 1610612744 Golden State Warriors 2
我想将GAME_ID = "0021500003"
所以我有gameID = "0021500003"
并使用playerDF<- subset(stephShot, GAME_ID == gameID )
但是我找回了一个空的数据框
当我使用playerDF<- subset(stephShot, GAME_ID =="0021500003" )
时,它可以正常工作。
我尝试搜索google / SO并没有遇到任何问题。
我认为这是一个简单的修复,但需要一些帮助。