replace_model: Replace a model with new values

Description Usage Arguments Value Examples

View source: R/modify.R

Description

Replace a model with new values

Usage

1
replace_model(l, path, model)

Arguments

l

the list of apsimx file

path

If numeric, the path returned by search_path or search_node. If character, the path supported by apsimx

model

A new model

Value

The modified list with new value

Examples

1
2
3
4
5
6
7
wheat <- read_apsimx(system.file("Wheat.json", package = "rapsimng"))

a <- search_path(wheat, '[Wheat].Phenology.ThermalTime')
a$node$Children[[1]]$X[[2]] <- 27
wheat_new <- replace_model(wheat, a$path, a$node)
b <- search_path(wheat_new, '[Wheat].Phenology.ThermalTime')
b$node$Children[[1]]$X

rapsimng documentation built on Sept. 9, 2021, 9:07 a.m.