Calculate the width of the range of x

width(x)

Arguments

x

object to calculate range for

Value

The width of the range of x as integer.

Examples

width(1:10)
#> [1] 10
width(c(6748, 234, 2456, 5678))
#> [1] 6515
width(sample(345))
#> [1] 345