add_feature_weights: Add feature weights

Description Usage Arguments Details Value See Also Examples

Description

Conservation planning problems that aim to maximize the representation of enough. In such budget-limited problems, it may be desirable to prefer the representation of some features over others. Weights can be be applied to a problem to favour the representation of some features over others when making decisions about how the budget should be allocated.

Usage

1

Arguments

x

ConservationProblem-class object.

weights

numeric weights. Features with higher weights indicate that it is more desireable to represent them in the solution. Weights cannot have negative values.

Details

Weights can only be applied to a budget-limited type of planning problem (ie. add_max_cover_objective, and add_max_features_objective. Weights can also be applied to problems that aim to maximise phylogenetic representation (add_max_phylo_objective) to favour the representation of specific features over the representation of some phylogenetic branches.

Value

ConservationProblem-class object with the weights added to it.

See Also

targets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# create problem
p1 <- problem(sim_pu_raster, sim_features) %>%
  add_max_cover_objective(budget=5000)

# create weights based on rarity (1/number occurrences)
w <- 1 / cellStats(sim_features, "sum") * 1000

# create new problem with added weights according to rarity
p2 <- p1 %>% add_feature_weights(w)


# solve solutions
s <- stack(solve(p1), solve(p2))

# plot solutions
plot(s, main = c("equal weights", "rarity weights"))

prioritizr/prioritizrutils documentation built on May 25, 2019, 12:20 p.m.