Skip to content

Instantly share code, notes, and snippets.

@cgpu
Last active September 19, 2018 05:24
Show Gist options
  • Save cgpu/e2a521898fd14c07bab95f1093e7bc86 to your computer and use it in GitHub Desktop.
Save cgpu/e2a521898fd14c07bab95f1093e7bc86 to your computer and use it in GitHub Desktop.
ExecutionPC-agnostic Dropbox directory path.
# Find os:
```{r}
os <- Sys.info()[[1]]
```
# Create OS-relevant Dropbox file path:
```{r}
if(os == "Windows"){
dropbox_dir = paste0( 'C:/Users/', Sys.info()[["user"]] ,"/" ,'Dropbox/')
} else if (os != "Windows") {
dropbox_dir = paste0('/home/',Sys.info()[["user"]],"/", 'Dropbox/')
}
```
# Print file path for verifying correctness of path:
```{r}
cat("OS : ", os, "\n","~ : ", dropbox_dir)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment