.TH r.mode 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBr.mode\fR\fR - Finds the mode of values in a cover map within areas assigned the same category value in a user-specified base map. .SH KEYWORDS raster, statistics .SH SYNOPSIS \fBr.mode\fR .br \fBr.mode help\fR .br \fBr.mode base\fR=\fIstring\fR \fBcover\fR=\fIstring\fR \fBoutput\fR=\fIstring\fR [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBbase\fR=\fIstring\fR" 4m .br Base map to be reclassified .IP "\fBcover\fR=\fIstring\fR" 4m .br Coverage map .IP "\fBoutput\fR=\fIstring\fR" 4m .br Output map .PP .SH DESCRIPTION \fIr.mode\fR calculates the most frequently occurring value (i. e., mode) of data contained in a \fIcover\fR raster map layer for areas assigned the same category value in the user-specified \fIbase\fR raster map layer. These modes are stored in the new \fIoutput\fR map layer. .PP The \fIoutput\fR map is actually a \fIreclass\fR of the \fIbase\fR map. .PP The \fBbase\fR parameter defines an existing raster map layer in the user's current mapset search path. For each group of cells assigned the same category value in the \fIbase\fR map, the mode of the values assigned these cells in the \fIcover\fR map will be computed. .PP The \fBcover\fR parameter defines an existing raster map layer containing the values to be used to compute the mode within each category of the \fIbase\fR map. .SH NOTES The user should use the results of \fIr.mode\fR with care. Since this utility assigns a value to each cell which is based on global information (i.e., information at spatial locations other than just the location of the cell itself), the resultant map layer is only valid if the geographic region and mask settings are the same as they were at the time that the result map was created. .PP Results are affected by the current region settings and mask. .SH EXAMPLE Mode of K-factor (erosion) for Spearfish fields: \fC .DS .br g.region rast=fields \-p .br r.mode base=fields cover=soils.Kfactor output=K.by.farm.mode .br r.univar K.by.farm.mode .br .DE \fR .SH SEE ALSO \fIg.region\fR, \fIr.average\fR, \fIr.category\fR, \fIr.clump\fR, \fIr.describe\fR, \fIr.mapcalc\fR, \fIr.median\fR, \fIr.mfilter\fR, \fIr.neighbors\fR, \fIr.reclass\fR, \fIr.stats\fR, \fIr.statistics\fR, \fIr.univar\fR .SH AUTHOR Michael Shapiro, U.S.Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2008-05-16 21:09:06 +0200 (Fri, 16 May 2008) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team