1

I am doing a poster for class. Everything was ok, I created a descent map for showing some data in New York, using Leaflet.

jpal <- colorRampPalette(c("#03B9FF", "#801515"))
# qpal <- colorRampPalette(c("#03B9FF", "#0ABAFD", "#6CCEF3", "#8FD2EC", 
"#03B9FF", "#0ABAFD", "#AA3939", "#801515"))
num.cols <- 255
my.cols <- jpal(num.cols)

library(plotrix)
color.index <- round(rescale(station.df$ratio, c(1,num.cols)), 0)

# Map
m <- leaflet(station.df) %>% addTiles("http://korona.geog.uni-
heidelberg.de/tiles/roadsg/x={x}&y={y}&z={z}", 
                                      attribution='Map tiles by <a 
href="http://stamen.com">Stamen Design</a>, <a 
href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; Map 
data &copy; <a 
href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>') 

m %>% setView(-74.00, 40.71, zoom = 13)
m %>% addCircles(~station.df$start.station.long, 
~station.df$start.station.lat, popup=station.df, weight = 3, 
radius=station.df$sum/30, 
             color=~my.cols[color.index], stroke = TRUE, fillOpacity = 0.8)

The problem appeared when I realized that Leaflet is bad for poster printing - low resolution. Map My Prof told me to use geojson and then save map as pdf.

Well, I tried to fix it. But failed. Tried many options with geojson files. The last one looked like this.

library(rgdal)
nypp <- readOGR("~/Desktop/Temp Spring 2017/Information Visualization/!Big 
Poster/MyCitiBike/From Lecy/nyct2010_17a", "nyct2010")
par(mar=c(.5,.5,.5,.5))
plot(nypp)

Nothing works. Error in plot(nypp) : object 'nypp' not found I appreciate any help ideas how to work with this damn geojson, or my poster does not make any sense with such lousy printed map.

Sincerely

Oleksiy

Anakin Skywalker
  • 2,400
  • 5
  • 35
  • 63

0 Answers0