Search code examples
rmultiplatform

Determine if a script is running in Windows or Linux


Is there a simple way to programmatically determine if an R script is being executed in Windows vs. Linux?


Solution

  • if(.Platform$OS.type == "unix") {
    } else {
    
    }