R/system_tools.R

Defines functions get_os

Documented in get_os

## -----------------------------------------------------------------------
#' @title get_os
#' @description Convert from wide data to long data.
#' @author Xiaotao Shen
#' \email{shenxt1990@@outlook.com}
#' @export
#' @return os name
#' @examples
#' get_os()
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)
}
tidymass/tinytools documentation built on Jan. 2, 2022, 5:18 p.m.