Skip to contents

This is an S4 object that extends the list base type. It represents an object suitable for input into a sefraModel model run.

Usage

sefraData(species_codes, name, ...)

Arguments

species_codes

character vector of species codes (must be one of species) or capture codes (must be one of codes).

name

optional character argument to identify the data. This is useful when conducting multipler model runs with different data sets. The identifier should correspond to the complete set of data, i.e. any changes to the data stored in an sefraData object should result in an new identifier.

...

additional function arguments (not used).

Value

A list containing the following information.

Identifier:

name

Data definition e.g. 'reference'

Dimensions and structural data:

species

Ordered character vector of species codes (species).

codes

Ordered character vector of capture codes (codes).

species_names

Data frame of species names.

species_groups

Character vector of species groups.

fishery_groups

Character vector of fishery groups.

id_species

Integer vector of species id values from 1 to 25.

id_codes

Integer vector of capture code id values from 1 to 40.

id_species_groups

Integer vector of species group id values.

id_fishery_groups

Integer vector of fishery group id values.

n_species

Number of species in risk assessment.

n_codes

Number of capture codes in risk assessment.

n_species_groups

Number of species groups.

n_fishery_groups

Number of fishery groups.

Mapping matrices:

species_to_code

Map of species codes to capture codes.

code_to_code

Map of captures codes to capture codes.

Look-up vectors:

code_resolution

Taxonomic resolution per code

reduce_species

Reduction from full list of species to list used in risk assessment.

reduce_codes

Reduction from full list of capture codes to list used in risk assessment.

Cryptic capture multipliers:

cryptic_capture_type

Distribution for the longline cryptic capture multiplier per species group and fishery group. Currently only the log-normal distribution is allowed.

cryptic_capture_par

Distribution parameters for the longline cryptic capture multipliers.

Biological data:

n_breeding_pairs_type and n_breeding_pairs_par

Distribution type and parameters for the number of breeding pairs per species \(N^{BP}_s\).

adult_survival_type and adult_survival_par

Distribution type and parameters for optimum adult survival per species \(S^{opt}_s\).

p_breeding_type and p_breeding_par

Distribution type and parameters for probability of breeding per species \(P^{B}_s\).

age_breeding_type and age_breeding_par

Distribution type and parameters for age at first breeding per species \(A^{curr}_s\).

p_nest

Probability of being on nest per species per month.

p_southern

Probability of being in the southern hemisphere per species per month.

Captures data frame:

n_k

Number of records.

month_k

Month id per record.

code_k

Capture code id per record.

fishery_group_k

Fishery group id per record.

captures_k

Number of captures per record.

captures_live_k

Number of live captures.

n_year_k

Number of years of capture data.

Observed overlap data frame:

n_i

Number of records.

month_i

Month id per record.

species_i

Species id per record.

species_group_i

Species group id per record.

fishery_group_i

Fishery group id per record.

overlap_i

Overlap per record.

n_year_i

Number of years of observed overlap data.

n_j

Number of records.

month_j

Month id per record.

cell_j

Cell id per record.

species_j

Species id per record.

species_group_j

Species group id per record.

fishery_group_j

Fishery group id per record.

overlap_j

Overlap per record.

n_year_j

Number of years of commercial overlap data.

Tuning:

phi

PST tuning parameter.

Slots

.Data

list containing input data

names

names for each list item

Note

Species codes (function argument species_codes) should match those listed in species or codes. If not, then the function will return an error. The object assumes that inputs are species codes unless lower taxonomic codes are included.

See also

Use phi to set or extract the \(\phi\) value. Use n_breeding_pairs, adult_survival, p_breeding or age_breeding to set or extract the corresponding biological distributions (\(N^{BP}_s\), \(S^{opt}_s\), \(P^{B}_s\) and \(A^{curr}_s\) respectively). See distributions for the statistical distributions recognised by the risk assessment model. Use cryptic_capture to set or extract cryptic capture multipliers for the surface longline fishery.

Examples

# create data object with all contributing species for DGA and DWC capture codes
dat <- sefraData(c("DGA", "DWC"))
#> capture codes input: including all contributing species
#> constructed 'sefraData' object
species_names(dat)
#> Species
#>   code          common_name                    scientific_name    genus
#> 1  DIW   Gibson's albatross      Diomedea antipodensis gibsoni Diomedea
#> 2  DQS Antipodean albatross Diomedea antipodensis antipodensis Diomedea
#> 3  DIX  Wandering albatross                   Diomedea exulans Diomedea
#> 4  DBN    Tristan albatross                 Diomedea dabbenena Diomedea
#> 5  DAM  Amsterdam albatross            Diomedea amsterdamensis Diomedea
#>        family code_resolution id_species
#> 1 Diomedeidae         species          1
#> 2 Diomedeidae         species          2
#> 3 Diomedeidae         species          3
#> 4 Diomedeidae         species          4
#> 5 Diomedeidae         species          5
capture_codes(dat)
#> 2 capture codes:
#> (empty captures data frame)
#>   code id_code resolution id_resolution
#> 1  DGA      26    complex             2
#> 2  DWC      32    complex             2
# create data object with all possible capture codes for DIW and DQS species
dat <- sefraData(c("DIW", "DQS"))
#> species codes input: including all species-dependent capture codes
#> constructed 'sefraData' object
species_names(dat)
#> Species
#>   code          common_name                    scientific_name    genus
#> 1  DIW   Gibson's albatross      Diomedea antipodensis gibsoni Diomedea
#> 2  DQS Antipodean albatross Diomedea antipodensis antipodensis Diomedea
#>        family code_resolution id_species
#> 1 Diomedeidae         species          1
#> 2 Diomedeidae         species          2
capture_codes(dat)
#> 7 capture codes:
#> (empty captures data frame)
#>   code id_code resolution id_resolution
#> 1  DIW       1    species             1
#> 2  DQS       2    species             1
#> 3  DGA      26    complex             2
#> 4  DWC      32    complex             2
#> 5  DIZ      34      genus             3
#> 6  ALZ      38     family             4
#> 7  BLZ      40      class             5