| cumba_experiment | R Documentation |
Runs the daily time-step CUMBA simulation for one or more sites/experiments, computing tomato yield and Brix from weather inputs and irrigation options. The function validates inputs, converts a list-of-lists parameter object to a tibble of numeric values when needed, and prints a blue message indicating it is running in *experiment* mode.
cumba_experiment(
weather,
param,
estimateRad = TRUE,
estimateET0 = TRUE,
irrigation_df,
irrigationEfficiency = 0.9,
fullOut = FALSE,
verbose = FALSE
)
weather |
A |
param |
Model parameters. Either:
The object must contain (as names/columns) all of:
|
estimateRad |
Logical. If |
estimateET0 |
Logical. If |
irrigation_df |
A |
irrigationEfficiency |
Numeric (0-1). Fraction of the observed applied
water ( |
fullOut |
Logical. If |
verbose |
Logical. If |
On start, the function prints "CUMBA running in experiment mode" in
blue (via crayon). It checks that all required columns/elements are
present and throws informative errors if anything is missing. Sites are
inferred from the unique values of weather$Site.
If param is supplied as a list-of-lists with a value field,
it is converted internally with tibble::as_tibble(lapply(param, `[[`, "value")).
A data.frame containing the input weather plus the
daily CUMBA outputs per site and date; the set of columns depends on
fullOut.
weather: must include columns Site, Tx, Tn,
P, DATE. Depending on the flags:
if estimateRad = TRUE (default), column Lat is required;
if estimateRad = FALSE, column Rad is required;
if estimateET0 = FALSE, column ET0 is required.
irrigation_df: must include columns ID, Site,
YEAR, DATE, WVOL.
as_tibble, blue, red
data(tomatoFoggia)
data(cumbaParameters)
# Replay one growing season from the bundled field dataset
wx <- subset(tomatoFoggia$weather, format(DATE, "%Y") == "2018")
out <- cumba_experiment(wx, cumbaParameters,
irrigation_df = tomatoFoggia$irrigation)
head(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.