powered by
This function converts a numeric vector's values into their abbreviated character equivalent, i.e. 100,000,000 into 100M.
num_abbr(x, n = 3)
Numeric vector
Integer. Single numeric value, specifying number of significant figures to show. Range 1 to 6.
Vector of character values that contain converted values
# NOT RUN { num_abbr(rnorm(10) * 1e6) num_abbr(rnorm(10) * 1e6, n = 1) # }
Run the code above in your browser using DataLab