Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Statistics include number of cells counted, minimum and maximum cell values, range, arithmetic mean, population variance, standard deviation, coefficient of variation, and sum.

**-g**- Print the stats in shell script style
**-e**- Calculate extended statistics
**-t**- Table output format instead of standard output format
**--overwrite**- Allow output files to overwrite existing files
**--help**- Print usage summary
**--verbose**- Verbose module output
**--quiet**- Quiet module output
**--ui**- Force launching GUI dialog

**map**=*name***[required]**- Name of 3D raster map
**zones**=*name*- 3D Raster map used for zoning, must be of type CELL
**output**=*name*- Name for output file (if omitted or "-" output to stdout)
**percentile**=*float[,**float*,...]- Percentile to calculate (requires extended statistics flag)
- Options:
*0-100* - Default:
*90* **separator**=*character*- Field separator
- Special characters: pipe, comma, space, tab, newline
- Default:
*pipe*

This module can use large amounts of system memory when the **-e**
extended statistics flag is used with a very large region setting. If the
region is too large the module should exit gracefully with a memory allocation
error. Basic statistics can be calculated using any size input region.

# define volume g.region n=10 s=0 w=0 e=10 b=0 t=10 res=1 res3=1 -p3 # generate random map r3.mapcalc "random_0_1 = rand(0., 1)" -s # compute univariate statistics, along with extended statistics r3.univar -e map=random_0_1 percentile=98 100% total null and non-null cells: 1000 total null cells: 0 Of the non-null cells: ---------------------- n: 1000 minimum: 0.00053905 maximum: 0.998322 range: 0.997783 mean: 0.513676 mean of absolute values: 0.513676 standard deviation: 0.289969 variance: 0.0840821 variation coefficient: 56.4498 % sum: 513.676463040334 1st quartile: 0.257654 median (even number of cells): 0.524313 3rd quartile: 0.763637 98th percentile: 0.982924 # script style output, along with extended statistics r3.univar -ge map=random_0_1 percentile=98 n=1000 null_cells=0 cells=1000 min=0.000539049520323687 max=0.998322037540536 range=0.997782988020212 mean=0.513676463040334 mean_of_abs=0.513676463040334 stddev=0.289969154194666 variance=0.0840821103843701 coeff_var=56.4497646005434 sum=513.676463040334 first_quartile=0.257654 median=0.524313 third_quartile=0.763637 percentile_98=0.982924

Code is based on r.univar from

Hamish Bowman, Otago University, New Zealand

and Martin Landa

Zonal loop by Markus Metz

Available at: r3.univar source code (history)

Latest change: Thursday Feb 03 11:10:06 2022 in commit: 547ff44e6aecfb4c9cbf6a4717fc14e521bec0be

Note: This document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade, and read the current manual page.

Main index | 3D raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual