View source: R/generic_plotting.R
plot.statistics  R Documentation 
Plot statistics
## S3 method for class 'statistics'
plot(
x,
xvar = c("group", "situation"),
type = c("bar", "radar"),
group_bar = c("rows", "stack", "dodge"),
crit_radar = NULL,
title = NULL,
force = FALSE,
verbose = TRUE,
...
)
x 
The output of 
xvar 
The variable to use in x, either the group or the situation (the other is used for colouring) 
type 
The type of plot requested, either "bar" (bar plot) or "radar" (radar chart) 
group_bar 
Way to display the different statistical criteria when

crit_radar 
Statistical criterion chosen to be displayed on the radar chart. 
title 
The plot title 
force 
Continue if the plot is not possible ? E.g. no observations
for scatter plots. If 
verbose 
Boolean. Print information during execution. 
... 
Other arguments to pass (for backward compatibility only) 
The group_bar
argument can be:
"rows" (the default): One line of graphs per statistical criterion
"stack": Bars of each statistical criterion stacked
"dodge": Bars of each statistical criterion side by side
Return a ggplot object with statistics
# Importing an example with three situations with observation:
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)
# R2 and nRMSE stats for the simulation:
stats < summary(sim, obs = obs, stats = c("R2", "nRMSE"))
plot(stats)
# Change the group name:
stats < summary("stics v9.0" = sim, obs = obs, stats = c("R2", "nRMSE"))
plot(stats)
# R2 and nRMSE stats for two groups of simulations:
summary(sim1 = sim, sim2 = sim, obs = obs, stats = c("R2", "nRMSE"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.