3

I am using following code segment to prepare a graph..

library(leaflet)
df = read.csv('Locations.csv')
nclus = 3
set.seed(123)
res = kmeans(df[,c('Lat','Lon')], centers = nclus, )
df['center'] = res$cluster
pal <- colorFactor(rainbow(nclus), domain = 1:nclus)
leaflet(df) %>% 
  addCircles(color = ~pal(center))

My df is looking like this

                    Location      Lat      Lon center
1                nibm corner 18.47087 73.90004      3
2               mayur colony 18.50398 73.81617      1
3              deccan wheels 18.53221 73.84281      1
4             pashankar auto 18.54852 73.77301      2
5        khadi machine chowk 18.45231 73.89116      1
6 dominos pizza/bmc software 18.53679 73.83025      1

Code is simple. It is working well if I am in open net (internet without proxy server), but the moment I run the code snippet in proxy environment, I get dots on blank graph (no map in background)

I checked whether internet is working within R session or not. It is working well. I even tried following article and created environment variable, but it is of no use.

https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy

Please let me know how to tackle this problem.

Leaflet as it is working in proxy environment if I open it in browser. But if I open it through R in Rstudio/Browser-shiny-app its not working.

Prradep
  • 5,506
  • 5
  • 43
  • 84
vrajs5
  • 4,066
  • 1
  • 27
  • 44

0 Answers0