# Create a new project, check you've got a .Rproj file in the project root.
# you can then just use the function:
::here() # get the project path
here
# Example reading fake file
<- here::here("data_folder/example_table.csv")
file print(file)
# Read in data
# data <- read.csv(file)
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.
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
Additional Resources
- Source Code: https://github.com/r-lib/here/