Skip to contents

sample_days_mat() reads the initial days to maturity values for the selected crop_names from the unchanged plants.plt file (saved in ./backup/plants.plt) and generates a parameter table which can be used with the SWATrunR function run_swatplus() perform simulations with changed days to maturity values for the selected crops.

Usage

sample_days_mat(
  crop_names,
  change_min = -60,
  change_max = 90,
  change_step = 10
)

Arguments

crop_names

Character vector with names of selected crops. All crops must be defined in the plants.plt backup file saved in ./backup/plants.plt

change_min

Minimum value of change for the days to maturity. Default is -60.

change_max

Minimum value of change for the days to maturity. Default is 90.

change_step

Minimum value of change for the days to maturity. Default is 10.

Value

A parameter input table for the input argument parameter of the SWATrunR function run_swatplus().

Examples

if (FALSE) {
library(SWATtunR)

# Crops for which days to maturity values are sampled
crop_names <- c('csil', 'wbar', 'sgbt', 'wwht')

# Generate a days to maturity parameter table
par_dmat <- sample_days_mat(crop_names)

par_dmat
}