Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A great and easier package to work with for creating maps using pure R is ggmaps: http://journal.r-project.org/archive/2013-1/kahle-wickham.pd...

Here's an example map of San Francisco I made using ggmaps: http://i.imgur.com/zdetaKw.png

(The map was made for http://minimaxir.com/2014/04/san-francisco/ if you want more context.)



What makes it easier?


Looking at the code used in the OP, ggmaps does not require a dependy on a different program (and it also used a .dll, which may make it difficult to use cross-platform as well.). ggmaps also used ggplot2 syntax, making it easy for style customization which I don't see in the original code.

Although, using a shapefile adds another R package dependency, but not much more LOC. Alternatively, use the maps package, which also contains data for reconstructing popular maps like the world map used.


F# and its Type Providers have a strong cross platform story. http://fsharp.org/use/linux/ All the dlls referenced in the OP work on non windows platforms.


I am a novice in F# and pretty much have no idea about R, but what I can see here is that World Bank Type provider is providing the OP with the data.


Correct in this case, but you could use a simple CSV to get World Bank data as well.


The benefit of using a Type Provider over an CSV is it provides a strongly typed api to the data. Which gives you tooling (IntelliSense) and makes it hard to impossible to have type errors.


Type providers are available for CSV files also...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: