Learn R Programming

ggplot2 (version 0.9.0)

resolution: Compute the "resolution" of a data vector.

Description

The resolution is is the smallest non-zero distance between adjacent values. If there is only one unique value, then the resolution is defined to be one.

Usage

resolution(x, zero = TRUE)

Arguments

x
numeric vector
zero
should a zero value be automatically included in the computation of resolution

Examples

Run this code
resolution(1:10)
resolution((1:10) - 0.5)
resolution((1:10) - 0.5, FALSE)
resolution(c(1,2, 10, 20, 50))

Run the code above in your browser using DataLab