R/get_os.R

Defines functions get_os

Documented in get_os

#' Get operating system
#'
#' @return Lower case character of operating system
#' @export
get_os <- function() {
  # https://www.r-bloggers.com/2015/06/identifying-the-os-from-r/
  sysinf <- Sys.info()
  if (!is.null(sysinf)){
    os <- sysinf['sysname']
    if (os == 'Darwin')
      os <- "osx"
  } else { ## mystery machine
    os <- .Platform$OS.type
    if (grepl("^darwin", R.version$os))
      os <- "osx"
    if (grepl("linux-gnu", R.version$os))
      os <- "linux"
  }
  tolower(os)
}
Sz-Tim/sevcheck documentation built on Feb. 1, 2024, 12:39 a.m.