Comments (3)
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 here("data")
to refer to your data. You need to provide instructions in your README.md
on how to obtain the data and set up the symlinks.
@jennybc: Do you think this advice should be part of our documentation?
from what-they-forgot.
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 ~/Data
holds data that is used in more than one project, it is a good candidate for conversion to a data package. Which could then be versioned and installed and accessed in a more robust way, via library()
.
from what-they-forgot.
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.
from what-they-forgot.
Related Issues (20)
- Advice re: creating user library doesn't quite make sense
- Debugging with lldb
- Should system prep verification use `pkgbuild::check_build_tools()`?
- GitHub search examples
- macOS header problem HOT 1
- Definitive to guide to re-installing a package on Windows HOT 7
- link broken HOT 4
- Mention user vs project specific .Renviron in the chapter about startup files?
- chapter 9 :ref devtools instead of remotes
- Chapter 8.4: Example for path expansion
- Move `master` branch to `main` HOT 1
- [WIP] `xcode-select --install` seems to not work anymore
- For “Maintaining R”, would it be worth adding architecture-specific `R_LIBS_USER` paths?
- Mention `base` package Rprofile as a point of interest? HOT 1
- warn against `save`
- mention memoise package in chapter 1.6 - objects that take a long time to create?
- R Startup .Renviron activity
- exercise callout
- update package installation references
- Environment variables
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from what-they-forgot.