QGIS can be configurated to use external tools and acquire algorithms from various external programs. Algorithms from external tools such as GRASS GIS, SAGA GIS, Orfeo ToolBox, LecoS, LAStools, etc. are available. For more complex tasks, custom scripts can be written in various programming languages such as Python (2.7 in 3) and R.. In this chapter we will show how to integrate external tools into the Processing toolbox. We will integrate R software and language libraries.

Download the R environment and install it according to the instructions. The next step is to integrate it in QGIS.

In the Processing tab, we have the processing options available. In the Providers section, choose R scripts, where we set up the path to our installation folders and activate the new tools.

adv2_1
We toggled the 64-bit version

R scripts are displayed in the Processing toolbox.

adv2_2

We have the ability to retrieve many scripts and models from the R on-line scripts collection or create new scripts.

adv2_3

In our example, we calculated the Spearman’s rank correlation coefficient between population numbers by major age groups up to 14 years and from 65 years or more (total, 2017, STAGE II).

adv2_3
We wrote a new script
adv2_5
We ran the script
rezultat
The result (HTML file)