R:试图创建一个半场篮球错误:不知道如何将o添加到情节中

时间:2017-11-06 15:35:51

标签: r ggplot2

我试图将篮球半场与投篮结果数据合并,但是它表明了 "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))

1 个答案:

答案 0 :(得分:1)

你想要的是什么

P_half_180 %>%
+ geom_point(data=deter_chart, 
             aes(x=touch_start_x,
                 y=touch_start_y,
                 colour=led_to_shot))

但我不知道有关nba_2015P_half_180的更多信息,我只能猜测。