Description Usage Arguments Value Examples
Create a Marxan conservation problem. Although users are encouraged to build and tailor conservation planning problems to suit their own needs, sometimes it is easier to use a more familiar "canned" approach. This function provides a convenient wrapper for generating and solving Marxan-style conservation problems. If users already have their conservation planning data in the Marxan input format, this function can also be used to read Marxan data files and solve the Marxan-style problems using exact algorithm solvers.
1 2 3 4 5 6 7 8 9 10 11 12 13 | marxan_problem(x, ...)
## Default S3 method:
marxan_problem(x, features, targets,
targets_type = c("relative", "absolute"), locked_in = waiver(),
locked_out = waiver(), penalty = 0, edge_factor = 0.5, ...)
## S3 method for class 'data.frame'
marxan_problem(x, spec, puvspr, bound = NULL, blm = 0,
asymmetric_connectivity = FALSE, ...)
## S3 method for class 'character'
marxan_problem(x, ...)
|
x |
|
... |
not used |
features |
|
targets |
|
targets_type |
|
locked_in |
Object that determines which planning units that should be locked in. See details for more information. |
locked_out |
Object that determines which planning units that should be locked out. See details for more information. |
penalty |
|
edge_factor |
|
spec |
'
|
puvspr |
|
bound |
puvspr
|
blm |
|
asymmetric_connectivity |
|
ConservationProblem-class
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # create Marxan problem using spatial data
data(sim_pu_raster, sim_features)
p1 <- marxan_problem(sim_pu_raster, features=sim_features, targets=0.2,
targets_type="relative", penalty=1,
edge_factor=0.5)
# solve problem
s1 <- solve(p1)
# show solution
plot(s1)
# create marxan problem using marxan input files
input_file <- system.file("extdata/input.dat", package="prioritizrutils")
p2 <- marxan_problem(input_file)
# solve problem
s2 <- solve(p2)
# count number of selected planning units in solution
print(sum(s2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.