The resolution is the smallest non-zero distance between adjacent values. If there is only one unique value, then the resolution is defined to be one. If x is an integer vector, then it is assumed to represent a discrete variable, and the resolution is 1.
resolution(x, zero = TRUE)
should a zero value be automatically included in the computation of resolution
resolution(1:10)#>  1resolution((1:10) - 0.5)#>  0.5resolution((1:10) - 0.5, FALSE)#>  1# Note the difference between numeric and integer vectors resolution(c(2, 10, 20, 50))#>  2resolution(c(2L, 10L, 20L, 50L))#>  1