View source: R/functions_statistics.R
similar_pairs | R Documentation |
This function computes the total number, the average number having the close values of a numerical variable and the number of individuals a partition.
similar_pairs(partition, attribute, stat, threshold)
partition |
A partition (vector) |
attribute |
A vector containing the values of the attribute |
stat |
The statistic to compute : 'avg_pergroup' for the average, 'sum_pergroup' for the sum, 'sum_perind' and 'avg_perind' for individuals |
threshold |
Threshold to determine if 2 individuals attributes values are close |
The statisic chosen in stat
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.