Example with number and string outputs
This script takes input vector data and one of its fields. The result is the minimum and maximum for a given field of the layer.
Script
##Basic statistics=group
##Min_Max=name
##Layer=vector
##Field=Field Layer
##Min=output number
##Max=output number
##Summary=output string
Min <- min(Layer[[Field]])
Max <- max(Layer[[Field]])
Summary <- paste(Min, "to", Max, sep = " ")
Script lines description
- Basic statistics is the group of the algorithm.
- Min_Max is the name of the algorithm.
- Layer is the input vector layer.
- Field is the name of a field from Layer.
- Min is the name of the minimum output that will be created and returned to QGIS.
- Max is the name of the maximum output that will be created and returned to QGIS.
- Summary is the name of the string output that will be created and returned to QGIS.
- Calculate minimum
- Calculate maximum
- Create the string
The outputs will be presented in QGIS as a dictionnary.