cjaccard {cmahalanobis} | R Documentation |
Calculate the Jaccard distance for each species.
Description
This function takes a dataframe and a factor in input, and returns a matrix with the Jaccard distances about it.
Usage
cjaccard(
dataset,
formula,
plot = TRUE,
plot_title = "Jaccard Distance Between Groups"
)
Arguments
dataset |
A dataframe. |
formula |
A factor which you want to calculate the Jaccard distances matrix. |
plot |
Logical, if TRUE, a plot of Jaccard distances matrix is displayed. |
plot_title |
The title to be used for the plot if plot is TRUE. |
Value
A matrix containing Jaccard distances between each pair of groups and the plot.
Examples
# Example with the iris dataset
cjaccard(iris, ~Species, plot = TRUE, plot_title = "Jaccard Distance Between Groups")
# Example with the mtcars dataset
cjaccard(mtcars, ~am, plot = TRUE, plot_title = "Jaccard Distance Between Groups")
[Package cmahalanobis version 0.5.0 Index]