R/check_digits.R

Defines functions check_digits

Documented in check_digits

#' @title Check digits parameter
#' @description This is an internal function to determine if the rounding can go ahead.
#' @param digits Digit input to check for validity.
#' @return An error if the digits are not \code{NULL} or an integer value.
#' @keywords internal

check_digits <- function(digits) {
  
  if (!is.null(digits)) { # Rounding digits must be numeric, if given
    if ( ! inherits(digits, "numeric") ) {
      stop ("Error in check_digits(digits): rounding 'digits' are not given as a numeric input.") }
  }
}

Try the iotables package in your browser

Any scripts or data that you put into this service are public.

iotables documentation built on Sept. 24, 2022, 5:05 p.m.