Created
          March 31, 2016 18:09 
        
      - 
      
- 
        Save ZeccaLehn/00573d526ba140ca8a244e39ac0d1c1e to your computer and use it in GitHub Desktop. 
    [R] Desktop Directory Function for Windows or Linux 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Allows for working directory to be used on Windows or Linux | |
| projectFolder <- "YOURDESKTOPFOLDER" | |
| if(Sys.info()['sysname'] == "Linux"){ | |
| setwd( paste0( Sys.getenv("HOME") , paste0("/Desktop/", projectFolder, "/") ) ) | |
| } else { | |
| X <- Sys.getenv('HOME') | |
| setwd(gsub("Documents", paste0("/Desktop/", projectFolder, "/"), X)) | |
| rm(X) | |
| } | |
| getwd() | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment