range_attribute: Range of attribute in groups

View source: R/functions_statistics.R

range_attributeR Documentation

Range of attribute in groups

Description

This function computes the sum or the average range of an attribute for groups in a partition.

Usage

range_attribute(partition, attribute, stat)

Arguments

partition

A partition (vector)

attribute

A vector containing the values of the attribute

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

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')

ERPM documentation built on May 29, 2024, 10:05 a.m.