Learn R Programming

metabodecon (version 1.6.2)

width: 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)

Value

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

Arguments

x

A numeric vector.

Author

2024-2025 Tobias Schmidt: initial version.

Examples

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

Run the code above in your browser using DataLab