here

The goal of the here package is to enable easy file referencing in project-oriented workflows. In contrast to using setwd(), which is fragile and dependent on the way you organize your files, here uses the top-level directory of a project to easily build paths to files.

Installation

Install the released version of here from CRAN:

Usage

The here package creates paths relative to the top-level directory. The package displays the top-level of the current project on load or any time you call here():

You can build a path relative to the top-level directory in order to read or write a file:

These relative paths work regardless of where the associated source file lives inside your project, like analysis projects with data and reports in different subdirectories. See the included demo project for an example.

Illustration by Allison Horst


Code of Conduct

Please note that the here project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Down Chevron

Install

install.packages('here')

Monthly Downloads

45,778

Version

1.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

December 13th, 2020

Functions in here (1.0.1)