R/specify_decimal.R

Defines functions specify_decimal

Documented in specify_decimal

#' Specify the number of decimal places
#' Please see (https://stackoverflow.com/questions/3443687/formatting-decimal-places-in-r)
#' for the function conceptions
#' 
#' @param x decimal to convert
#' @param k number of decimal places
#' @keywords decimal places, decimal
#' @export
#' @examples
#' x <- 0.324153245
#' specify_decimal(x, 3)

specify_decimal <- function(x, k) trimws(format(round(x, k), nsmall=k))
Euphrasiologist/VCVglmm documentation built on June 4, 2020, 7:08 p.m.