gap_score: Gap Score

View source: R/regularity_indices.R

gap_scoreR Documentation

Gap Score

Description

Compute median gap between identical values

Usage

gap_score(x)

Arguments

x

vector of distinct options of numbers or characters

Details

This function takes a vector x and computes the median gap between the most adjacent identical values. For each value encountered in the sequence it is computed whether the same value occurs again in the sequence. If so, the length of the gap between them is stored. Finally, the mean over these gap lengths is computed and returned. The lowest score of 1 indicates that most or all values of the same kind are right next to each other. A higher scores indicates that options of the same kind often have a gap between them containing options of a different kind.

Value

gap score of x

References

#' Ginsburg N, Karpiuk P. Random Generation: Analysis of the Responses. Perceptual and Motor Skills. 1994;79(3):1059-1067. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.2466/pms.1994.79.3.1059")}

Examples

gap_score(ginsburg1994)
gap_score(evans1978[, 1])
gap_score(evans1978[, 2])


TImA97/randfindR documentation built on July 1, 2024, 7:56 p.m.