-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
here() to access parent directories? #13
Comments
I suggest to create a symbolic link or a junction. Assuming that you are in your project directory: # OS X/Linux
file.symlink("~/Data", "data")
# Windows
Sys.junction("~/Data", "data") Then, you can just use @jennybc: Do you think this advice should be part of our documentation? |
This sounds like a reasonable idea. To clarify, is this the principle? For a self-contained project, to reference files that (a) live elsewhere and (b) are not installed in a standard place, it is best practice to create a link inside the project. As an aside, if |
Confirming. I'd even create a link to directories in standard places, in this particular case we can put the link under version control (OS X/Linux only). This principle also holds for other ways to access data (web APIs, databases, ...); accessing the data through a "link" (URL, connection string, ...) feels better than copying the data into your project. Data packages have their advantages, but I find packages that simplify access to external resources more useful than packages that contain a copy of the data. |
Say I have my data stored in ~/Data, but my R project & code is stored in ~/dev/sample_model. Is it good practice to use here() to access this data, or should I hard-code absolute paths to it?
The text was updated successfully, but these errors were encountered: