I heartily endorse @cderv's recommendation for the here package and it's more powerful friend rprojroot.
Always work inside "projects" (conceptually and literally: dedicated directory = RStudio Project = Git repo), leave working directory in RStudio set to top-level of Project at all times, and create resilient paths using here::here(). If you or collaborator or some automated process ends up with working directory set elsewhere in the Project, these paths will still work.