
Last chance! 50% off unlimited learning
Sale ends in
Either with frequencies (or percentages) plus marginal sums,
and values as heatmaps. Used in Momocs for plotting cross-validation tables
but may be used for any table (likely with freq=FALSE
).
plot_CV(
x,
freq = FALSE,
rm0 = FALSE,
pc = FALSE,
fill = TRUE,
labels = TRUE,
axis.size = 10,
axis.x.angle = 45,
cell.size = 2.5,
signif = 2,
...
)# S3 method for default
plot_CV(
x,
freq = FALSE,
rm0 = FALSE,
pc = FALSE,
fill = TRUE,
labels = TRUE,
axis.size = 10,
axis.x.angle = 45,
cell.size = 2.5,
signif = 2,
...
)
# S3 method for LDA
plot_CV(
x,
freq = TRUE,
rm0 = TRUE,
pc = TRUE,
fill = TRUE,
labels = TRUE,
axis.size = 10,
axis.x.angle = 45,
cell.size = 2.5,
signif = 2,
...
)
a ggplot object
a (cross-validation table) or an LDA object
logical whether to display frequencies (within an actual class) or counts
logical whether to remove zeros
logical whether to multiply proportion by 100, ie display percentages
logical whether to fill cell according to count/freq
logical whether to add text labels on cells
numeric to adjust axis labels
numeric to rotate x-axis labels
numeric to adjust text labels on cells
numeric to round frequencies using signif
useless here
LDA, plot.LDA, and (pretty much the same) plot_table.
h <- hearts %>%
fgProcrustes(0.01) %>% coo_slide(ldk=2) %T>% stack %>%
efourier(6, norm=FALSE) %>% LDA(~aut)
h %>% plot_CV()
h %>% plot_CV(freq=FALSE, rm0=FALSE, fill=FALSE)
# you can customize the returned gg with some ggplot2 functions
h %>% plot_CV(labels=FALSE, fill=TRUE, axis.size=5) + ggplot2::ggtitle("A confusion matrix")
# or build your own using the prepared data_frame:
df <- h %>% plot_CV() %$% data
df
# you can even use it as a cross-table plotter
bot$fac %>% table %>% plot_CV()
Run the code above in your browser using DataLab