% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions_statistics.R
\name{similar_pairs}
\alias{similar_pairs}
\title{Similar pairs of individuals in a partition}
\usage{
similar_pairs(partition, attribute, stat, threshold)
}
\arguments{
\item{partition}{A partition (vector)}

\item{attribute}{A vector containing the values of the attribute}

\item{stat}{The statistic to compute : 'avg_pergroup' for the average, 'sum_pergroup' for the sum, 'sum_perind' and 'avg_perind' for individuals}

\item{threshold}{Threshold to determine if 2 individuals attributes values are close}
}
\value{
The statisic chosen in stat
}
\description{
This function computes the total number, the average number having the close values of a numerical variable
and the number of individuals a partition.
}
\examples{
p <- c(1,2,2,3,3,4,4,4,5)
at <- c(3,5,23,2,1,0,3,9,2)
similar_pairs(p,at,1,'avg_pergroup')
}
