Class containing input data for model run
Source:R/sefraData-class.R, R/sefraData.R
sefraData-class.RdThis is an S4 object that extends the list base type. It represents an object suitable for input into a sefraModel model run.
Arguments
- species_codes
character vector of species codes (must be one of
species) or capture codes (must be one ofcodes).- 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
sefraDataobject should result in an newidentifier.- ...
additional function arguments (not used).
Value
A list containing the following information.
Identifier:
nameData definition e.g. 'reference'
Dimensions and structural data:
speciesOrdered character vector of species codes (
species).codesOrdered character vector of capture codes (
codes).species_namesData frame of species names.
species_groupsCharacter vector of species groups.
fishery_groupsCharacter vector of fishery groups.
id_speciesInteger vector of species id values from 1 to 25.
id_codesInteger vector of capture code id values from 1 to 40.
id_species_groupsInteger vector of species group id values.
id_fishery_groupsInteger vector of fishery group id values.
n_speciesNumber of species in risk assessment.
n_codesNumber of capture codes in risk assessment.
n_species_groupsNumber of species groups.
n_fishery_groupsNumber of fishery groups.
Mapping matrices:
species_to_codeMap of species codes to capture codes.
code_to_codeMap of captures codes to capture codes.
Look-up vectors:
code_resolutionTaxonomic resolution per code
reduce_speciesReduction from full list of species to list used in risk assessment.
reduce_codesReduction from full list of capture codes to list used in risk assessment.
Cryptic capture multipliers:
cryptic_capture_typeDistribution for the longline cryptic capture multiplier per species group and fishery group. Currently only the
log-normaldistribution is allowed.cryptic_capture_parDistribution parameters for the longline cryptic capture multipliers.
Biological data:
n_breeding_pairs_typeandn_breeding_pairs_parDistribution type and parameters for the number of breeding pairs per species \(N^{BP}_s\).
adult_survival_typeandadult_survival_parDistribution type and parameters for optimum adult survival per species \(S^{opt}_s\).
p_breeding_typeandp_breeding_parDistribution type and parameters for probability of breeding per species \(P^{B}_s\).
age_breeding_typeandage_breeding_parDistribution type and parameters for age at first breeding per species \(A^{curr}_s\).
p_nestProbability of being on nest per species per month.
p_southernProbability of being in the southern hemisphere per species per month.
Captures data frame:
n_kNumber of records.
month_kMonth id per record.
code_kCapture code id per record.
fishery_group_kFishery group id per record.
captures_kNumber of captures per record.
captures_live_kNumber of live captures.
n_year_kNumber of years of capture data.
Observed overlap data frame:
n_iNumber of records.
month_iMonth id per record.
species_iSpecies id per record.
species_group_iSpecies group id per record.
fishery_group_iFishery group id per record.
overlap_iOverlap per record.
n_year_iNumber of years of observed overlap data.
n_jNumber of records.
month_jMonth id per record.
cell_jCell id per record.
species_jSpecies id per record.
species_group_jSpecies group id per record.
fishery_group_jFishery group id per record.
overlap_jOverlap per record.
n_year_jNumber of years of commercial overlap data.
Tuning:
phiPST tuning parameter.
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