decimaldigit | R Documentation |
This function is to derive the digit number after decimal point for a numeric variable (e.g., lat and long).
decimaldigit(x, dechar = ".", nint = NA, ndec = NA, pad.left = TRUE)
x |
one or more decimal numbers. |
dechar |
The character used to separate the decimal part of a number. |
nint |
The number of characters to which the integer part of the numbers should be padded. |
ndec |
The number of characters to which the decimal part of the numbers should be padded. |
pad.left |
Whether the left (integer) side of the numbers should be padded as well as the right. |
A list of integer number to show digit number after decimal point of x.
This function is modified from decimal.align in 'prettyR' package.
Jin Li
Jim Lemon and Philippe Grosjean (2019). 'prettyR': Pretty Descriptive Stats. R package version 2.1.1. https://CRAN.R-project.org/package=prettyR.
x<-c(0.1, 2.2, 3.03, 44.444, 555.0005, 6666.66666)
decimaldigit(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.