https://here.r-lib.org/articles/here.html
it is a useful package to set project root directory
# my project structure is following:
#> /home/sunny/work/myproject
#> ├── data_proc
#> │ └── mycode.R
#> ├── analysis
#> │ └── mydata.csv
R code
# this lets here know where the project root is in related to here_i_am
here::i_am("data_proc/mycode.R")
# now you can call here command
library(here)
# this will print /home/sunny/work/myproject
here()