sub.range: 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)
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.
Arguments
x
A numeric vector for which the range difference is to be calculated.
# Example with a numeric vectornumeric_vector <- c(1, 5, 3, 8, 2)
sub.range(numeric_vector)
# Example with missing valuessub.range(c(NA, 4, 7, NA, 10))