Reads in the specificMort.txt file. Three values of instantaneous mortality for each functional group, age group, and stock. Predation (M2), other natural mortality (M1), Fishing (F)

load_spec_mort(mortFile, prm_run, fgs, convert_names = FALSE, removeZeros = T)

Arguments

mortFile

Character string giving the path to the specificMort.txt file. The filename usually contains SpecificMort and ends in .txt".

prm_run

Character string giving the connection of the run parameterfile. The filename usually contains run_fishing and ends in .prm".

fgs

Character string giving the connection to the functional groups file. The filename usually contains Groups and does end in .csv.

convert_names

Logical indicating if group codes are transformed to LongNames (TRUE) or not (default = FALSE).

removeZeros

Boolean. Remove all zeros from output. (Default = T)

Value

Data frame with information about sources of mortality (M1, M2, F).

See also

Examples

d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools") specmort <- file.path(d, "outputSETASSpecificMort.txt") prm_run <- file.path(d, "VMPA_setas_run_fishing_F_New.prm") fgs <- file.path(d, "SETasGroups.csv") df <- load_spec_mort(specmort, prm_run, fgs) head(df)
#> # A tibble: 6 × 5 #> time code agecl mort atoutput #> <dbl> <chr> <dbl> <chr> <dbl> #> 1 1 FPS 1 M1 1.19e- 6 #> 2 2 FPS 1 M1 1.57e+18 #> 3 1 FPS 2 M1 9.92e- 7 #> 4 2 FPS 2 M1 2.27e- 6 #> 5 1 FPS 3 M1 9.51e- 7 #> 6 2 FPS 3 M1 1.83e- 6
d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools") specmort <- file.path(d, "outputSETASSpecificMort.txt") prm_run <- file.path(d, "VMPA_setas_run_fishing_F_Trunk.prm") fgs <- file.path(d, "SETasGroupsDem_NoCep.csv") df <- load_spec_mort(specmort, prm_run, fgs) head(df)
#> # A tibble: 6 × 5 #> time code agecl mort atoutput #> <dbl> <chr> <dbl> <chr> <dbl> #> 1 1 FPS 1 M1 0.000000992 #> 2 2 FPS 1 M1 0.00000150 #> 3 1 FPS 2 M1 0.000000995 #> 4 2 FPS 2 M1 0.00000228 #> 5 1 FPS 3 M1 0.000000954 #> 6 2 FPS 3 M1 0.00000185