Updates the [Weather] node in an APSIM Next Generation model so the FileName field points to the supplied weather file name.

apply_weather(apsimx, file)

Arguments

apsimx

APSIM model object as returned by rapsimng::read_apsimx().

file

Character scalar path to a weather file.

Value

A modified APSIM model object with updated weather file reference.

Examples

if (FALSE) { # \dontrun{
apsimx_path <- system.file("examples", "wheat.apsimx", package = "agrillm")
met_path <- system.file("examples", "wagga.met", package = "agrillm")
apsimx <- rapsimng::read_apsimx(apsimx_path)
updated <- apply_weather(apsimx, met_path)
} # }