Passer au contenu

Function to create categories for plotting out of continuous data

Utilisation

elsar_continuous_to_categorical(
  raster_in,
  data_layer,
  number_categories,
  manual_breaks = NULL,
  hist_breaks_out = TRUE
)

Arguments

raster_in

The SpatRaster file to be plotted.

data_layer

The data layer with continuous data to be converted into categories.

number_categories

Number of categories to create from continuous data

manual_breaks

A vector with breaks to be used as categories.

hist_breaks_out

logical. If TRUE (default), returns the breaks used to categorise data.

Valeur de retour

A list with a df that has categories and their interval labels, as well as the interval breaks for background data.

Exemples

if (FALSE) { # \dontrun{
boundary_proj <- make_boundary(
  boundary_in = boundary_dat,
  iso3 = "NPL",
  iso3_column = "iso3cd"
  )

pus <- make_planning_units(
  boundary_proj = boundary_proj,
  iso3 = "NPL",
  pu_size = NULL,
  pu_threshold = 8.5e5,
  limit_to_mainland = FALSE
  )
wad_dat <- get_wad_data()

wadOut <- make_normalised_raster(
  raster_in = wad_dat,
  pus = pus,
  iso3 = "NPL"
  )

wad_cat <- elsar_continuous_to_categorical(
 wadOut,
 data_layer = "wad_final_cog",
 number_categories = 10
)
} # }