The argument “interactive” of the function “clover_plot” determines if a static plot (interactive=FALSE) or an interactive plot (interactive=TRUE) should be plotted. The default value is TRUE.

The static plot is more appropriate for exporting the plot to pdf or other formats. The interactive plot allows the user to explore the plotted points using the hoovering tooltip, to zoom the chart (click-and-drag to zoom in, double-click to autoscale), and to pan (shift-and-drag).

Example

First we generate data from bivariate normal distributions with different means and the same variance matrices and compute the necessary quantities:

library(mvtnorm)

n1 <- 100
n2 <- 75

set.seed(2020)

X <- rmvnorm(n1, mean=c(0,0), sigma=diag(2)) # Observations of class 1
Y <- rmvnorm(n2, mean=c(2,2), sigma=diag(2)) # Observations of class 2

res <- clover_calc(X, Y)

The interactive clover plot is produced by default:

clover_plot(res)
## Misclassification rate of the QDA classifier:   0.0857
## Non-classification rate of the QDA classifier:  0
## 
## Misclassification rate of the DD1 classifier:   0.0914
## Non-classification rate of the DD1 classifier:  0.0686

The static clover plot:

clover_plot(res, interactive=FALSE)
## Misclassification rate of the QDA classifier:   0.0857
## Non-classification rate of the QDA classifier:  0
## 
## Misclassification rate of the DD1 classifier:   0.0914
## Non-classification rate of the DD1 classifier:  0.0686

Back to the main page.