Extract parameters from the biological parameter file and transform them to a dataframe.

prm_to_df(prm_biol, fgs, group, parameter)

prm_to_df_ages(prm_biol, fgs, group, parameter)

Arguments

prm_biol

Character string giving the connection to the biological parameterfile. The filename usually contains biol_fishing and does end in .prm.

fgs

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

group

Character vector giving the functional Groups to extract.

parameter

Character vector giving the parameters to extract.

Value

Dataframe with columns 'species' and as many columns as parameters.

Examples

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") group <- c("FPS", "FVS") parameter <- c("mum", "C") prm_to_df_ages(prm_biol, fgs, group, parameter)
#> species agecl c mum #> 1 Small planktivorous fish 1 2.0e-04 0.003 #> 2 Small planktivorous fish 2 3.0e-01 0.500 #> 3 Small planktivorous fish 3 6.0e-01 0.500 #> 4 Small planktivorous fish 4 6.0e-01 0.500 #> 5 Small planktivorous fish 5 6.0e-01 0.500 #> 6 Small planktivorous fish 6 6.0e-01 0.500 #> 7 Small planktivorous fish 7 5.0e-01 0.500 #> 8 Small planktivorous fish 8 5.0e-01 0.500 #> 9 Small planktivorous fish 9 4.0e-01 0.500 #> 10 Small planktivorous fish 10 4.0e-01 0.500 #> 11 Shallow piscivorous fish 1 4.0e+01 150.000 #> 12 Shallow piscivorous fish 2 4.0e+01 150.000 #> 13 Shallow piscivorous fish 3 4.0e+01 150.000 #> 14 Shallow piscivorous fish 4 1.2e+02 250.000 #> 15 Shallow piscivorous fish 5 1.5e+02 250.000 #> 16 Shallow piscivorous fish 6 2.5e+02 250.000 #> 17 Shallow piscivorous fish 7 2.5e+02 250.000 #> 18 Shallow piscivorous fish 8 3.0e+02 250.000 #> 19 Shallow piscivorous fish 9 3.0e+02 250.000 #> 20 Shallow piscivorous fish 10 3.0e+02 250.000
prm_to_df(prm_biol, fgs, group, parameter)
#> species c mum #> 1 Small planktivorous fish 10 10 #> 2 Shallow piscivorous fish 10 10