Learn R Programming

sdbuildR (version 2.0.0)

compare_models: Compare two stock-and-flow models

Description

Compares the structure, equations, and simulation settings of two stockflow models, and computes a nonlinearity score for each.

Usage

compare_models(sfm1, sfm2)

Value

An object of class compare_stockflow (a list) containing:

labels

Names of the two model objects (captured expressions).

added

Variables present in sfm2 but not sfm1.

removed

Variables present in sfm1 but not sfm2.

type_changed

Variables with different types.

eqn_changed

Variables with different equations.

sim_settings_diff

Simulation settings that differ.

properties

Per-model counts and nonlinearity scores.

Arguments

sfm1

A stock-and-flow model of class stockflow.

sfm2

A stock-and-flow model of class stockflow.

See Also

Examples

Run this code
sfm1 <- stockflow("SIR")
sfm2 <- stock(sfm1, "susceptible", eqn = 0.5)
compare_models(sfm1, sfm2)

Run the code above in your browser using DataLab