 Hello, this is Hans Velikvast, senior lecturer at the IT Delft Institute for Water Education. In this video, I'm going to show you how to integrate R in QGIS. I'll demonstrate how it works on Windows. We first download R for Windows, and then we use the base installation, and download the latest version. When the wizard of the installer starts, we just keep everything as default by clicking next. There's a manual page that explains the use of R scripts in the processing toolbox, which we are preparing now. Let's start QGIS and connect R to QGIS, so we can use it in the processing toolbox and make our own scripts. In QGIS, we need to install a plugin. Search for the processing R provider plugin, and if you click there on home page, you end up on a page which explains this processing R provider plugin, and how to install it on different systems. That's what we're going to do, to configure it for Windows. Let's first install the processing R provider, and click close. Now let's look at the configuration of R in the settings of the processing toolbox. If you've used the default installer for R, all the paths will be okay. If you have changed something, you need to change it here. If you have a 64-bit computer, you check this box, and then you can click okay. To make use of R, I restarted QGIS and expanded the R section here, and when I run test SF on this point data layer that I have, it will install all the necessary packages. You might have to do it twice. I had some errors there, and it generated a copy of my table. What I found out is that the analysis tools of R work better on that copy than on the original data. I choose here output, and then the field for which I want to calculate the minimum and maximum, and then I run it, and it runs the R tool for that, and there I get the statistics. I can also calculate a scatter plot between the altitude, for example, and the temperature and see if there is any relation between those, and I run it, and in the results viewer, I can click on the plot, and there we see that there is not much relation in there. These were just some scripts that came with the processing R provider, but fortunately there are ways to add more scripts to the toolbox, and one way is to look at the scripts available in the QGIS resource sharing plugin, so let's install that plugin. It's a plugin that is used to share styles, but also scripts. Now we can find that little green button in our toolbar, which opens the resource sharing dialog, and there you can search for R scripts, and there you can find the QGIS R script collection, and click install to add them to your processing toolbox, and then 60 scripts are added. Let's see if we can find them, and there they are in different categories, so that's very useful. Let's try the summary statistics, and I use here the original file, and there you see that it gives an error, but if I go back to parameters and use that copy that was created, then we'll see it works, and it gives the output statistics there, and they're all well documented. You can also make a frequency table, let's look at the temperatures, this file there generates a table, and when we look at it in the output viewer, we see here the table. We can also make a histogram, and here we see the result, but when you're going to do more with R in QGIS, you want to add your own scripts, and then you can use this page where the script syntax is explained. These lines with the hashes, they show where there are interface things with QGIS, and you can look here at examples, group where it goes into the name of the tool, that it needs to load a vector layer, and some other parameters that the user defines, and then we have the R code lines below those lines with the hashes. You can also simply copy the example, and choose create a R script, paste it there, leave it, it will be saved in your profile, and then it's added also to the toolbox. Under point pattern analysis, sample random points, you can use a vector layer, that's for the extent, and then the sample size, choose 10 here, and when I run it, it will generate 10 random points within the extent of the vector layer that I defined, and there is the result. So you see that this is a very powerful way of using R functionality in QGIS.