View source: R/generic_stats.R
statistics | R Documentation |
Compute statistics for evaluation of any model outputs against
observations, providing a formater function (see format_cropr()
).
statistics(
sim,
obs = NULL,
all_situations = FALSE,
all_plants = TRUE,
verbose = TRUE,
formater,
stat = "all"
)
sim |
A simulation data.frame |
obs |
An observation data.frame (variable names must match) |
all_situations |
Boolean (default = FALSE). If |
all_plants |
Boolean (default = TRUE). If |
verbose |
Boolean. Print informations during execution. |
formater |
The function used to format the models outputs and observations in a standard way. You can design your own function that format one situation and provide it here. |
stat |
A character vector of required statistics, "all" for all, or any
of |
A data.frame with statistics for each variable and possibly each grouping variable returned by the formater.
Because this function has the purpose to assess model quality, all statistics are computed on dates were observations are present only. So the simulation mean is only the mean on dates with observations, not the overall simulation mean.
## Not run:
workspace <- system.file(file.path("extdata", "stics_example_1"),
package = "CroPlotR"
)
situations <- SticsRFiles::get_usms_list(
usm_path =
file.path(workspace, "usms.xml")
)
sim <- SticsRFiles::get_sim(workspace = workspace, usm = situations)
obs <- SticsRFiles::get_obs(workspace = workspace, usm = situations)
statistics(
sim = sim$`IC_Wheat_Pea_2005-2006_N0`,
obs = obs$`IC_Wheat_Pea_2005-2006_N0`,
formater = format_cropr
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.