Thefromhere package helps construct relative file pathsfrom specific project roots.
fromhere provides two main methods for generating filepaths relative to the root of various project types:
Using functions:from_rproj("path/to/file")
Using strings to specify file paths, allowing a more programmaticapproach to building paths.
Using$ for autocompletion:from_rproj$path$to$file
This method allows for a more interactive approach to specifying filepaths, where the autocompletion is relative to thefrom_*folder.
This initial release supports file paths from many common projecttypes:
from_wd(): For paths relative to the workingdirectory.from_here(): For paths relative to the{here} package’sautomatic project root.from_rproj(): For R project directories.from_r_package(): For R package directories.from_remake(): For remake project directories.from_drake(): For drake project directories.from_targets(): For targets project directories.from_pkgdown(): For pkgdown project directories.from_renv(): For renv project directories.from_projectile(): For Projectile projectdirectories.from_quarto(): For Quarto project directories.from_git(): For Git repository root directories.from_svn(): For SVN repository root directories.from_vcs(): For generic version control rootdirectories (Git or SVN).from_testthat(): For testthat directories.The included vignette explains the nuances of organising files andspecifying relative file paths to produce portable and reproducibleprojects.