width: Calculate the Width of a Numeric Vector

View source: R/util.R

widthR Documentation

Calculate the Width of a Numeric Vector

Description

Calculates the width of a numeric vector by computing the difference between the maximum and minimum values in the vector.

Usage

width(x)

Arguments

x

A numeric vector.

Value

The width of the vector, calculated as the difference between its maximum and minimum values.

Author(s)

2024-2025 Tobias Schmidt: initial version.

Examples

vec <- c(1, 3, 5, 7, 9)
width(vec)

metabodecon documentation built on Nov. 5, 2025, 7:12 p.m.