传单未渲染背景图(R)

时间:2019-09-11 14:58:10

标签: r leaflet maps

我正在尝试在R中绘制地图,使用传单库来分析GTFS文件,但是地图背景无法渲染,仅显示了圆圈标记。

library(knitr)
library(readr)
library(leaflet)

list.files("Downloads/gtfs")
stops = read_csv("Downloads/gtfs/stops.txt",trim_ws = T)
trips = read_csv("Downloads/gtfs/trips.txt",trim_ws = T)
agency = read_csv("Downloads/gtfs/agency.txt",trim_ws = T)
stoptime = read_csv("Downloads/gtfs/stops_times.txt",trim_ws = T)
calendar = read_csv("Downloads/gtfs/calendar.txt",trim_ws = T)

map = leaflet() %>% 
  addProviderTiles("OpenStreetMap.Mapnik") %>%  

  addCircleMarkers(lng= ~ stop_lon, lat= ~stop_lat, data = head(stops,1000), stroke = FALSE, fillOpacity = 0.5, radius =5 ) 

map

0 个答案:

没有答案