All posts by Ewen Gallic
European Map using R
In this post, I will present a way to plot a European Union map using R. As you know, some countries are missing in the maps package. So, instead of working with that package, we will use the rworldmap one, available on CRAN. We will also need two more packages : ggplot2 and grid.
Scale bar and North arrow on a ggplot2 map using R
After some research on the Internet, I gave up trying to find an R function to add a scale bar and a North arrow on a map, using ggplot().
So, I would like to present you what I have come up with.
The idea is really basic : we create two polygons for the scale bar, we add some text above, and we draw an arrow. That’s it. The only tricky thing here, is the way to obtain the coordinates of each element. An easy solution is to use the gcDestination function, from the maptools package.
Sending an email using R (with sendmailR package, on Mac OS X)
It seems that everything is possible with R. My latest discovery is that you can easily send emails from the R console. It can be very useful for sending reporting files directlyRead More…
Visualizing densities of spatial processes
In the past few weeks, Arthur Chaprentier (@freakonometrics) and I have been working again on an article untitled “Visualizing spatial processes using Ripley’s correction: an application to bodily-injury car accident location“. The revised version of our work is available here: http://hal.archives-ouvertes.fr/hal-00725090.
Please note that this post is related to Arthur’s: http://freakonometrics.hypotheses.org/7129
Montreal border
After reading a really nice post about geo-marked bike accidents (Mapping Bike Accidents in R), I wanted to reuse the map for something else. Unfortunately, the shapefile used to create it does not give the entire border, but an aggregation of borough instead.
So, after a couple hour looking on the web for a simpler SHP file, I gave up and finally decided to create it myself. To do so, I used the SHP file given on the Mapping Bike Accidents post.