Keep significant digits in double numerical columns of a data.table.

keepSignifDig(inDT, inDigits)

Arguments

inDT

a data.table with time series in the long format.

inDigits

an integer with the number of significant digits.

Value

a data.table with numeric columns trimmed to the provided number of significant digits.

Examples

library(ARCOS)
library(data.table)

locdt = data.table(id = LETTERS[1:10],
                x = runif(10))

locdtTrim = ARCOS::keepSignifDig(locdt, 2)