set_init: Set initial conditions in a network model

View source: R/ui_model-building.R

set_initR Documentation

Set initial conditions in a network model

Description

Set initial conditions in a network model

Usage

set_init(nm, data, comp, size, prop, group_by = NULL)

Arguments

nm

A networkModel object (e.g. output from new_networkModel)

data

A tibble containing the initial conditions

comp

String, name of the data column with the compartment names

size

String, name of the data column with the compartment sizes

prop

String, name of the data column with the compartment proportions of marked tracer

group_by

Optional vector of string giving the names of the columns to use for grouping the data into replicates

Value

A networkModel object.

Examples

# Using the topology from the Trinidad case study
m <- new_networkModel() %>%
  set_topo("NH4, NO3 -> epi, FBOM", "epi -> petro, pseph",
           "FBOM -> tricor", "petro, tricor -> arg")

# Taking initial condtions from the 'lalaja' dataset at t=0
inits <- lalaja[lalaja[["time.days"]] == 0, ]
inits
m <- set_init(m, inits, comp = "compartment", size = "mgN.per.m2",
              prop = "prop15N", group_by = "transect")
m


isotracer documentation built on Sept. 22, 2023, 1:07 a.m.