Learn R Programming

isotracer (version 1.1.8)

set_init: 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)

Value

A networkModel object.

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

Examples

Run this code
# 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

Run the code above in your browser using DataLab