A wrapper for pretty.

pretty_within(x, min.n = 5, xrange = range(x, na.rm = TRUE), ...)

Arguments

x

Numeric vector passed to pretty.

min.n

Integer scalar passed to pretty.

xrange

Numeric vector of length 2. Indicates the range in which the output vector should lie on.

...

Further arguments passed to the method.

The only difference with pretty is that this function subsets the resulting vector as

tick[(tick >= xrange[1]) & (tick <= xrange[2])]

Value

A vector sequence of `n + 1` round values in the specified range.

Examples

# Simple example ------------------------------------------------------------
set.seed(3331)
x <- runif(10)
pretty(x)
#> [1] 0.0 0.2 0.4 0.6 0.8 1.0
pretty_within(x)
#> [1] 0.2 0.4 0.6 0.8
range(x)
#> [1] 0.02017065 0.99833339