datastorr: Fetch data from a datastorr repository

Description Usage Arguments Details Examples

View source: R/simple.R

Description

Create a lightweight datastorr interface (rather than using the full package approach). This approach is designed for the "files that don't fit in git" use-case.

Usage

1
2
3
4
5
datastorr(repo, path = NULL, metadata = "datastorr.json",
  branch = "master", private = FALSE, refetch = FALSE,
  version = NULL, extended = FALSE)

datastorr_versions(..., local = TRUE)

Arguments

repo

Either a github repo in the form <username>/<repo> (e.g., "richfitz/data" or the path to a json file on your filesystem.

path

The path to store the data at. Using NULL will

metadata

The name of the metadata file within the repo (if repo refers to a github repo. The default is datastorr.json at the root of the repository, but any other filename can be used.

branch

The branch in the repo to use. Default is master.

private

A logical indicating if the repository is private and therefor if authentication will be needed to access it.

refetch

Refetch the metadata file even if it has already been downloaded previously.

version

Which version to download (if extended is FALSE – the default). By default the most recent version on the remote, or the current version locally will be fetched.

extended

Don't fetch the data, but instead return an object that can query data, versions, etc.

...

Arguments passed through to datastorr

local

Return information on local versions?

Details

Note that the package approach is likely to scale better; in particular it allows for the reading function to be arbitrarily complicated, allows for package installation and loading, etc. With this simple interface you will need to document your dependencies carefully. But it does remove the requirement for making a package and will likely work pretty well as part of an analysis pipeline where your dependencies are well documented anyway.

Examples

1
2
3
4
5
6
7
## Not run: 
path <- tempfile()
dat <- datastorr("richfitz/data", path, extended = TRUE)
dat$list()
dat()

## End(Not run)

richfitz/dataverse documentation built on July 9, 2021, 12:08 p.m.