Skip to content

Instantly share code, notes, and snippets.

@ZeccaLehn
Last active August 29, 2015 14:15
Show Gist options
  • Save ZeccaLehn/0dbd4ad286910624c1cd to your computer and use it in GitHub Desktop.
Save ZeccaLehn/0dbd4ad286910624c1cd to your computer and use it in GitHub Desktop.
Automagically Set R Working Directory on Linux Machine

Sets the working directory in R on a Linux system after and are replaced with actual folder names.

Alows for sharing code without each user having to change the HOME variable (e.g., "home/myMachine/Projects/First"

setwd(paste0(Sys.getenv("HOME"),"/<TopDir>/<Root>")) 

For Windows, use proper slash direction and notation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment