R/helper.R

Defines functions formatg

# code from package rpart (copy)
formatg <- function(x, digits = getOption("digits"), format = paste0("%.", digits, "g"))
{
  if (!is.numeric(x))
    stop("'x' must be a numeric vector")
  temp <- sprintf(format, x)
  if (is.matrix(x))
    matrix(temp, nrow = nrow(x))
  else temp
}

Try the rpart.LAD package in your browser

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

rpart.LAD documentation built on Nov. 18, 2023, 5:07 p.m.