我试图将篮球半场与投篮结果数据合并,但是它表明了
"Error: Don't know how to add o to a plot"
有人可以帮我看看我的代码有什么问题吗?
P_half_180
代表我为半场创建的图表,散点图无法正常工作P_half_180
library(ggplot2)
library(dplyr)
deter_chart <- nba_2015 %>%
filter(defender_id == "253975")
P_half_180 %>%
+ ggplot(data=deter_chart,
aes(x=touch_start_x, y=touch_start_y)) %>%
+ geom_point(aes(colour=led_to_shot))
答案 0 :(得分:1)
我猜你想要的是什么
P_half_180 %>%
+ geom_point(data=deter_chart,
aes(x=touch_start_x,
y=touch_start_y,
colour=led_to_shot))
但我不知道有关nba_2015
和P_half_180
的更多信息,我只能猜测。