Learn R Programming

prioritizr (version 3.0.4)

add_boundary_penalties: Add boundary penalties

Description

Add penalties to a conservation problem to favor solutions that clump selected planning units together into contiguous reserves.

Usage

add_boundary_penalties(x, penalty, edge_factor, boundary_data = NULL)

Arguments

penalty

numeric penalty for exposed edges. This is equivalent to the boundary length modifier (BLM) parameter in Marxan.

edge_factor

numeric proportion to scale edges that do not have any neighboring planning units. For example, an edge factor of 0.5 is commonly used for planning units along the coast line.

boundary_data

A matrix or data.frame object showing the shared boundary lengths between planning units. If boundary_data is a matrix then each row and column denote a planning unit and cell values represent their shared boundary. If boundary_data is data.frame then it must have the columns "id1", "id2", and "boundary", where each row shows the shared boundary between two planning units (as per the standard Marxan input format). This argument is required if the planning units in x are stored in a data.frame object. Otherwise, it is optional and the boundary data will be automatically calculated. Note that the boundary_data must be denote symmetric relationships between planning units. If asymmetric relationships are required, use the add_connectivity_penalties function.

Value

ConservationProblem-class object.

Details

These penalties use shared boundary length as a measure of connectivity, equivalent to the boundary length modifier (BLM) in Marxan. Boundary data is calculated automatically unless the planning units in x are stored in a data.frame, in which case boundary data must be added as a matrix or data.frame. For a given side of a planning unit (indexed by \(i\)) with a known length (\(l_i\)) and the arguments to penalty (\(p\)) and edge_factor (\(e\)), the cost incurred by this side being exposed in a solution is calculated as: $$l_i \space \times p \space \times \mathit{ifelse}( \mathit{i \space overlaps \space with \space the \space side \space of \space another \space planning \space unit}, 1, e)$$ This function can only be used for symmetric relationships between planning units; for asymmetric relationships use the add_connectivity_penalties function. This function is inspired by Ball et al. (2009) and Beyer et al. (2016).

References

Ball IR, Possingham HP, and Watts M (2009) Marxan and relatives: Software for spatial conservation prioritisation in Spatial conservation prioritisation: Quantitative methods and computational tools. Eds Moilanen A, Wilson KA, and Possingham HP. Oxford University Press, Oxford, UK.

Beyer HL, Dujardin Y, Watts ME, and Possingham HP (2016) Solving conservation planning problems with integer linear programming. Ecological Modelling, 228: 14--22.

See Also

penalties.

Examples

Run this code
# NOT RUN {
# create basic problem
p1 <- problem(sim_pu_raster, sim_features) %>%
      add_min_set_objective() %>%
      add_relative_targets(0.2) %>%
      add_default_solver()

# create problem with low boundary penalties
p2 <- p1 %>% add_boundary_penalties(5, 1)

# create problem with high boundary penalties but outer edges receive
# half the penalty as inner edges
p3 <- p1 %>% add_boundary_penalties(50, 0.5)
# }
# NOT RUN {
# solve problems
s <- stack(solve(p1), solve(p2), solve(p3))

# plot solutions
plot(s, main = c("basic solution", "small penalties", "high penalties"),
     axes = FALSE, box = FALSE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab