load_diet_comp: Load Atlantis diet composition data from 'diet_check.txt'

View source: R/load_diet_comp.R

load_diet_compR Documentation

Load Atlantis diet composition data from diet_check.txt

Description

Imports the diet_check.txt output file from an Atlantis run and converts the file from wide format to long, where there are five columns: age class, time, diet composition, predator species, and prey species.

Usage

load_diet_comp(dir = getwd(), file_diet, fgs)

Arguments

dir

The directory of the atlantis model output, where the default is getwd().

file_diet

A character value, specifying the file name of the diet_check.txt output file from Atlantis. If is.null(dir), then file_diet can be the full file path or a file in your current working directory, or the file_diet will be appended to dir using file.path.

fgs

A data frame created by load_fgs that reads in the csv file containing functional group names, usually "functionalGroups.csv".

toutinc

The periodicity specified for the output of the Atlantis model. The value can either be specified manually or read in from the [...]_run.xml file using load_runprm.

Value

Returns a data frame of the data to be exported to the AtlantisOM list object. The atoutput column is diet proportion and there is an extra column identifying the prey that makes up that proportion of species (predator) diet. At present not set up for multiple stocks; function will stop.

Author(s)

Kelli Faye Johnson

See Also

Other load functions: load_agebioind(), load_bioind(), load_biolprm(), load_boxarea(), load_box(), load_bps(), load_catch(), load_detailed_diet_comp(), load_fgs(), load_fisheries(), load_meta(), load_nc_annage(), load_nc_catchtons(), load_nc(), load_runprm(), load_yoy()

Examples

d <- system.file("extdata", "SETAS_Example", package = "atlantisom")
file_diet <- grep("DietCheck", dir(d), value = TRUE)
fgs <- load_fgs(dir = d, "Functional_groups.csv")
temp <- load_diet_comp(dir = d, file_diet = file_diet, fgs = fgs)
rm(temp)


r4atlantis/atlantisom documentation built on Nov. 12, 2023, 2:59 a.m.