Learn R Programming

GAPR (version 0.1.0)

.compute_gar_core: Internal function to compute Anti-Robinson or GAR/ RGAR score

Description

This function is not exported. It serves as the core computational engine for evaluating Anti-Robinson (AR), Generalized Anti-Robinson (GAR), and Relative GAR (RGAR) scores.

Usage

.compute_gar_core(mat, order, w = NULL, normalize = FALSE)

Value

A numeric value indicating the number (or proportion) of Anti-Robinson violations.

Arguments

mat

A numeric, symmetric distance matrix.

order

A permutation vector indicating the new ordering of rows/columns.

w

An integer window size (if NULL, evaluates all triplets globally).

normalize

Logical. If TRUE, returns a proportion; otherwise returns the raw count.