It draws a tiles plot of predictions and observations with alternative axis orientation (P vs. O; O vs. P).
tiles_plot(
data = NULL,
obs,
pred,
bins = 10,
colors = c(low = NULL, high = NULL),
orientation = "PO",
print_metrics = FALSE,
metrics_list = NULL,
position_metrics = c(x = NULL, y = NULL),
print_eq = TRUE,
position_eq = c(x = NULL, y = NULL),
eq_color = NULL,
regline_type = NULL,
regline_size = NULL,
regline_color = NULL,
na.rm = TRUE
)
Object of class ggplot
.
(Optional) argument to call an existing data frame containing the data.
Vector with observed values (numeric).
Vector with predicted values (numeric).
Argument of class numeric specifying the number of bins to create the tiles.
Vector or list with two colors '(low, high)' to paint the density gradient.
Argument of class string specifying the axis orientation, PO for predicted vs observed, and OP for observed vs predicted. Default is orientation = "PO".
boolean TRUE/FALSE to embed metrics in the plot. Default is FALSE.
vector or list of selected metrics to print on the plot.
vector or list with '(x,y)' coordinates to locate the metrics_table into the plot. Default : c(x = min(obs), y = 1.05*max(pred)).
boolean TRUE/FALSE to embed metrics in the plot. Default is FALSE.
vector or list with '(x,y)' coordinates to locate the SMA equation into the plot. Default : c(x = 0.70 max(x), y = 1.25*min(y)).
string indicating the color of the SMA-regression text.
string or integer indicating the SMA-regression line-type.
number indicating the SMA-regression line size.
string indicating the SMA-regression line color.
Logic argument to remove rows with missing values (NA). Default is na.rm = TRUE.
It creates a tiles plot of predicted vs. observed values. The plot also includes the 1:1 line (solid line) and the linear regression line (dashed line). By default, it places the observed on the x-axis and the predicted on the y-axis (orientation = "PO"). This can be inverted by changing the argument orientation = “OP". For more details, see online-documentation
# \donttest{
X <- rnorm(n = 100, mean = 0, sd = 10)
Y <- rnorm(n = 100, mean = 0, sd = 10)
tiles_plot(obs = X, pred = Y)
# }
Run the code above in your browser using DataLab