% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pairDist.R
\name{pairDist}
\alias{pairDist}
\title{Calculate the distance of points from the center of a cluster}
\usage{
pairDist(data, scale = FALSE, roundit = NULL)
}
\arguments{
\item{data}{data frame object or a matrix/array object}

\item{scale}{Boolean used for scaling the dataset}

\item{roundit}{Round x number of decimal places; min value is 0; max value is 6}
}
\description{
This function operates on multivariate data and
calculates the distance of points from the centroid of one or more clusters.
}
\section{Function utility}{

Used to generate the computations needed to model pair-distance measures in three dimensions
}

\section{More information about this function}{

The pairDist function is used to quantify how far each data point (row)
is from the overall mean across all columns. It’s commonly used in multivariate statistics,
machine learning, and data analysis to assess the variability or similarity of data points
relative to their mean. More specifically, the function is used in outlier detection and
cluster analysis to evaluate the dispersion of data. Used in conjunction with other
calculations, pairDist output can also be used to model data in three dimensions.
}

\examples{

data(airquality)
airq <- airquality[, 1:4]

# example 1:
x <- pairDist(airq, roundit = 3)

# example 2:
y <- pairDist(airq, scale = TRUE, roundit = 5)

# example 3

data <- matrix(
  c(1, 5, NA, 4, 5, 6, NA, 8, 9, NA, 12, 23, 6, 0, 3, 3, 8, 15),
  ncol = 3,
  byrow = TRUE
)

dist <- pairDist(data, roundit = 2)
dist_scaled <- pairDist(data, scale = TRUE, roundit = 6)

}
\references{
the current function was adapted from one of the examples in the svgViewR package, \cr
https://cran.r-project.org/web/packages/svgViewR/svgViewR.pdf
}
