R: determine if a script is running in Windows or Linux

JD Long picture JD Long · Jan 19, 2010 · Viewed 7.9k times · Source

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

Answer

Dan picture Dan · Jan 19, 2010
if(.Platform$OS.type == "unix") {
} else {

}