% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions_statistics.R
\name{range_attribute}
\alias{range_attribute}
\title{Range of attribute in groups}
\usage{
range_attribute(partition, attribute, stat)
}
\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 per group  and 'sum_pergroup' for the sum of the ranges}
}
\value{
The statisic chosen in stat
}
\description{
This function computes the sum or the average range of an attribute for groups in 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)
range_attribute(p,at,'avg_pergroup')
}
