signif_custom: Rounding of numbers to significant digits with options

View source: R/signif_custom.R

signif_customR Documentation

Rounding of numbers to significant digits with options

Description

A combination of the the signif() and ceiling()/floor() functions. It allows numbers to be rounded to a provided number of significant digits, but to specifically have ceiling() or floor() applied for the rounding.

Usage

signif_custom(x, digits = 1, option = ceiling)

Arguments

x

Numeric vector to be rounded to set significant figures

digits

Number of significant figures to round to

option

Specific rounding function to apply; options are ceiling, floor, trunc, or round

Value

Numeric vector of rounded numbers

Examples

signif_custom(1014, digits = 2)
signif_custom(67362, digits = 3, option = floor)

christyray/sciscales documentation built on April 14, 2022, 2:05 p.m.