I have to use Macs and PCs.
It’s always been a mystery to me why I can’t use the same format to identify directory paths between the Mac and the PC.
So I always have this snippet of code in my scripts…
# if Windows
working_directory <- "C:\\Users\\Kurt\\Dropbox\\<work directory>”
# if Apple
if ( Sys.info()['sysname'] == "Darwin")
working_directory <- "~/Dropbox/<work directory>"
setwd(working_directory)
I realize that this is just a couple lines of code, but is there a way to simplify / streamline this issue? Thanks for any assistance