num_abbr: Abbreviate numbers

View source: R/wrangling.R

num_abbrR Documentation

Abbreviate numbers

Description

This function converts a numeric vector's values into their abbreviated character equivalent, i.e. 100,000,000 into 100M.

Usage

num_abbr(x, n = 3)

Arguments

x

Numeric vector

n

Integer. Single numeric value, specifying number of significant figures to show. Range 1 to 6.

Value

Vector of character values that contain converted values

See Also

Other Data Wrangling: balance_data(), categ_reducer(), cleanText(), date_cuts(), date_feats(), file_name(), formatHTML(), holidays(), impute(), left(), normalize(), ohe_commas(), ohse(), quants(), removenacols(), replaceall(), replacefactor(), textFeats(), textTokenizer(), vector2text(), year_month(), zerovar()

Examples

num_abbr(rnorm(10) * 1e6)
num_abbr(rnorm(10) * 1e6, n = 1)

lares documentation built on Nov. 5, 2023, 1:09 a.m.