Load the package

library(cmahalanobis)
## 
##                                                 
##  |---------------------|
## |♞|♟|♗|♚|♞|♖|♟|♙|
## |---------------------|
## |♕|♙|♙|♙|♝|♙|♟|♟|
## |---------------------|
## |♝|♟|♘|♞|♞|♙|♔|♘|
## |---------------------|
## |♖|♟|♛|♗|♔|♟|♖|♙|
## |---------------------|
## |♟|♟|♕|♟|♟|♖|♜|♜|
## |---------------------|
## |♟|♘|♙|♗|♙|♘|♝|♟|
## |---------------------|
## |♙|♟|♟|♗|♙|♙|♛|♙|
## |---------------------|
## |♜|♙|♜|♟|♝|♚|♙|♙|
## |---------------------| 
## 
## Flavio Gioia welcomes you to cmahalanobis!
## Type 'citation("cmahalanobis")' for citing this R package in publications.

Plot of Mahalanobis Distance on supp

cmahalanobis(ToothGrowth,~supp)

## $distances
##          [,1]     [,2]
## [1,] 0.000000 2.612946
## [2,] 3.518725 0.000000

Plot of p-values about Mahalanobis Distance on supp

pvaluescmaha(ToothGrowth,~supp, pvalue.method = "chisq")

##           [,1]      [,2]
## [1,]        NA -1.306473
## [2,] -1.759363        NA

Plot of Euclidean Distance on supp

ceuclide(ToothGrowth,~supp)

## $distances
##      [,1] [,2]
## [1,]  0.0  3.7
## [2,]  3.7  0.0

Plot of p-values about Euclidean Distance on supp

pvaluesceucl(ToothGrowth,~supp, pvalue.method = "permutation", num.permutations = 10)

##      [,1] [,2]
## [1,]   NA  0.2
## [2,]  0.2   NA

Plot of Chebyshev Distance on supp

cchebyshev(ToothGrowth,~supp)

## $distances
##      [,1] [,2]
## [1,]  0.0  3.7
## [2,]  3.7  0.0

Plot of p-values about Chebyshev Distance on supp

pvaluesccheb(ToothGrowth,~supp, pvalue.method = "bootstrap", num.bootstraps = 10)

##      [,1] [,2]
## [1,]   NA  0.4
## [2,]  0.4   NA

Plot of Manhattan Distance on supp

cmanhattan(ToothGrowth,~supp)

## $distances
##      [,1] [,2]
## [1,]  0.0  3.7
## [2,]  3.7  0.0

Plot of p-values about Manhattan Distance on supp

pvaluescmanh(ToothGrowth,~supp, pvalue.method = "chisq")

##       [,1]  [,2]
## [1,]    NA -1.85
## [2,] -1.85    NA