R/util.R

Defines functions rawToChar trail stop

# Override default for call. argument
stop <- function(..., call. = FALSE){
  base::stop(..., call. = FALSE)
}

# Strip trailing whitespace
trail <- function(str){
  str <- sub("\\s+$", "", str, perl = TRUE);
  sub("^\\s+", "", str, perl = TRUE);
}

rawToChar <- function(x){
  out <- base::rawToChar(x)
  Encoding(out) <- 'UTF-8'
  out
}

Try the webutils package in your browser

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

webutils documentation built on Nov. 24, 2023, 5:11 p.m.