How to weight smoothing by arbitrary factor in ggplot2?

后端 未结 2 1378
醉梦人生
醉梦人生 2021-01-12 14:30

The following is a relevant example. I\'m looking at shot efficiency as a function of distance for NBA players. I want to weight the smoothing by the volume of shots taken a

2条回答
  •  日久生厌
    2021-01-12 15:16

    As Ben noted above, if you change the first line to

    ggplot(top10,aes(x=FT,y=PPS,size=FGA,color=PPS,weight=FGA))
    

    it works.

    Here's a corrected version:

    enter image description here

提交回复
热议问题