GithubHelp home page GithubHelp logo

j-lawson / simplecache Goto Github PK

View Code? Open in Web Editor NEW

This project forked from databio/simplecache

0.0 1.0 0.0 47 KB

Quick R caching for reproducible big data projects

Home Page: http://databio.org/simplecache

R 100.00%

simplecache's Introduction

simpleCache: R caching for restartable analysis

SimpleCache is an R package providing functions for caching R objects. Its purpose is to encourage writing reusable, restartable, and reproducible analysis pipelines for projects with massive data and computational requirements.

Like its name indicates, simpleCache is intended to be simple. You choose a location to store your caches, and then provide the function with nothing more than a cache name and instructions (R code) for how to produce the R object. While simple, simpleCache also provides some advanced options like environment assignments, recreating caches, reloading caches, and even cluster compute bindings (to SLURM) making it flexible enough for use in large-scale data analysis projects.


Installing simpleCache

Install the development version directly from github with devtools

require(devtools)
install_github("sheffien/simpleCache") #public

To install a local copy:

packageFolder = "~/Rn/simpleCache";
install.packages(packageFolder, repos=NULL)

Running simpleCache

simpleCache comes with a single primary function that will do almost everything you need. I have produced some R vignettes to get you started.


simpleCache Philosophy

The use case I had in mind for simpleCache is that you find yourself constantly recalculating the same R object in several different scripts, or repeatedly in the same script, every time you open it and want to continue that project. SimpleCache is well-suited for interactive analysis, allowing you to pick up right where you left off in a new R session, without having to recalculate everything. It is equally useful in automatic pipelines, where separate scripts may benefit from loading, instead of recalculating, the same R objects produced by other scripts.

R provides some base functions (save, serialize, and load) to let you save and reload such objects, but these low-level functions are a bit cumbersome. simpleCache simply provides a convenient, user-friendly interface to these functions, streamlining the process. For example, a single simpleCache call will check for a cache and load it if it exists, or create it if it does not. With the base R save and load functions, you can't just write a single function call and then run the same thing every time you start the script -- even this simple use case requires additional logic to check for an existing cache. SimpleCache just does all this for you.

They thing to keep in mind with simpleCache is that the cache name is paramount. SimpleCache assumes that your name for an object is a perfect identifier for that object; in other words, don't cache things that you plan to change.

simplecache's People

Watchers

 avatar

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.