Package 'rapsimng.decide.core'

Title: Decision-Oriented Analysis Core for APSIM Next Generation Outputs
Description: Provides a low-level interface for analysing Agricultural Production Systems sIMulator ('APSIM') Next Generation simulation outputs to support structured decision-making workflows.
Authors: Bangyou Zheng [aut, cre]
Maintainer: Bangyou Zheng <[email protected]>
License: MIT + file LICENSE
Version: 0.1.2
Built: 2026-11-21 11:33:22 UTC
Source: https://github.com/cran/rapsimng.decide.core

Help Index


Build output lines for a decision report document

Description

Converts a rapsimng_decide_document object into a character vector that can be written to disk. A document prefix is written first when present, then each non-NULL section body separated by blank lines.

Usage

document_lines(document)

Arguments

document

A report object with class rapsimng_decide_document.

Value

A character vector containing the ordered document lines.


Read APSIMX output

Description

Read APSIMX output

Usage

read_output(apsimx_file, report = "HarvestReport", years = NULL)

Arguments

apsimx_file

The path to the APSIMX output file (.apsimx)

report

The name of the report to read from the APSIMX output ( default: "HarvestReport")

years

Optional numeric vector of years to filter the output by (e.g., 1996:2025)

Value

A data frame containing the APSIMX output data

Examples

apsimx_file <- system.file(
  "example", "cultivar.apsimx",
  package = "rapsimng.decide.core"
)
output <- read_output(apsimx_file, years = 2010:2011)
head(output)

Write a decision report document to disk

Description

Serialises a rapsimng_decide_document with document_lines() and writes the resulting text file to path.

Usage

write_document(document, path, overwrite = FALSE)

Arguments

document

A report object with class rapsimng_decide_document.

path

A single output file path.

overwrite

Logical scalar indicating whether an existing file may be replaced.

Value

Invisibly returns path.