Creating maps using R, Deedle and F# type providers(clear-lines.com)
clear-lines.com
Creating maps using R, Deedle and F# type providers
http://www.clear-lines.com/blog/post/Create-maps-using-R-Deedle-and-FSharp-type-providers.aspx
16 comments
Thanks for pointing to my talks :-) I think the best recording available is on Channel 9 [1]. Though I really like this Mathias's demo, because it puts all the awesomeness in just 2 minutes, while I needed a full hour!
[1] http://channel9.msdn.com/posts/Understanding-the-World-with-...
[1] http://channel9.msdn.com/posts/Understanding-the-World-with-...
I've heard a lot about the amazing-ness of type providers, but no-one seems to know how they work aside from saying something betwen they generate types for you, and they generate intellisense for you.
I'm sure it all makes sense once you go ahead and play with it, but it looks like I'll have to be watching some videos to grok what is really going on.
I'm sure it all makes sense once you go ahead and play with it, but it looks like I'll have to be watching some videos to grok what is really going on.
Are you curious about using them or implementing them? What level of detail are you looking for?
I think its knowing what's reasonable to expect from them and what's not reasonable i.e. what is static, what is dynamic, if there are artifacts how do they get created, what if the data schema is dirty...
some of these questions I can answer myself just playing around with them, but I think I'd have to be comfortable implementing them before being comfortable using them.
some of these questions I can answer myself just playing around with them, but I think I'd have to be comfortable implementing them before being comfortable using them.
Slightly blowing my own trumpet, but if you want a brief overview of the basics this might help: http://blog.mavnn.co.uk/type-providers-from-the-ground-up/
Thanks! I'll give it a read.
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.)
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.
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.
and remember if you need a basemap that is more than simply all the countries in the world, you can use openstreetmap.org! Downloads of raw data in various forms can be found at : download.geofabrik.de/
this looks like the classic example for f# type providers. there are a few talks tomas petricek[1] has given on that topic. the relevant talk is one of the skillsmatter talks[2]
i'm not sure if they're all publically available, but they used to be at least.
edit: but basically the summary is that you can do really cool things with type providers and have your ide(visual studio) give you full completion on parts of data you want to analyze. kinda like re# but without having to generate half a million lines of xml for web services.
there's also book coming up with chapters about it from tomas [3]
[1] http://tomasp.net/
[2] https://skillsmatter.com/members/tomasp#skillscasts
[3] http://www.manning.com/petricek2/