Giter Club home page Giter Club logo

Comments (3)

krlmlr avatar krlmlr commented on August 11, 2024

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.

jennybc avatar jennybc commented on August 11, 2024

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.

krlmlr avatar krlmlr commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.