here

Reproducibility
A little package for managing file paths in R projects. Using here you can always get file paths that’re relative to the project root which’re expanded to the full system path.
Author

Mateus Harrington

Published

January 28, 2025

Problem Solved

Useful for managing file paths in Quarto/R Markdown files. If you have a nested .qmd or .rmd and want to put file paths in, you’ll know when they render they set the working directory to the location of that file and not the project root.

Example Usage

# Create a new project, check you've got a .Rproj file in the project root.
# you can then just use the function:
here::here() # get the project path

# Example reading fake file
file <- here::here("data_folder/example_table.csv")
print(file)
# Read in data
# data <- read.csv(file)

Additional Resources