calculate_spatial_overlap: Calculate 3d overlap of predator groups with their prey over...

Description Usage Arguments Value Examples

View source: R/calculate-spatial-overlap.R

Description

Calculate 3d overlap of predator groups with their prey over time using Schoener Index.

Usage

1
calculate_spatial_overlap(biomass_spatial, dietmatrix, agemat)

Arguments

biomass_spatial

Biomass timeseries of each group and ageclass per polygon and layer. This dataframe should be generated with calculate_biomass_spatial.

dietmatrix

Availability matrix given in the biological parameter file. This dataframe should be generated with load_dietmatrix. Please make sure to use convert_names = TRUE in load_dietmatrix.

agemat

First mature age class for age structured groups. This dataframe should be generated with prm_to_df using "age_mat" as parameter.

Value

List of Schoener's similarity indices ranging from 1 (perfect overlap) to 0 (zero overlap). Dataframe in first listentry gives pred, pred agecl, prey, preyageclass specific index. Dataframe in second listentry gives index per pred, pred agecl. Si is calculated as weighted mean with the availabilities as weights.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Using built in datasets.
d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools")
prm_biol <- file.path(d, "VMPA_setas_biol_fishing_Trunk.prm")
fgs <- file.path(d, "SETasGroupsDem_NoCep.csv")

dietmatrix <- load_dietmatrix(prm_biol, fgs, convert_names = TRUE)
agemat <- prm_to_df(prm_biol = prm_biol, fgs = fgs,
                    group = get_age_acronyms(fgs = fgs),
                    parameter = "age_mat")

sp_overlap <- calculate_spatial_overlap(biomass_spatial = ref_bio_sp,
                                        dietmatrix = dietmatrix,
                                        agemat = agemat)

alketh/atlantistools documentation built on Oct. 30, 2021, 5:46 a.m.