Heatmaps generation with R, Php and Mongodb

后端 未结 1 599
太阳男子
太阳男子 2020-12-22 13:59

I\'m new to R. i want to generate a heat map using PHP, MongoDB and R. i want to plot geo coordinates(Lat, Lng) on World Map. Below is the sample code i\'m trying to use. pl

相关标签:
1条回答
  • 2020-12-22 14:37
    ggmap(mapgilbert) + 
      stat_density2d(data = df, aes(x = lon, y = lat, fill = ..level.., 
                                    alpha = ..level..), size = 0.01, 
                                    bins = 16, geom = "polygon") + 
      scale_fill_gradient(low = "green", high = "red") + 
      scale_alpha(range = c(0, 0.3), guide = FALSE)
    

    I think 4 million points are too computationally expensive. Maybe you should use a subset or sample from your data.

    0 讨论(0)
提交回复
热议问题