Last chance! 50% off unlimited learning
Sale ends in
This function takes a dataframe and a factor in input, and returns a matrix with the Euclidean distances about it.
ceuclide(
dataset,
formula,
plot = TRUE,
plot_title = "Euclidean Distance Between Groups"
)
The matrix containing distances.
A dataframe.
The factor which you want to calculate the Euclidean distances matrix.
If TRUE, shows a plot of the Euclidean distances matrix.
The title of the plot.
Calculate Euclidean distance
# Example with iris dataset
ceuclide(iris, ~Species, plot = TRUE, plot_title = "Euclidean Distance Between Groups")
# Example with mtcars dataset
ceuclide(mtcars, ~am, plot = TRUE, plot_title = "Euclidean Distance Between Groups")
Run the code above in your browser using DataLab