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)

x | numeric vector |
---|---|

zero | should a zero value be automatically included in the computation of resolution |

#> [1] 1#> [1] 0.5#> [1] 1#> [1] 2#> [1] 1