Updates the [Factors].Permutation.Fertilisation factor in an APSIM Next Generation model. If a measured fertilisation amount is supplied, that value is used directly. Otherwise the default scenario sequence 0, 40, ..., 440 is applied. The function stores the resulting schedule under is retained. Applied evidence is stored under attr(x, "agrillm")$fertilisation_n.

apply_fertilisation_n(apsimx, fertilisation_n)

Arguments

apsimx

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

fertilisation_n

List describing resolved fertilisation nitrogen input, typically from resolve_fertilisation_nitrogen().

Value

A modified APSIM model object with updated fertilisation scenarios.

Examples

if (FALSE) { # \dontrun{
apsimx_path <- system.file("examples", "wheat.apsimx", package = "agrillm")
apsimx <- rapsimng::read_apsimx(apsimx_path)
fert_n <- list(value = 80)
updated <- apply_fertilisation_n(apsimx, fert_n)
attr(updated, "agrillm")$fertilisation_n
} # }