A Bridge to R

The  R-ArcGIS bridge has been around for a while and proving popular, particularly in the science community. Connecting to ArcGIS for Desktop (ArcMap or ArcGIS Pro) from a statistics modelling package like R is a great way to extend the analytical capabilities that ArcGIS for Desktop supports. I’m guessing only a few of you will know much about R and if you don’t use it already it’s not something you are likely to use directly. So why the blog post? If you have any colleagues (statisticians, data analysts, modellers) that do use R then you can both benefit from working with the R-ArcGIS bridge.

Preparing for a presentation at the Royal Statistics Society conference recently, I discovered how much the R-bridge can add to our toolset. Like most bridges the traffic can go both ways and there are three use patterns that the tools support.

Direct access to GIS data from R

ArcGIS is my analysis comfort blanket, but for someone used to using R having to replicate their workflows and models in a new system is an unwelcome effort. R includes some spatial analysis tools but import/export is limited to shapefiles. Use the R-ArcGIS bridge to read GIS features directly into R models and use the R toolset to analyse the data. Downloadable from Git Hub, the bridge provides packages for R that manage the data connection. 

AH_Oct17_Rscript_smoothing.JPG

Push R results back to ArcGIS for exploring and sharing spatial results

Having used R it’s easy to push the results back into ArcGIS to explore the spatial patterns in ArcGIS Desktop. From there it’s a simple next step to share the output. For R users, one of the big appeals of GIS is the sophistication of the visualisation tools. Not only can you make insightful 2D maps you can use also use the 3D capabilities to present your data in a different way.

L_7F65.tmp.PNG

Bring the power of R into ArcGIS

Although ArcGIS provides us with lots of statistical analysis tools for spatial data it isn’t as comprehensive as R. So maybe you have data that needs to be passed to your friendly neighbourhood statistician to be run through an R model once a month. With a bit of tweaking that R model can be run as a Geoprocessing tool in ArcGIS for Desktop.

AH_Oct17_Rscript.JPG

No need to export the data, give it to someone else and re-import the results. You know have the power of R wrapped up in a familiar interface. I think this last option could make a big difference to some organisations – allowing the expertise of in-house statisticians to be disseminated to a wider group via ArcGIS for Desktop. You can add constraints to the model parameters (through the geoprocessing script properties) to guide the ArcGIS users.

AH_Oct17_Rscript_model.JPG

Hopefully this has got you interested in taking a look, or telling a colleague. There are a bunch of example scripts from a seminar available online. If you want to walk through an example there is a training module here, it uses read/write options to add an additional analysis step using R to a GIS workflow.This video takes you through the different options I’ve talked about here.