

Creating maps using R, Deedle and F# type providers - tellarin
http://www.clear-lines.com/blog/post/Create-maps-using-R-Deedle-and-FSharp-type-providers.aspx

======
rjzzleep
mainly talking about f# here...

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/](http://tomasp.net/)

[2]
[https://skillsmatter.com/members/tomasp#skillscasts](https://skillsmatter.com/members/tomasp#skillscasts)

[3] [http://www.manning.com/petricek2/](http://www.manning.com/petricek2/)

~~~
platz
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.

~~~
kvb
Are you curious about using them or implementing them? What level of detail
are you looking for?

~~~
platz
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.

~~~
mmavnn
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/](http://blog.mavnn.co.uk/type-providers-from-the-ground-up/)

~~~
platz
Thanks! I'll give it a read.

------
minimaxir
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...](http://journal.r-project.org/archive/2013-1/kahle-wickham.pdf)

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

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

~~~
kvb
What makes it easier?

~~~
minimaxir
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.

~~~
sremani
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.

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

~~~
tonyabell
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.

------
dalek2point3
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/

