R/base30toNumeric.R

Defines functions base30toNumeric

Documented in base30toNumeric

#' @rdname base30conversion
#' @export
base30toNumeric <- function(x) {
  symbols <- rev(strsplit(tolower(x), "")[[1]]);
  res <- 0L;
  for (i in seq_along(symbols)) {
    res <- res + (30^(i-1L) * (which(base30==symbols[i])-1L));
  }
  return(res);
}

Try the rock package in your browser

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

rock documentation built on Dec. 28, 2022, 1:55 a.m.