ceuclide: Calculate the Euclidean distance of a factor in a dataframe.

View source: R/cmahalanobis.R

ceuclideR Documentation

Calculate the Euclidean distance of a factor in a dataframe.

Description

This function takes a dataframe and a factor in input, and returns a matrix with the Euclidean distances about it.

Usage

ceuclide(
  dataset,
  formula,
  plot = TRUE,
  plot_title = "Euclidean Distance Between Groups"
)

Arguments

dataset

A dataframe.

formula

The factor which you want to calculate the Euclidean distances matrix.

plot

If TRUE, shows a plot of the Euclidean distances matrix.

plot_title

The title of the plot.

Details

Calculate Euclidean distance

Value

The matrix containing distances.

Examples


# 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")


cmahalanobis documentation built on April 3, 2025, 8:51 p.m.