r.stats.quantile(1)

πŸ’– r.stats.quantile πŸ’–

okay bestie, welcome to the GRASS GIS User's Manual glow-up of r.stats.quantile(1) β€” literally the quantile girlie of the raster world, and yes she ate ✨


✨ NAME ✨

r.stats.quantile β€” compute category quantiles using two passes. periodt. πŸŽ€


🌸 KEYWORDS 🌸

raster, statistics, zonal statistics, percentile, quantile


πŸ¦‹ SYNOPSIS πŸ¦‹

r.stats.quantile
r.stats.quantile --help
r.stats.quantile [-rpt] base=name cover=name  [quantiles=integer]
[percentiles=float[,float,...]]   [bins=integer]
[output=name[,name,...]]   [file=name]   [separator=character]
[--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • -r β€” make a reclass map and use the statistics as category labels πŸ’…
  • -p β€” don't make any output maps, just print the statistics. no maps, all vibes.
  • -t β€” print the statistics in table format 🧚
  • --overwrite β€” let output files overwrite stuff that already exists (yes, she's allowed to delete your old files, consent given)
  • --help β€” print the usage summary, iykyk
  • --verbose β€” verbose module output, she will tell you EVERYTHING
  • --quiet β€” quiet module output, she will tell you nothing
  • --ui β€” force launching the GUI dialog 🌈

πŸ“ Parameters πŸ“

  • base=name [required] β€” name of base raster map
  • cover=name [required] β€” name of cover raster map
  • quantiles=integer β€” number of quantiles
  • percentiles=float[,float,...] β€” list of percentiles
    • Default: 50
  • bins=integer β€” number of bins to use
    • Default: 1000
  • output=name[,name,...] β€” resultant raster map(s)
  • file=name β€” name for output file (if omitted or - output to stdout)
  • separator=character β€” field separator
    • Special characters: pipe, comma, space, tab, newline
    • Default: :

πŸ’œ DESCRIPTION πŸ’œ

okay so r.stats.quantile is a tool to analyse exploratory statistics of a floating-point "cover layer" according to how it intersects with objects in a "base layer". it provides quantile calculations as selected "zonal statistics". it's giving zonal, it's giving statistics, it's giving main character energy fr fr πŸ‘‘


πŸ”₯ NOTES πŸ”₯

r.stats.quantile is intended to be a partial replacement for r.statistics, with support for floating-point cover maps. it provides quantile calculations, which are absent from r.stats.zonal. (not me being the upgrade, not me being the moment πŸ’…)

Quantiles are calculated following algorithm 7 from Hyndman and Fan (1996), which is also the default in R and numpy. no cap, same algorithm, iconic behaviour. ⭐


🌟 EXAMPLE 🌟

In this example, the raster polygon map zipcodes in the North Carolina sample dataset is used to calculate quantile raster statistics using the elevation raster map:

g.region raster=zipcodes -p
# print quantiles
r.stats.quantile base=zipcodes cover=elevation quantiles=3 -p
27511:0:33.333333:134.717392
27511:1:66.666667:143.985723
27513:0:33.333333:140.669993
27513:1:66.666667:146.279449
27518:0:33.333333:115.140101
27518:1:66.666667:129.893723
[...]
# write out percentile raster maps
r.stats.quantile base=zipcodes cover=elevation percentiles=25,50,75 \
  output=zipcodes_elev_q25,zipcodes_elev_q50,zipcodes_elev_q75

look at those numbers go 😭 so pretty, so precise 🫢


πŸ“š REFERENCES πŸ“š

  • Hyndman and Fan (1996) Sample Quantiles in Statistical Packages, American Statistician. American Statistical Association. 50 (4): 361-365. DOI: 10.2307/2684934
  • Engineering Statistics Handbook: Percentile, NIST

πŸ‘€ SEE ALSO πŸ‘€

r.quantile, r.stats.zonal, r.statistics

go read those too bestie, the crossover episode is real 🌈


πŸ’– AUTHORS πŸ’–

Glynn Clements Markus Metz

(legends, honestly πŸ‘‘βœ¨)


πŸŽ€ SOURCE CODE πŸŽ€

Available at: r.stats.quantile source code (history)

Accessed: Saturday Jan 17 05:41:00 2026

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


and that's the whole thing, bestie πŸ’… this was r.stats.quantile from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, and this lil page was accessed Saturday Jan 17 05:41:00 2026 β€” go compute some quantiles, you're gonna slay πŸ¦‹πŸŒΈπŸ’œ

πŸ“¦ where this page comes from