Processing R Provider

Overview

This is an advanced skill and install R only if you are interested. This is will be a short section in our QGIS workshop and mainly to point out how we can extend the use of the QGIS software.

Use the processing R Provider plugin to run R in QGIS. Why? Because R has a large library of machine learning and spatial statistics! Most GIS programs are often limited in their spatial statistics. With R, many advanced analyses and statistics can be applied directly in QGIS using the R provider plugin.

R

R is a free and open-source software environment for statistical computing and graphics.

It has to be installed separately (Download and Install R), together with a few necessary libraries.

The beauty of Processing implementation is that you can add your scripts, simple or complex ones, and they may then be used as any other module, piped into more complex workflows, etc.

R has to be installed on your computer and the PATH has to be correctly set up. Moreover processing just calls the external R packages, it is not able to install them. So be sure to install external packages directly in R.

If you have package problems, it may be related to missing mandatory packages required by processing, like sp, rgdal and raster.

Install R Provider Plugin

In plugins search R Provider

Once it's installed, go ahead and restart your QGIS project.

Adding Scripts

Adding a script is simple. The easiest way is to open the Processing toolbox and choose Create new R script… from the R menu (labelled with an R icon) at the top of the Processing Toolbox. You can also create the script in for instance a text editor and save it in your R scripts folder (processing/rscripts). When it has been saved there, it will be available for editing by right-clicking on the script name in the processing toolbox and then choose Edit Script…).

Last updated