Load an AgMIP calibration protocol Excel file

load_protocol_agmip(protocol_file_path)

Arguments

protocol_file_path

Character string. Path to the Excel file describing an AgMIP calibration protocol.

Value

A list with the following elements:

step

A list of groups, each containing major parameters, candidate parameters, and observed variables.

param_info

A list containing parameter bounds (lb, ub) and default values (default).

forced_param_values

(Optional) Named vector of parameter values or formulas to fix, if defined in the protocol file. This element is present only if the protocol defines fixed or computed parameters.

Details

Reads an AgMIP calibration protocol file in Excel format and verifies its structure. The Excel file must follow the AgMIP protocol template structure provided by CroptimizR.

The function loads the following sheets: variables, major_parameters, candidate_parameters, and the optional fixed_or_computed_parameters sheet. It returns them as a structured list suitable for use in run_protocol_agmip.

The protocol specification follows the AgMIP methodology (Wallach et al., 2024; Wallach et al., 2025).

Excel template and example

CroptimizR provides helper functions to access a ready-to-use Excel template and a fully worked example:

  • get_agmip_protocol_template to obtain the official Excel template of the AgMIP protocol. This template must be filled by the user before being used with load_protocol_agmip().

  • get_agmip_protocol_example to access a complete example used for demonstration and testing.

Both functions can either return the path to the file shipped with the package or copy it to a user-defined location for editing.

Examples

# Load the example protocol shipped with the package
protocol_file <- get_agmip_protocol_example()
protocol <- load_protocol_agmip(protocol_file)