count_edge_crossings: Count Edge Crossings in Parallel Coordinates

View source: R/ggparallel_specific_utils.R

count_edge_crossingsR Documentation

Count Edge Crossings in Parallel Coordinates

Description

Calculates the total number of edge crossings between two numeric vectors in a 2-column parallel coordinates setup. Each axis represents one of the columns.

Usage

count_edge_crossings(l, r)

Arguments

l

A numeric vector representing values on the left axis. Must have the same length as r.

r

A numeric vector representing values on the right axis. Must have the same length as l.

Details

An edge crossing occurs when two edges intersect between the axes. Formally, edges (l[i], r[i]) and (l[j], r[j]) cross if (l[i] - l[j]) * (r[i] - r[j]) < 0.

Value

An integer indicating the total number of edge crossings.


ggEDA documentation built on Sept. 9, 2025, 5:45 p.m.