Extract the number of features in an object.

number_of_features(x)

# S4 method for ConservationProblem
number_of_features(x)

# S4 method for OptimizationProblem
number_of_features(x)

# S4 method for ZonesRaster
number_of_features(x)

# S4 method for ZonesCharacter
number_of_features(x)

Arguments

x

ConservationProblem-class, OptimizationProblem-class or Zones object.

Value

integer number of features.

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 number of features print(number_of_features(p))
#> [1] 5