cmPlot: Visualize a Confusion Matrix (ggplot)

Description Usage Arguments Value

View source: R/cmPlot_function.R

Description

Given a dataframe and a formula object, will return the necessary dependent variable matrix and the model matrix needed to run the optimization for multinomial regression for a given reference level.

Usage

1
2
cmPlot(cm, red_or_white, pred_first = TRUE, title, title.size = 20,
  axis.title.size = 15, axis.text.size = 18)

Arguments

cm

a 3 column dataframe with columns for prediction and reference categroies and corresponding frequency counts (third column). 0 counts should be converted to NA

red_or_white

character string c("red", "white") to specify plot coloring

pred_first

logical, whether first column contains the prediction category (default is TRUE)

title

character string to be used as plot title

title.size

an integer controlling the size of the plot title. Defaults to 20.

axis.title.size

an integer controlling the size of axis titles. Defaults to 15.

axis.text.size

an integer controlling the size of axis text. Defaults to 18.

Value

a ggplot object visualizing the confusion matrix of reference versus predicted


group-wine/sommelieR documentation built on May 21, 2019, 1:43 p.m.