if (FALSE) {
## This example requires commercial solver from 'gurobi' package for
## portfolio = "gap". Else replace it with e.g. portfolio = "shuffle" for using
## a free solver like the one from 'highs' package.
biodiv_raster <- get_biodiv_raster()
depth_raster <- get_depth_raster()
data(biodiv_df)
out_2D_3D <- Compare_2D_3D(biodiv_raster = biodiv_raster,
depth_raster = depth_raster,
breaks = c(0, -40, -200, -2000, -Inf),
biodiv_df = biodiv_df,
budget_percents = seq(0, 1, 0.1),
budget_weights = "richness",
threads = parallel::detectCores(),
portfolio = "gap",
portfolio_opts = list(number_solutions = 10))
plot_Compare_2D_3D(out_2D_3D, to_plot="all", add_lines=FALSE)
plot_Compare_2D_3D(out_2D_3D, to_plot="all", add_lines=TRUE)
plot_Compare_2D_3D(out_2D_3D, to_plot="maps", add_lines=TRUE)
plot_Compare_2D_3D(out_2D_3D, to_plot="relative_held", add_lines=TRUE)
}
Run the code above in your browser using DataLab