find_increment: Find Increment Over Range of Values

View source: R/S03_Utilities.R

find_incrementR Documentation

Find Increment Over Range of Values

Description

Given a range of values and a desired divisor, determines the rounded increment to use. Useful, for example, to determine the equally-spaced intervals to use for a figure's axes.

Usage

find_increment(x, n = NULL)

Arguments

x

A numeric vector of values.

n

An integer, the divisor. If not specified, uses the number of standard deviations instead.

Value

A named numeric value, the rounded increment to iterate over the specified number of times, with the estimated place to round to as a name.

Examples

x <- rnorm(100)
find_increment(x)
find_increment(x, 6)


rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.