View source: R/regularity_indices.R
gap_score | R Documentation |
Compute median gap between identical values
gap_score(x)
x |
vector of distinct options of numbers or characters |
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.
gap score of x
#' 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")}
gap_score(ginsburg1994)
gap_score(evans1978[, 1])
gap_score(evans1978[, 2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.