Extract the names of the features in an object.

feature_names(x)

# S4 method for ConservationProblem
feature_names(x)

# S4 method for ZonesRaster
feature_names(x)

# S4 method for ZonesCharacter
feature_names(x)

Arguments

x

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

Value

character feature names.

Examples

# load data
data(sim_pu_raster, sim_features)

# create problem
p <- problem(sim_pu_raster, sim_features) %>%
     add_min_set_objective() %>%
     add_relative_targets(0.2) %>%
     add_binary_decisions()

# print feature names
print(feature_names(p))
#> [1] "layer.1" "layer.2" "layer.3" "layer.4" "layer.5"