- Notifications
You must be signed in to change notification settings - Fork47
A simpler way to find your files
License
Unknown, MIT licenses found
Licenses found
r-lib/here
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The goal of the here package is to enable easy file referencing inproject-oriented workflows. Incontrast to usingsetwd(), which is fragile and dependent on the wayyou organize your files, here uses the top-level directory of a projectto easily build paths to files.
Install the released version of here from CRAN:
install.packages("here")The here package creates paths relative to the top-level directory. Thepackage displays the top-level of the current project on load or anytime you callhere():
here::i_am("README.Rmd")#> here() starts at /Users/kirill/git/R/r-lib/herehere()#> [1] "/Users/kirill/git/R/r-lib/here"
You can build a path relative to the top-level directory in order toread or write a file:
here("inst","demo-project","data","penguins.csv")#> [1] "/Users/kirill/git/R/r-lib/here/inst/demo-project/data/penguins.csv"readr::write_csv(palmerpenguins::penguins, here("inst","demo-project","data","penguins.csv"))
These relative paths work regardless of where the associated source filelives inside your project, like analysis projects with data and reportsin different subdirectories. See the includeddemoproject foran example.
Illustration byAllison Horst
Please note that the here project is released with aContributor Codeof Conduct. Bycontributing to this project, you agree to abide by its terms.
About
A simpler way to find your files
Topics
Resources
License
Unknown, MIT licenses found
Licenses found
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.