Extract the names of zones in an object.

zone_names(x)

# S4 method for ConservationProblem
zone_names(x)

# S4 method for ZonesRaster
zone_names(x)

# S4 method for ZonesCharacter
zone_names(x)

Arguments

x

problem() (i.e., ConservationProblem) or Zones()

Value

character zone names.

Examples

# load data
data(sim_pu_zones_stack, sim_features_zones)

# print names of zones in a Zones object
print(zone_names(sim_features_zones))
#> [1] "zone_1" "zone_2" "zone_3"
# create problem with multiple zones
p <- problem(sim_pu_zones_stack, sim_features_zones) %>%
     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"