Although R is essentially a set
of statisticals, its use has been extended to a number of
areas, such as natural language processing. This
solic tools of spatial analysis,
including analysis of the distributions of points and the Bayesian
geostatical modelling. It is possible to read and manage a
of vector and raster data, including shapefiles, NetCDF and GDAL.
Traditional GIS programs often
been limited by their spatial statistics and their analytical capacity were relatively
, including a small range of integrated
functions, forcing users to use other platforms for advanced analysis,
modelling and simulation. ESRI made the
acquisition of the MapStudio program from the University of Minsk, which from 2001 has become the Geostatistical Analyst
extension of ArcGis .
With R, many popular statistical proceedings
more advanced analyses, including a variety
of simulation applications , can be
tools such as QGIS.
How to install R for QGis.
No need to rush to the QGis processing
panel to find R. It is not part of the processing providers included
with the QGis installation.
You have to download
install R on your computer before configuring QGis.
Here is the link to download R: https://cran.r-project.org/bin/windows/base/
Once downloaded , double click on
the file R-3.3.2-win.exe to
install R on your computer .
The program installs R in the directory C:
\ Program Files \ R \ R-3.3.2
How to configure the
To configure R , open the window
treatments (treatments-> Options …)
Open Treatmentproviders-> R scripts
Check the Activate box to
activate the option R and for it to appear in
the panel Processing .
If you have a
64bits Windows version, you can check
the box Use the 64-bit version . If you
32-bit post, only the 32-bit version of R is installed
. If you have a
64-bit computer, both versions (32 and 64 bits) are installed
. If you do not check the box you will
use the same 32-bit version if your
PC is a 64 bit.
You have to configure the
directory with the library R for QGis. This
directory , rlibs lies in
C: / User / your username /.qgis2/processing
if it does not exist , create
rscripts beside rlibs
indicate this repertoire in
Scripts Directory R.
Point the R directory to the directory installation
, default C: \ Program Files \ R \
Click OK to close the window Treatments
You have now
the provider R that appears in the processing panel, with
The first Create new R script
editing window or you
type a Python script. If you have inputs
to set for execution , this is the moment to do it.
The second , Get R scripts from on-line scripts
collection , allows you to use Python scripts ready
to use with the adequate processing windows already
Let’s see an example
. You want to carry
out an histogram R for a field of a
vector layer .
Double- click on Get R
scripts from on-line scripts collection to open the window Getscriptsandmodels:
Open item Notinstalled :
Search the tool Histogram
, check the corresponding box and click
With version 2.18.2 which I
use, the processing window will not update immediately. If you open
the window again Getscriptsandtemplates you
see a new item in Updateavailable (in the case of
the histogram) or item Installed .
When you close
, the R processing window in the panel is updated,
and your new tool is
under UserR script-> Histogram
you double click on the tool , you will get the settings window
When you click
on Run , the processing is performed :
If you are not familiar with R, this
is the easiest way to start using the tools that R puts at your disposal.
If you make a
click on the tool in the processing panel, you
option Editthe script
to see the construction of the Python script:
Here it is!. We have
half-opened a door for you to discover
the possibilities that R can bring you.