Coder Social home page Coder Social logo

datastore's Introduction

R-Package datastore

This is the datastore package that allows to save versioned datasets in R inspired by the miniCRAN pkg.

Travis build status Coverage status GitHub last commit GitHub code size in bytes

Updates

Updates/Changes are listed here.

Useage

Installation

As the package is not yet on cran, it can be installed easily directly from github.

devtools::install_github("bernhard-da/datastore")

Load Pkg and create a datastore

library(datastore)
ds <- "/tmp/mydatastore"
unlink(ds, recursive=TRUE)
ds_new(ds)

Add datasets to the store

Using ds_add() one can add a dataset in different versions to the datastore. Note that the data input is not limited to data.frames but can be any R object.

df1 <- data.frame(x=1)
df2 <- data.frame(x=1, y=2)
df3 <- list(x=1, y=2, z=3)

# add a dataset to the datastore
ds_add(ds, obj=df1, ds_name="dataset1", version=1)
ds_add(ds, obj=df2, ds_name="dataset1", version=2)
ds_add(ds, obj=df3, ds_name="dataset1", version=3)

Information about current state

this functions shows some generic information about the given datastore

ds_info(ds)

Check for existence

Using ds_exist() one can check if a dataset in a given version exists in the datastore.

ds_exists(ds, ds_name="dataset1", version=1)
ds_exists(ds, ds_name="dataset1", version=5)

Which versions exist?

Using ds_versions one gets an overview over all versions of a stored dataset in the given datastore.

ds_versions(ds, ds_name="dataset1")

Fetch data

Using ds_get() and ds_get_latest() we can fetch specific versions of a dataset from the datastore.

# specific version
ds_get(ds, ds_name="dataset1", version=1)
# latest version
ds_get_latest(ds, ds_name="dataset1")

Remove one or all versions of a dataset

Using ds_remove() one can remove a single (or all) versions of a dataset from a given datastore.

# remove a specific version
ds_remove(ds, ds_name="dataset1", version=2)
# remove all versions
ds_remove(ds, ds_name="dataset1")

Delete the entire datastore

With ds_delete_datastore(), one can delete the given datastore and all files versioned within it.

datastore's People

Contributors

bernhard-da avatar

Watchers

James Cloos avatar  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.