sub.range {quickcode}R Documentation

Calculate the Range Difference of a Numeric Vector

Description

This function calculates the difference between the maximum and minimum values of a numeric vector.

Usage

sub.range(x)

Arguments

x

A numeric vector for which the range difference is to be calculated.

Value

A numeric value representing the difference between the maximum and minimum values of the input vector. Returns 'NA' if the input is empty or contains only 'NA' values.

Examples

# Example with a numeric vector
numeric_vector <- c(1, 5, 3, 8, 2)
sub.range(numeric_vector)

# Example with missing values
sub.range(c(NA, 4, 7, NA, 10))


[Package quickcode version 1.0.8 Index]