News for hackers. Stuff that matters.
Re:A Quick Introduction to R by eliashaddad on Monday February 14, 2022 @09:56PM (#30342120)
In this case you should probably use the "here" or the "rprojroot" packages (libraries in conventional R parlance). They both simplify the usage of relative paths inside a project/repository.

If you have a project root with the folders code, data, etc and are running a project on /path/root/code, you can then just call data_dir <- here::here("data") for the data folder, as the here package uses several always to find the root of a project (e.g., looking for a .git folder).

There are no comments on this comment yet.