nvar: Normalised heteroplasmy variance

View source: R/transformers.R

nvarR Documentation

Normalised heteroplasmy variance

Description

Normalised heteroplasmy variance

Usage

nvar(H, percent = TRUE)

Arguments

H

numeric vector of heteroplasmy fractions, either in [0; 1] or represented as percentages in [0; 100]

percent

logical; are values in H represented as percentage points?

Value

The normalised heteroplasmy variance, which is typically in [0; 1]. Lower values imply lower variance and less genetic drift, with 0 corresponding to all values of H being equal.

Note nvar(H) is equivalent to 1-estimate_parameters(H)["b"].

Examples

# Using percentage points
H <- sample(0:100, 10)
nvar(H)

# Using heteroplasmy fractions between 0 and 1
h <- stats::runif(10)
nvar(h, percent = FALSE)

lbozhilova/kimura documentation built on May 7, 2023, 12:07 p.m.