Skip to contents

This function creates a dataframe with the combination of feature targets, generated by features_targets() and the targets for constraints to be used in prioritizr

Usage

constraints_targets(feature_targets, patch_df)

Arguments

feature_targets

a dataframe of feature targets generated by features_targets()

patch_df

a dataframe generated by create_patch_df() that includes constraints for each patch and grid cell combination

Value

A dataframe to be used to specify all manual targets for prioritizr

Examples

# Import some planning data

#import planning units/ cost raster
pu_raster <- terra::rast(system.file("extdata/pu_raster.tif", package = "patchwise"))
#import species distributions - feature data for planning
species_distributions <- terra::rast(system.file("extdata/spp_distributions.tif", package = "patchwise"))

#import seamounts
seamounts <- terra::rast(system.file("extdata/seamounts.tif", package = "patchwise"))

# Create seamount patches as multi-layer raster
patches_raster <- create_patches(seamounts)

patches_df <- create_patch_df(spatial_grid = pu_raster, features = species_distributions,
patches = patches_raster, costs = pu_raster)
#> Processing patch 1 of 3
#> Processing patch 2 of 3
#> Processing patch 3 of 3

# Create targets for protection - use 20% for each feature (including 20% of whole seamounts) in this example
targets_df <- features_targets(targets = rep(0.2, (terra::nlyr(species_distributions) + 1)), features = species_distributions, pre_patches = seamounts)

# Add these targets to targets for protection for the "constraints" we introduced to protect entire seamount patches
constraints_df <- constraints_targets(feature_targets = targets_df, patch_df = patches_df)