Finding files in project subdirectories
R Makefile
Clone or download
krlmlr Merge pull request #40 from batpigandme/site-build
Rebuild site w/ updated pkgdown
Latest commit 4e4f70c Jun 20, 2018
Permalink
Failed to load latest commit information.
R document Mar 28, 2018
docs Rebuild site w/ updated pkgdown Jun 20, 2018
inst/staticdocs remove old NEWS Mar 26, 2016
man document Apr 1, 2018
readme move to r-lib Mar 28, 2018
revdep up revdep check Dec 18, 2017
tests un-dot Mar 28, 2018
vignettes move to r-lib Mar 28, 2018
.Rbuildignore add v1.1 API Jan 16, 2017
.gitattributes .gitattributes May 20, 2015
.gitignore un-ignore Feb 1, 2018
.travis.yml oops Dec 18, 2017
API Rebuild site w/ updated pkgdown Jun 20, 2018
DESCRIPTION fledge: Bump version to 1.3.2.9000 Mar 28, 2018
Makefile use rflow Makefile Mar 24, 2016
NAMESPACE un-dot Mar 28, 2018
NEWS.md fledge: Bump version to 1.3.2.9000 Mar 28, 2018
README.md move to r-lib Mar 28, 2018
_pkgdown.yml tidytemplate Mar 28, 2018
appveyor.yml fix oldrel May 30, 2016
cran-comments.md tweak notes Dec 22, 2017
rprojroot.Rproj initial May 18, 2015
tic.R new tic rules Apr 1, 2018

README.md

rprojroot

Travis-CI Build Status AppVeyor Build Status codecov.io CRAN_Status_Badge

This package helps accessing files relative to a project root to stop the working directory insanity.

Example

The source for this text is in the readme subdirectory:

basename(getwd())
#> [1] "readme"

How do we access the package root? In a robust fashion? Easily:

dir(rprojroot::find_root("DESCRIPTION"))
#>  [1] "_pkgdown.yml"     "API"              "appveyor.yml"    
#>  [4] "cran-comments.md" "DESCRIPTION"      "docs"            
#>  [7] "inst"             "Makefile"         "man"             
#> [10] "NAMESPACE"        "NEWS.md"          "R"               
#> [13] "readme"           "README.md"        "revdep"          
#> [16] "rprojroot.Rproj"  "tests"            "tic.R"           
#> [19] "vignettes"

Installation and further reading

Install from GitHub:

devtools::install_github("r-lib/rprojroot")

See the documentation for more detail.