Plot accuracy results from accuracy()
plot_accuracy.RdProvides six plot types for visualising BLUP accuracy computed by
accuracy(): a lollipop summary, violin distribution, heatmap,
and three two-model comparison plots (dumbbell, scatter, diff).
Arguments
- res
Data frame returned by
accuracy(). May be group-level or by-variety (by_variety = TRUE) depending ontype.- res2
Optional second data frame from
accuracy()for comparison plots ("dumbbell","scatter","diff").- type
Plot type – one of
"lollipop","violin","heatmap","dumbbell","scatter","diff".- metric
Character vector:
"accuracy","gen.H2", or both (default). When both are selected the plot is faceted into two panels.- label1
Legend label for
res(comparison plots only).- label2
Legend label for
res2(comparison plots only).- theme
A ggplot2 theme object applied to all plots.
- return_data
Logical. If
TRUE, returns a list with elements$plotand$datainstead of just the plot.- ...
Currently unused.
Examples
if (FALSE) { # \dontrun{
acc <- accuracy(model_fa, metric = c("accuracy","gen.H2"))
acc2 <- accuracy(model_diag, metric = c("accuracy","gen.H2"))
plot_accuracy(acc, type = "lollipop")
plot_accuracy(acc_bv, type = "violin")
plot_accuracy(acc_bv, type = "heatmap")
plot_accuracy(acc, acc2, type = "dumbbell", label1 = "FA", label2 = "Diag")
plot_accuracy(acc_bv, acc2_bv, type = "scatter")
plot_accuracy(acc, acc2, type = "diff", label1 = "FA", label2 = "Diag")
} # }