number_of_planning_units: Number of planning units

number_of_planning_unitsR Documentation

Number of planning units

Description

Extract the number of planning units in an object.

Usage

number_of_planning_units(x)

## S4 method for signature 'ConservationProblem'
number_of_planning_units(x)

## S4 method for signature 'OptimizationProblem'
number_of_planning_units(x)

Arguments

x

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

Value

integer number of planning units.

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 planning units
print(number_of_planning_units(p))

prioritizr documentation built on Sept. 18, 2022, 1:05 a.m.