R/general.r

Defines functions last_el has_env

Documented in has_env last_el

#' Does the environment variable exist?
#' @export
has_env <- function(x) !identical(Sys.getenv(x), "")

#' get last element
#' @export
last_el <- function(x) {
  if (length(x) < 1) return(x)
  x[[length(x)]]
}
hrbrmstr/hrbrmisc documentation built on May 1, 2023, 7:39 a.m.