cmanhattan | R Documentation |
This function takes a dataframe and a factor in input, and returns a matrix with the Manhattan distances about it.
cmanhattan(
dataset,
formula,
plot = TRUE,
plot_title = "Manhattan Distance Between Groups"
)
dataset |
A dataframe. |
formula |
A factor which you want to calculate Manhattan distance. |
plot |
If TRUE, show a plot of distances. |
plot_title |
The title of plot. |
Calculate Manhattan distance
A matrix containing distances.
# Example with iris dataset
cmanhattan(iris, ~Species, plot = TRUE, plot_title = "Manhattan Distance Between Groups")
# Example with mtcars dataset
cmanhattan(mtcars, ~am, plot = TRUE, plot_title = "Manhattan Distance Between Groups")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.