plot the frequency histogram of values of a raster, divided by band

plot_rasthist(in_rast, variable = "freq", type = "hist",
  verbose = TRUE)

Arguments

in_rast

a Raster object, or a file path corresponding to a valid raster file

variable

character ["count" | "freq"] variable to be plotted, can be the count of pixels or their frequency, Default: 'freq'

type

character ["hist" or "line"], plotting style. Use a "bar" or a "line" plot, Default: 'line'

verbose

If FALSE, suppress processing messages, Default: TRUE

Value

A ggplot

Examples

in_rast <- read_rast(system.file("extdata/OLI_test", "oli_multi_1000.tif", package = "sprawl.data")) plot_rasthist(in_rast, type = "line")
#> plot_rasthist --> Plotting histogram of `in_rast`
#> get_rastinfo --> Retrieving info from: `in_rast`
#> get_raststats --> Computing statistics of `in_rast`