## ----plot-options, include=FALSE----------------------------------------------
knitr::opts_chunk$set(fig.bg = "white", dev.args = list(bg = "white"))

## ----setup--------------------------------------------------------------------
library(hydromeso)

## -----------------------------------------------------------------------------
meso_scheme_rules(meso_scheme_default())

## -----------------------------------------------------------------------------
classify_mesohabitat_values(c(0, 0.61, 1.37), c(0, 0.30, 0.61))
tab <- classify_mesohabitat_table(hydromeso_example, "depth", "velocity")
summarize_mesohabitat(tab)

## -----------------------------------------------------------------------------
h <- mesohabitat_example_rasters()
r <- classify_mesohabitat_raster(h$depth, h$velocity)
summarize_mesohabitat(r)
plot_mesohabitat(r)
out <- file.path(tempdir(), "mesohabitat.tif")
write_mesohabitat(r, out, sidecar = TRUE, overwrite = TRUE)

