Skip to contents

Extract the names of zones in an object.

Usage

zone_names(x, ...)

# S3 method for ConservationProblem
zone_names(x, ...)

# S3 method for ZonesRaster
zone_names(x, ...)

# S3 method for ZonesSpatRaster
zone_names(x, ...)

# S3 method for ZonesCharacter
zone_names(x, ...)

Arguments

x

problem() or zones() object.

...

not used.

Value

A character vector of zone names.

Examples

# \dontrun{
# load data
sim_zones_pu_raster <- get_sim_zones_pu_raster()
sim_zones_features <- get_sim_zones_features()

# print names of zones in a Zones object
print(zone_names(sim_zones_features))
#> [1] "zone_1" "zone_2" "zone_3"
# create problem with multiple zones
p <-
  problem(sim_zones_pu_raster, sim_zones_features) %>%
  add_min_set_objective() %>%
  add_relative_targets(matrix(0.2, ncol = 3, nrow = 5)) %>%
  add_binary_decisions()

# print zone names in problem
print(zone_names(p))
#> [1] "zone_1" "zone_2" "zone_3"
# }