> For the complete documentation index, see [llms.txt](https://uttws.gitbook.io/gis-workshop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uttws.gitbook.io/gis-workshop/exercise/plugins/processing-r-provider.md).

# Processing R Provider

### Overview

{% hint style="warning" %}
This is an <mark style="color:red;">advanced</mark> 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.
{% endhint %}

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](https://www.r-project.org/) is a free and open-source software environment for statistical computing and graphics.

It has to be installed separately ([Download and Install R](https://cran.r-project.org/)), 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

<figure><img src="/files/EalsKp5rGbspPNIWP80Z" alt=""><figcaption></figcaption></figure>

Once it's installed, go ahead and restart your QGIS project.&#x20;

### 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…).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://uttws.gitbook.io/gis-workshop/exercise/plugins/processing-r-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
