Updates the [Factors].Permutation.SowingDate factor in an APSIM Next Generation model using a resolved sowing window. The function expands the supplied start and end dates into a comma-separated sequence at 3-day intervals and stores the resulting schedule under attr(x, "agrillm")$sowing.

apply_sowing(apsimx, sowing)

Arguments

apsimx

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

sowing

List describing resolved sowing input, typically from resolve_sowing(). Expected to include start and end as dd-mon strings.

Value

A modified APSIM model object with updated sowing permutations.

See also

Examples

if (FALSE) { # \dontrun{
apsimx_path <- system.file("examples", "wheat.apsimx", package = "agrillm")
apsimx <- rapsimng::read_apsimx(apsimx_path)
sowing <- list(start = "01-may", end = "07-may")
updated <- apply_sowing(apsimx, sowing)
attr(updated, "agrillm")$sowing
} # }