This function returns a pretty range of values for a given a vector of type numeric.

prettyRange(x)

Arguments

x

A vector of numerical values.

Value

A vector of two values specifying the pretty the range of values.

Details

This function intends to generate range with round values.

See also

Examples

# Example 1: vec <- stats::runif(20) range(vec)
#> [1] 0.04373911 0.82295308
prettyRange(vec)
#> [1] 0.00 0.85
# Example 2: prettyRange(c(3.849,3.88245))
#> [1] 3.845 3.885