gg_CV: Plot confusion matrices

Description Usage Arguments Details Examples

View source: R/stat_lda_gr.R

Description

Plots as heatmap and with useful cosmetics

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
gg_CV(
  x,
  prop = TRUE,
  percent = TRUE,
  drop_zeros = TRUE,
  text = TRUE,
  text_colour = "white",
  text_size = 8,
  text_signif = 2,
  axis_size = 10,
  axis_x_angle = 0
)

## Default S3 method:
gg_CV(
  x,
  prop = TRUE,
  percent = TRUE,
  drop_zeros = TRUE,
  text = TRUE,
  text_colour = "white",
  text_size = 8,
  text_signif = 2,
  axis_size = 10,
  axis_x_angle = 0
)

## S3 method for class 'stat_lda_full'
gg_CV(
  x,
  prop = TRUE,
  percent = TRUE,
  drop_zeros = TRUE,
  text = TRUE,
  text_colour = "white",
  text_size = 8,
  text_signif = 2,
  axis_size = 10,
  axis_x_angle = 0
)

## S3 method for class 'matrix'
gg_CV(
  x,
  prop = TRUE,
  percent = TRUE,
  drop_zeros = TRUE,
  text = TRUE,
  text_colour = "white",
  text_size = 8,
  text_signif = 2,
  axis_size = 10,
  axis_x_angle = 0
)

Arguments

x

confusion matrix or CV_tbl returned by lda

prop

logical if TRUE (default), use accuracies (within an actual class); if FALSE use counts

percent

logical whether to use percentages (default to TRUE)

drop_zeros

logical whether to drop zeros in labels (default to TRUE)

text

logical whether display cell information (default to TRUE)

text_colour

logical whether display cell information (default to white)

text_size

numeric size for cell information, in points (default to 8)

text_signif

integer to feed signif (default to '2“)

axis_size

numeric size for axes labels

axis_x_angle

numeric angle for x-axis labels

Details

when a matrix is passed, it assumes that it is:

Examples

1
2
3
4
# works fine on matrices too
# set.seed(2329) # for the sake of replicability
m <- matrix(sample(1:100), 10)
gg_CV(m)

MomX/Momstats documentation built on April 8, 2020, 8:04 a.m.