Is it possible to identify if R is being run in unix or windows environment -
this question has reply here:
detecting operating scheme in r (e.g. adaptive .rprofile files) 3 answersi need set different paths code depending on whether beingness run in windows or unix. have set user has alter variable "renvironment" before running, below.
renvironment <- "windows" if (renvironment == "windows") { working_dir <- "windows_path..." function_library <- "windows_path..." } else if (renvironment == "unix") { working_dir <- "unix_path..." function_library <- "unix_path..." } i wondering though whether there default r environment variables can utilize instead save user having remember manually alter variable?
the command .platform returns details of platform. can access info operating scheme
.platform$os.type this returns either "unix" or "windows".
r
No comments:
Post a Comment