mod_number: Modify numbers.

View source: R/NMFSReports.R

mod_numberR Documentation

Modify numbers.

Description

Modify numbers.

Usage

mod_number(x, divideby = 1000, comma_seperator = TRUE, digits = 0)

Arguments

x

A numeric.

divideby

The value you want all of your values divided by. Default = 1000.

comma_seperator

Do you want numbers to have commas in it ("1,000" (T) vs. "1000" (F). Default = TRUE.

digits

How many digits you would like your number to have. Default = 0.

Examples

x = data.frame(matrix(data = c(20000678660, 234567, 1, NA, 2345, 23),
       ncol = 2))
mod_number(x)
mod_number(x,
       comma_seperator = FALSE)
x = data.frame(matrix(data = c(200000, 234567, 1, NA, 2345, 23)))
mod_number(x,
       divideby = 1,
       digits = 2)

EmilyMarkowitz-NOAA/NMFSReports documentation built on March 26, 2023, 1:08 a.m.