Skip to contents

Given a positive number x, returns the smallest element of 10^floor(log10(x)) * nice that is \(\geq x\). Useful for setting clean axis limits or bin widths.

Usage

roundUpNice(x, nice = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))

Arguments

x

A single positive numeric value.

nice

Numeric vector of multipliers to cycle through within each power-of-ten decade. Default 1:10.

Value

A single numeric value rounded up to the next nice number.