RMHogervorst / cleancode

simple blog about cleaner code and starting with R
https://rmhogervorst.github.io/cleancode/
MIT License
0 stars 0 forks source link

suggestion for "Plotting a map with ggplot2, color by tile" #46

Closed mtennekes closed 7 years ago

mtennekes commented 7 years ago

H(o)i Roel,

I saw your nice post about maps on rbloggers. I especially liked the way you introduced SpatialPolygonsDataFrames.

Just wanted to let you know I wrote a package for visualizing maps, called tmap (https://github.com/mtennekes/tmap), that turned out to be pretty ambitious. It works like gglot2, but overcomes some of drawbacks. Here's a little example:

library(tmap)
data(NLD_muni, data(NLD_prov)

tm_shape(NLD_muni) +
  tm_polygons("population", convert2density=TRUE) +
tm_shape(NLD_prov) +
  tm_borders(lwd=2)

# interactive mode
tmap_mode("view")
last_map()

If you have any questions or suggestions, please let me know.

Best, Martijn

RMHogervorst commented 7 years ago

Hallo Martijn,

Amazing work on the tmap package! Somehow I always find packages and tutorials after I post about the lack of them...

Thanks I'll try an equivalent project using tmap next time.