struc_impacts_on: Construct impact equations for a given stock (level)

Description Usage Arguments Value Examples

View source: R/impact.R

Description

Construct impact equations for a given stock (level)

Usage

1
struc_impacts_on(stk, inputs, simplify = TRUE)

Arguments

stk

A string that indicates the stock's name

inputs

A list of three elements (flows, pathways, velocities). One can obtain this list automatically from the function sd_impact_inputs from the package readsdr.

simplify

A boolean that indicates whether the analytical expression is algebraically simplified

Value

A data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 flows <- data.frame(
   stock    = c("x", "y", "y", "z", "z"),
   flow     = c("f1", "f1", "f2", "f2", "f3"),
   sign     = c("-", "+", "-", "+", "-"),
   equation = c("R*x*z", "R*x*z", "a*y", "a*y", "y"))

 pathways <- data.frame(
 from    = c("z", "x", "z", "x", "y", "y", "z"),
 to      = c("x", "x", "y", "y", "y", "z", "z"),
 through = c("f1", "f1", "f1", "f1", "f2", "f2", "f3"))

 velocities <- data.frame(
   stock    = c("x", "y", "z"),
   equation = c(
     "-R * x * z",
     " R * x * z - a * y",
     "a * y - z"))

 inputs <- list(flows      = flows,
                pathways   = pathways,
                velocities = velocities)

 struc_impacts_on("x", inputs)

jandraor/structuR documentation built on Feb. 11, 2022, 10:24 p.m.