Skip to contents

Run a given step of a given model

Usage

run_model_step(
  project,
  modelId,
  modelStep,
  parameterValues,
  silent = clairvoyant::opts$get("silent")
)

Arguments

project

The project, as imported with read_project()

modelId

The identifier of the model to run

modelStep

The step (as a number) of the model to run

parameterValues

The parameter values to use, as a named list

silent

Whether to be silent or chatty.

Value

The result of evaluating the expression forming this model's step

Examples

### Get the path to an example project
exampleProjectPath <-
  system.file(
    "example1",
    package = "clairvoyant"
  );

### Import it
exampleProject <-
  clairvoyant::read_project(
    exampleProjectPath
  );

### Run one model step
clairvoyant::run_model_step(
  project = exampleProject,
  modelId = "basic_model",
  modelStep = 1,
  parameterValues = 
    list(
      salePrice = 10,
      productionCosts = 5
    )
);
#> [1] 5