R/get_os.R

Defines functions get_os

Documented in get_os

#' Title
#'
#' @return
#' @export
#'
#' @examples
get_os <- function(){
  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)
}
JBLecomte/JBUtilities documentation built on March 31, 2021, 7:25 p.m.