vec_inv: Count the inversions in a vector.

Description Usage Arguments Value Examples

View source: R/vec-inv.R

Description

Count the inversions in a vector.

Usage

1
vec_inv(vec)

Arguments

vec

A numerical vector (theoretically, with no repeated values).

Value

The number of pairs of entries i and j of vec for which i > j.

Examples

1
2
vec_inv(1:5)
vec_inv(5:1)

corybrunson/tautable documentation built on March 29, 2021, 9:22 p.m.