Read in the atlantis dietcheck.txt file and perform some basic data transformations.

load_dietcheck(
  dietcheck,
  fgs,
  prm_run,
  convert_names = FALSE,
  report = FALSE,
  version_flag = 2
)

Arguments

dietcheck

Character string giving the connection of the dietcheck file. The filename usually contains Dietcheck and ends in .txt".

fgs

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

prm_run

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

convert_names

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

report

Logical indicating if incomplete DietCheck information shall be printed TRUE or not FALSE.

version_flag

The version of ATLANTIS model. 1 for bec_dev, 2 for trunk. default is 2..

Value

A data.frame in long format with the following column names: time, pred, habitat, prey and atoutput (i.e., variable).

See also

Examples

# Apply to bec-dev models. d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools") dietcheck <- file.path(d, "outputSETASDietCheck.txt") fgs <- file.path(d, "SETasGroups.csv") prm_run <- file.path(d, "VMPA_setas_run_fishing_F_New.prm") diet <- load_dietcheck(dietcheck, fgs, prm_run, version_flag = 1) head(diet, n = 10)
#> time pred habitat prey atoutput #> 1 0.2 CEP WC FPS 0.001538030 #> 4 0.4 CEP WC FPS 0.001944710 #> 7 0.6 CEP WC FPS 0.001812472 #> 10 0.8 CEP WC FPS 0.001615199 #> 13 1.0 CEP WC FPS 0.002414731 #> 16 1.2 CEP WC FPS 0.002694080 #> 19 1.4 CEP WC FPS 0.006028808 #> 22 1.6 CEP WC FPS 0.005396391 #> 25 1.8 CEP WC FPS 0.010229410 #> 28 2.0 CEP WC FPS 0.012357000
# Apply to trunk models. d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools") dietcheck <- file.path(d, "outputSETASDietCheck.txt") fgs <- file.path(d, "SETasGroupsDem_NoCep.csv") prm_run <- file.path(d, "VMPA_setas_run_fishing_F_Trunk.prm") diet <- load_dietcheck(dietcheck, fgs, prm_run) head(diet, n = 10)
#> time pred agecl prey atoutput #> 4 1 FPS 4 FPS 5.532030e-07 #> 5 1 FPS 5 FPS 5.532030e-07 #> 6 1 FPS 6 FPS 1.848350e-06 #> 7 1 FPS 7 FPS 1.840717e-06 #> 8 1 FPS 8 FPS 1.840717e-06 #> 9 1 FPS 9 FPS 1.832925e-06 #> 10 1 FPS 10 FPS 1.832925e-06 #> 11 1 FVS 1 FPS 4.424449e-04 #> 12 1 FVS 2 FPS 4.105409e-04 #> 13 1 FVS 3 FPS 7.037268e-05