Description Usage Arguments Value Examples
Discover standard LR project directory hierarchy. prj_root marker file (.PRJ_ROOT by default) must exist in the project root directory.
1 | LR.prj_path(prj_root = NULL, marker = ".PRJ_ROOT")
|
prj_root |
Project Root directory if string.
if |
marker |
Project root marker file. Must exist in the project root directory. |
List of essential project subdirs as functions that when called with a filename produce the correspinding path; when called without a filename return the path to the subdir itself; see Examples for details.
root |
- project root |
ana |
- Data Analysis (src/ana) |
dat |
- Data directory (dat) |
dat_raw |
- Raw data directory (dat/raw) |
doc |
- Documentation directory (doc) |
lib |
- Local Library (lib) |
lib_R |
- Local R Library (lib/R) |
mng |
- Data Munging/Wrangling (src/mng) |
rpt |
- Reports (doc/rpt) |
src |
- Source tree (src) |
src_lib |
- Common code under Source tree (src/lib) |
pkg |
- In case some code is made into R-packages (pkg) |
1 2 3 4 5 6 7 8 9 | ## Not run:
if(!exists('prj')){ prj <- LRutil::LR.prj_path() }
prj$root() # return prj_root
prj$root('readme') # returns path to prj_root/readme
prj$dat_raw('foo.csv') #returns path to prj_root/dat/raw/foo.csv
prj$src('subdir','test','t.R') #returns path to prj_root/src/subdir/test/t.R
prj$src(c('a.R','b.R')) #returns vector c('prj_root/src/a.R','prj_root/src/b.R')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.