plot_CV: Plots a cross-validation table as an heatmap

Description Usage Arguments Value See Also Examples

View source: R/gr-LDA.R

Description

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).

Usage

1
2
3
4
5
6
7
8
9
plot_CV(x, ...)

## Default S3 method:
plot_CV(x, freq = FALSE, rm0 = TRUE, cex = 5,
  round = 2, labels = TRUE, ...)

## S3 method for class 'LDA'
plot_CV(x, freq = FALSE, rm0 = TRUE, cex = 5, round = 2,
  labels = TRUE, ...)

Arguments

x

a (cross-validation table) or an LDA object

...

only used for the generic

freq

logical whether to display frequencies or counts

rm0

logical whether to remove zeros

cex

numeric to adjust labels in every cell. NA to remove them

round

numeric, when freq=TRUE how many decimals should we display

labels

logical whether to display freq or counts as text labels

Value

a ggplot object

See Also

LDA, plot.LDA, and (pretty much the same) Ntable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(olea)
ol <- LDA(PCA(opoly(olea, 5)), "domes")
# freq=FALSE inspired by Chitwood et al. New Phytol fig. 4
gg <- plot_CV(ol, freq=FALSE)
gg

# and you can tune the gg object wit regular ggplot2 syntax eg
gg + ggplot2::scale_color_discrete(h = c(120, 240))

# freq=TRUE
plot_CV(ol, freq=TRUE)

Momocs documentation built on Sept. 28, 2017, 9:04 a.m.