R/to_decimal.R

#' @keywords internal
#'

to_decimal <- function (fractional)
{
  if (inherits(fractional, "data.frame")) {
    return(data.frame(sapply(fractional, to_decimal), row.names = rownames(fractional)) %>%
             stats::setNames(names(fractional)) %>% as.matrix)
  }
  sapply(ifelse(fractional == "", NA, fractional), function(ratio) {
    eval(parse(text = ratio))
  }, USE.NAMES = FALSE) + 1
}

Try the aRbs package in your browser

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

aRbs documentation built on April 24, 2021, 5:08 p.m.