Learn R Programming

cmahalanobis (version 0.5.0)

cchebyshev: Calculate the p_values matrix for each species, using Chebyshev distance as a base.

Description

This function takes a dataset, a factor, a p_value method, number of bootstraps and permutation when necessary, and returns a p_values matrix between each pair of species and a plot if the user select TRUE using the Chebyshev distance for the distances calculation.

Usage

cchebyshev(
  dataset,
  formula,
  plot = TRUE,
  plot_title = "Chebyshev Distance Between Groups"
)

Value

A matrix containing distances and, optionally, the plot.

Arguments

dataset

A dataframe.

formula

A factor which you want to calculate Chebyshev distance.

plot

If TRUE, displays a plot of distances.

plot_title

The title of plot.

Examples

Run this code
# Example with iris dataset

cchebyshev(iris, ~Species, plot = TRUE, plot_title = "Chebyshev Distance Between Groups")

# Example with mtcars dataset

cchebyshev(mtcars, ~am, plot = TRUE, plot_title = "Chebyshev Distance Between Groups")


Run the code above in your browser using DataLab