R/options.R

Defines functions lflabel .onLoad setlfunit

Documented in setlfunit

setlfunit <- function(string = ""){
  if(!is.character(string)){
    stop('"string" must be a character string"')
  }
  options("lfstat" = list(unit = string))
}

.onLoad <- function(libname, pkgname) {
  setlfunit()
}


lflabel <- function(x = "Flow"){
  if(getOption("lfstat")$unit == ""){
    return(x)
  } else {
    title <-  paste0('"', x, '"~', getOption("lfstat")$unit)
  }
  parse(text = title)
}

Try the lfstat package in your browser

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

lfstat documentation built on Nov. 10, 2022, 5:42 p.m.