problem: Conservation planning problem

Description Usage Arguments Value See Also Examples

Description

Create a systematic conservation planning problem. This function is used to specify the basic data used in a spatial prioritization problem: the spatial distribution of the planning units and their costs, as well as the features (eg. species, ecosystems) that need to be conserved. After constructing this object, it can be customized to meet specific objectives using targets (see targets) and constraints (see constraints).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
problem(x, features, ...)

## S3 method for class 'Raster'
problem(x, features, ...)

## S3 method for class 'Spatial'
problem(x, features, cost_column = names(x)[1], ...)

## S3 method for class 'data.frame'
problem(x, features, rij, ...)

Arguments

x

Raster-class, SpatialPolygonsDataFrame-class, or SpatialLinesDataFrame-class object specifying the planning units to use in the reserve design exercise and their corresponding cost. It may be desirable to exlcude some planning units from the analysis, for example those outside the study area. To exclude planning units, set the cost for those raster cells to NA.

features

The correct argument for features depends on the input to x.

Raster-class, Spatial-class

Raster-class object showing the distribution of conservation features. Missing values (i.e. NA values) can be used to indicate the absence of a feature in a particular cell instead of explicitly setting these cells to zero.

data.frame

data.frame object containing information on the features. The argument to feature_data must follow the conventions used by Marxan. Each row corresponds to a different feature. It must also contain the following columns:

"id"

integer unique identifier for each feature These identifiers are used in the argument to rij.

"name"

character name for each feature.

"prop"

numeric relative target for each feature (optional).

"amount"

numeric absolute target for each feature (optional).

...

not used.

cost_column

character name or integer indicating the column in the attribute table of a Spatial-class object with the cost data.

rij

data.frame containing information on the amount of each feature in each planning unit. This argument is only used argument to x is a data.frame. Similar to features, the argument to rij must follow the conventions used by Marxan. It must contain the following columns:

"pu"

integer planning unit identifier.

"species"

integer feature identifier.

"amount"

numeric amount of the feature in the planning unit.

Value

A ConservationProblem-class object containing the basic data used to build a prioritization problem.

See Also

constraints, objectives, targets.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# create problem using raster planning unit data
p1 <- problem(sim_pu_raster, sim_features) %>%
 add_min_set_objective() %>%
 add_relative_targets(0.2) %>%
 add_binary_decision()

# create problem using polygon planning unit data
p2 <- problem(sim_pu_polygons, sim_features) %>%
 add_min_set_objective() %>%
 add_relative_targets(0.2) %>%
 add_binary_decision()

# create problem using line planning unit data
p3 <- problem(sim_pu_lines, sim_features) %>%
 add_min_set_objective() %>%
 add_relative_targets(0.2) %>%
 add_binary_decision()

# create problem using point planning unit data
p4 <- problem(sim_pu_points, sim_features) %>%
 add_min_set_objective() %>%
 add_relative_targets(0.2) %>%
 add_binary_decision()


# solve problems
s <- list(solve(p1), solve(p2), solve(p3), solve(p4))

# plot solutions
par(mfrow=c(2,2))
plot(s[[1]], main = "raster data")

plot(s[[2]], main = "polygon data")
plot(s[[2]][s[[2]]$solution == 1, ], col = "darkgreen", add = TRUE)

plot(s[[3]], main = "line data")
lines(s[[3]][s[[3]]$solution == 1, ], col = "darkgreen", lwd = 2)

plot(s[[4]], main = "point data", pch = 19)
points(s[[4]][s[[4]]$solution == 1, ], col = "darkgreen", cex = 2, pch = 19)

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