R/is.inca.R

Defines functions is.inca

Documented in is.inca

#' Check if R is running from INCA
#'
#' @param logical Should the return value be a simple boolean whether we
#' are running from INCA or not?
#'
#' @return Either \code{TRUE}\code{FALSE} if \code{logical = TRUE} or one of
#' "PROD", "TEST" or "LOCAL" depending on were R is running
#' (if \code{logical = FALSE})
#'
#' @export
#' @examples
#' is.inca()
is.inca <- function(logical = TRUE) {
  x <-
    switch(
      Sys.info()["nodename"],
      "EXT-R27-PROD" = "PROD",
      "EXT-R37-TEST" = "TEST",
      "LOCAL"
    )
  if (logical)
    x %in% c("PROD", "TEST")
  else x
}

Try the incadata package in your browser

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

incadata documentation built on April 14, 2020, 6:08 p.m.