get_number_decimals: Get number of decimals (i.e. return total number of digits...

Description Usage Arguments Value Examples

View source: R/get_number_decimals.R

Description

Get number of decimals (i.e. return total number of digits after decimal point) for any vector of numbers in [0,1) if number of decimals <= 6

Usage

1

Arguments

x

Numerical vector where all elements are in [0,1)

Value

Vector giving the number of decimals for each element in x if the number is <= 6; otherwise return 7 with a warning

Examples

1
2
3
4
5
6
get_number_decimals(c(0.0006, 0.0750, 0.0420, 0.0031, 0.0001, 0.0100))
get_number_decimals(c(6*10^-4, 7.5*10^-2, 4.2*10^-2, 3.1*10^-3, 10^-4, 10^-2))
get_number_decimals(c(6.5*10^-4, 0.0100)) 
get_number_decimals(c(6.5e-4, 0.0100))
get_number_decimals(c(0.00065, 0.0100))
get_number_decimals(c(10^-7, 10e-7, 10e-3))

leekgroup/fdrreg documentation built on Dec. 11, 2020, 10:54 a.m.