Description Usage Arguments Value Examples
View source: R/load-dietmatrix.R
Extracts the diet matrix as long dataframe from the biological paremeter file of any ATLANTIS simulation.
| 1 2 3 4 5 6 7 8 9 | load_dietmatrix(
  prm_biol,
  fgs,
  transform = TRUE,
  convert_names = FALSE,
  version_flag = 2
)
write_diet(dietmatrix, prm_biol, save_to_disc = TRUE)
 | 
| prm_biol | Character string giving the connection to the biological parameterfile.
The filename usually contains  | 
| fgs | Character string giving the connection to the functional groups file.
The filename usually contains  | 
| transform | Boolean indicating if the returned dataframe is displayed in
"long" ( | 
| convert_names | Logical indicating if group codes are transformed to LongNames ( | 
| version_flag | The version of ATLANTIS model. 1 for bec_dev, 2 for trunk.  | 
| dietmatrix | Dataframe of the ATLANTIS dietmatrix generated with  | 
| save_to_disc | Logical indicating if the resulting prm file should be overwritten
( | 
dataframe of the availability matrix in long format with columns pred, pred_stanza (1 = juvenile, 2 = adult), prey_stanza, prey, avail, code.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Can be applied to trunk models.
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")
dm <- load_dietmatrix(prm_biol, fgs)
head(dm, n = 10)
# Use write_diet to update your existing parameterfile.
dietmatrix <- load_dietmatrix(prm_biol, fgs, transform = FALSE)
# Write is set to FALSE here for technical reasons. Make sure to set it to TRUE in case you
# want to update your file.
new_diet <- write_diet(dietmatrix, prm_biol, save_to_disc = FALSE)
# And to bec-dev models.
d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools")
prm_biol <- file.path(d, "VMPA_setas_biol_fishing_New.prm")
fgs <- file.path(d, "SETasGroups.csv")
dm <- load_dietmatrix(prm_biol, fgs, version_flag = 1)
head(dm, n = 10)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.