Skip to contents

Outputs basic parameters or mortalities from a rpath() object to a .csv or .RData file.

Usage

write.Rpath(x, file = NA, morts = F)

Arguments

x

Rpath model object generated by rpath().

file

file name for resultant file. Need to specify ".csv" or ".RData".

morts

Logical value whether to output basic parameters or mortalities.

Value

Writes a list object or file with the basic parameters or mortalities from an Rpath object.

If morts = F, output reflects the basic parameters of the mass-balanced model, namely:

Group

Vector of group names

type

Vector of group types: 0 = consumer, 1 = producer, 2 = detritus, 3 = fishery

TL

Vector of trophic level for each group, calculated based on mass balance

Biomass

Vector of biomass values for each modeled group

PB

Vector of production:biomass ratios for each modeled group

QB

Vector of consumption:biomass ratios for each modeled group

EE

Vector of ecotrophic efficiency values for each modeled group

GE

Vector of gross efficiency values (production:comsumption ratios) for each modeled group

Removals

Vector of total fishery removals for each modeled group

If morts = T, output reflects calculated mortality values for each group. The number of columns will vary based on how many predators are in the model.

Group

Vector of group names

M0

Vector of natural mortality for each group. Natural mortality = PB * (1-EE)

Fmort

Vector of fishing mortality for each group

M2.XX

Vector of predation mortality, where XX is the name of a predator group

Examples

if (FALSE) { # \dontrun{
# Read in Rpath parameter file, generate model object
x <- rpath(AB.params)
# Saves basic model parameters for all groups to the root directory of users project
write.Rpath(x, file = "output.csv", morts = F)
# Calculates natural mortality (M0), fishing mortality by fleet, and predation mortality by predator (M2) on each group
# Writes output to an Rdata file in the root directory of users project
write.Rpath(x, file = here::here("output.RData"), morts = T)
} # }