18.35. R Syntax Summary table for Processing

Module contributed by Matteo Ghetta - funded by Scuola Superiore Sant’Anna

Processing allows a lot of different input and output parameter that can be used in the script body. Here a summary table:

18.35.1. Input parameters


Syntax example

Returning objects


Layer = vector

SpatialDataFrame object, default object of rgdal package

vector point

Layer = vector point

SpatialPointDataFrame object, default object of rgdal package

vector line

Layer = vector line

SpatialLineDataFrame object, default object of rgdal package

vector polygon

Layer = vector polygon

SpatialPolygonsDataFrame object, default object of rgdal package

multiple vector

Layer = multiple vector

SpatialDataFrame objects, default object of rgdal package


Layer = table

dataframe conversion from csv, default object of read.csv function


Field = Field Layer

name of the Field selected, e.g. "Area"


Layer = raster

RasterBrick object, default object of raster package

multiple raster

Layer = multiple raster

RasterBrick objects, default object of raster package


N = number

integer or floating number chosen


S = string

string added in the box


LS = longstring

string added in the box, could be longer then the normal string


S = selection first;second;third

string of the selected item chosen in the dropdown menu


C = crs

string of the resulting CRS chosen, in the format: "EPSG:4326"


E = extent

Extent object of the raster package, you can extract values as E@xmin


P = point

when clicked on the map, you have the coordinates of the point


F = file

path of the file chosen, e.g. “/home/matteo/file.txt”


F = folder

path of the folder chosen, e.g. “/home/matteo/Downloads”

Any of the input could be also OPTIONAL, that means that you have a handy way to tell the script to ignore this parameter.

In order to set an input as optional, you just have to add the string optional before the input, e.g:

##Layer = vector
##Field1 = Field Layer
##Field2 = optional Field Layer

18.35.2. Output parameters

Output parameters take the Input names you gave at the beginning of the script and write the object you want.


Syntax example


Output = output vector


Output = output raster


Output = output table


Output = output file


for the plot input type, you can save the plot as png directly from the Processing Result Viewer or you can choose to save the plot directly from the algorithm interface.

18.35.3. Examples

In order to better understand all the input and output parameters, please have a look at the R Syntax chapter.