Description Usage Arguments Details
Basic usage: use setwd2rt(add='rootdir') to set the custom root; use setwd2rt() to go to the custom root; the root is saved as an option (see below), so will be preserved after an e.g. remove(list=ls()). Advanced usage: use setwd2rt(name='rootname',add='rootdir') to add the key-value pair ('rootname','rootdir') to the list of all rootdirs stored; use setwd2rt(name='rootname') to go to 'rootdir'; use setwd2rt(list=TRUE) to list all such key-value pairs.
1 |
name |
Name of the root to go to, or to add. defaults to 'default'. |
add |
directory to add |
list |
if TRUE, directory is unchanged; a listing of all added roots is printed. |
Best way to use this function
in your init.R file that you run when you start working on a project
Use setwd2rt(add='rootdir') to specify the root folder of your data project as 'rootdir'
Use setwd2rt(add='dependencyDir',name ="someDependency") to specify the root folder of some dependency (e.g. the data from another project that you are using in this project)
in your scripts, when you need to get to one of those roots
Use setwd2rt() to go to the 'default' root directory, defined earlier,
Use setwd2rt(name = "someDependency") to go to the subdir of that dependency defined earlier
every collaborator working on your project (e.g. synced via dropbox) should have his/her own init-collaborator-name.R file. This allows different collaborators to have different directory structures.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.