Learn R Programming

datapkg (version 0.1)

datapackage: Read/write data-package

Description

Read and write data frames to/from 'data-package' format. For reading supported paths are disk, http or git. For writing only disk is supported.

Usage

datapkg_read(path = getwd())
datapkg_validate(path = getwd())
datapkg_write(data, name, path = getwd())

Arguments

path
file path or URL to the data package directory
data
a data frame to be added to the package
name
what to name this dataset

References

http://frictionlessdata.io/data-packages, https://github.com/datasets

Examples

Run this code
# Create new data package
pkgdir <- tempfile()
datapkg_write(mtcars, path = pkgdir)
datapkg_write(iris, path = pkgdir)

# Read it back
mypkg <- datapkg_read(pkgdir)
print(mypkg$data$mtcars)

# Clone package with git:
cities <- datapkg_read("git://github.com/datasets/world-cities")

# Read over http
euribor <- datapkg_read("https://raw.githubusercontent.com/datasets/euribor/master")

Run the code above in your browser using DataLab