1r3.univar(1)                GRASS GIS User's Manual               r3.univar(1)
2
3
4

NAME

6       r3.univar   -  Calculates univariate statistics from the non-null cells
7       of a 3D raster map.
8       Statistics include number of cells counted, minimum  and  maximum  cell
9       values,  range,  arithmetic  mean, population variance, standard devia‐
10       tion, coefficient of variation, and sum.
11

KEYWORDS

13       raster3d, statistics, univariate statistics
14

SYNOPSIS

16       r3.univar
17       r3.univar --help
18       r3.univar  [-get]  map=name    [zones=name]     [output=name]     [per‐
19       centile=float[,float,...]]      [separator=character]     [--overwrite]
20       [--help]  [--verbose]  [--quiet]  [--ui]
21
22   Flags:
23       -g
24           Print the stats in shell script style
25
26       -e
27           Calculate extended statistics
28
29       -t
30           Table output format instead of standard output format
31
32       --overwrite
33           Allow output files to overwrite existing files
34
35       --help
36           Print usage summary
37
38       --verbose
39           Verbose module output
40
41       --quiet
42           Quiet module output
43
44       --ui
45           Force launching GUI dialog
46
47   Parameters:
48       map=name [required]
49           Name of 3D raster map
50
51       zones=name
52           3D Raster map used for zoning, must be of type CELL
53
54       output=name
55           Name for output file (if omitted or "-" output to stdout)
56
57       percentile=float[,float,...]
58           Percentile to calculate (requires extended statistics flag)
59           Options: 0-100
60           Default: 90
61
62       separator=character
63           Field separator
64           Special characters: pipe, comma, space, tab, newline
65           Default: pipe
66

DESCRIPTION

68       r3.univar calculates the univariate statistics for  a  3D  raster  map.
69       This  includes  the  number  of cells counted, minimum and maximum cell
70       values, range, arithmetic mean, population  variance,  standard  devia‐
71       tion, coefficient of variation, and sum. Statistics are calculated sep‐
72       arately for every category/zone found in the zones input map if  given.
73       If  the  -e extended statistics flag is given the 1st quartile, median,
74       3rd quartile, and given percentile are calculated.  If the -g  flag  is
75       given the results are presented in a format suitable for use in a shell
76       script.  If the -t flag is given the results are presented  in  tabular
77       format  with  the  given  field separator. The table can immediately be
78       converted to a vector attribute table which can then  be  linked  to  a
79       vector,  e.g.  the vector that was rasterized to create the zones input
80       raster.
81

NOTES

83       As with most GRASS raster3d modules, r3.univar operates  on  the  voxel
84       array  defined  by  the  current  3d  region settings, not the original
85       extent and resolution of the input map. See g.region.
86
87       This module can use large amounts of system memory when the -e extended
88       statistics flag is used with a very large region setting. If the region
89       is too large the module should exit gracefully with a memory allocation
90       error. Basic statistics can be calculated using any size input region.
91

EXAMPLE

93       Computing  univariate statistics of a 3D raster with randomly generated
94       values:
95       # define volume
96       g.region n=10 s=0 w=0 e=10 b=0 t=10 res=1 res3=1 -p3
97       # generate random map
98       r3.mapcalc "random_0_1 = rand(0., 1)" -s
99       # compute univariate statistics, along with extended statistics
100       r3.univar -e map=random_0_1 percentile=98
101        100%
102       total null and non-null cells: 1000
103       total null cells: 0
104       Of the non-null cells:
105       ----------------------
106       n: 1000
107       minimum: 0.00053905
108       maximum: 0.998322
109       range: 0.997783
110       mean: 0.513676
111       mean of absolute values: 0.513676
112       standard deviation: 0.289969
113       variance: 0.0840821
114       variation coefficient: 56.4498 %
115       sum: 513.676463040334
116       1st quartile: 0.257654
117       median (even number of cells): 0.524313
118       3rd quartile: 0.763637
119       98th percentile: 0.982924
120       # script style output, along with extended statistics
121       r3.univar -ge map=random_0_1 percentile=98
122       n=1000
123       null_cells=0
124       cells=1000
125       min=0.000539049520323687
126       max=0.998322037540536
127       range=0.997782988020212
128       mean=0.513676463040334
129       mean_of_abs=0.513676463040334
130       stddev=0.289969154194666
131       variance=0.0840821103843701
132       coeff_var=56.4497646005434
133       sum=513.676463040334
134       first_quartile=0.257654
135       median=0.524313
136       third_quartile=0.763637
137       percentile_98=0.982924
138

TODO

140       To be implemented mode, skewness, kurtosis.
141

SEE ALSO

143        g.region, r.univar, r.mode, r.quantile, r.series, r3.stats,  r.statis‐
144       tics, v.rast.stats, v.univar
145

AUTHORS

147       Soeren Gebbert
148       Code is based on r.univar from
149       Hamish Bowman, Otago University, New Zealand
150       and Martin Landa
151       Zonal loop by Markus Metz
152

SOURCE CODE

154       Available at: r3.univar source code (history)
155
156       Main  index | 3D raster index | Topics index | Keywords index | Graphi‐
157       cal index | Full index
158
159       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
160
161
162
163GRASS 7.8.5                                                       r3.univar(1)
Impressum