R/getEnter.R

Defines functions getEnter

Documented in getEnter

getEnter <- function(OS) {

    detectedOS <- Sys.info()[['sysname']]
    
    if (OS == "Windows" | OS == "windows" | OS == "Win" | OS == "win") {
        enter <- ifelse(detectedOS == "Windows", "\n", "\r\n")
    }
    else if (OS == "Linux" | OS == "linux") {
        enter <- "\n"
    }
    else if (OS == "Darwin" | OS == "MacOS" | OS == "Apple" | OS == "Mac" | OS == "mac") {
        enter <- ifelse(detectedOS == "Darwin", "\n", "\r")
    }
    else {
        cat("\n")
        stop("The specified OS is not supported.\n\n", call. = FALSE)
    }
    
    return(enter)
}

Try the DDIwR package in your browser

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

DDIwR documentation built on May 2, 2019, 4:19 p.m.