- Notifications
You must be signed in to change notification settings - Fork10
An R package to handle data packages
ropensci/datapack
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- Author: Matthew B. Jones and Peter Slaughter and S. Jeanette Clark (NCEAS)
- doi:10.5063/F1QV3JGM
- License:Apache 2
- Package source code on Github
- Submit Bugs and feature requests
Thedatapack R package provides an abstraction for collatingheterogeneous collections of data objects and metadata into a bundle that canbe transported and loaded into a single composite file. The methods inthis package provide a convenient way to load data from common repositoriessuch as DataONE into the R environment, and to document, serialize, and savedata from R to data repositories worldwide.
Note that this package ('datapack') is not related to the similarly named rOpenSci package 'DataPackageR'.Documentation from the DataPackageR github repository states that "DataPackageR is used to reproduciblyprocess raw data into packaged, analysis-ready data sets."
Thedatapack R package requires the R packageredland. If you are installing on Ubuntu then the Redland C librariesmust be installed before theredland anddatapack package can be installed. If you are installing on Mac OS X or Windows then installing these libraries is not required.
The following instructions illustrate how to installdatapack and its requirements.
On Mac OS X datapack can be installed with the following commands:
install.packages("datapack")library(datapack)Thedatapack R package should be available for use at this point.
Note: if you wish to build the requiredredland package from source before installingdatapack, please see the redlandinstallation instructions.
For Ubuntu, install the required Redland C libraries by entering the following commandsin a terminal window:
sudo apt-get updatesudo apt-get install librdf0 librdf0-devThen install the R packages from the R console:
install.packages("datapack")library(datapack)Thedatapack R package should be available for use at this point
For windows, the required redland R package is distributed as a binary release, so it is notnecessary to install any additional system libraries.
To install the R packages from the R console:
install.packages("datapack")library(datapack)See the full manual for documentation, but once installed, the package can be run in R using:
library(datapack)help("datapack")Create a DataPackage and add metadata and data DataObjects to it:
library(datapack)library(uuid)dp <- new("DataPackage")mdFile <- system.file("extdata/sample-eml.xml", package="datapack")mdId <- paste("urn:uuid:", UUIDgenerate(), sep="")md <- new("DataObject", id=mdId, format="eml://ecoinformatics.org/eml-2.1.0", file=mdFile)addData(dp, md)csvfile <- system.file("extdata/sample-data.csv", package="datapack")sciId <- paste("urn:uuid:", UUIDgenerate(), sep="")sciObj <- new("DataObject", id=sciId, format="text/csv", filename=csvfile)dp <- addData(dp, sciObj)ids <- getIdentifiers(dp)Add a relationship to the DataPackage that shows that the metadata describes, or "documents", the science data:
dp <- insertRelationship(dp, subjectID=mdId, objectIDs=sciId)relations <- getRelationships(dp)Create an Resource Description Framework representation of the relationships in the package:
serializationId <- paste("resourceMap", UUIDgenerate(), sep="")filePath <- file.path(sprintf("%s/%s.rdf", tempdir(), serializationId))status <- serializePackage(dp, filePath, id=serializationId, resolveURI="")Save the DataPackage to a file, using the BagIt packaging format:
bagitFile <- serializeToBagIt(dp)Note that thedataone R package can be used to upload a DataPackage to a DataONE Member Nodeusing theuploadDataPackage method. Please see the documentation for thedataone R package,for example:
vignette("upload-data", package="dataone")Work on this package was supported by:
- NSF-ABI grant #1262458 to C. Gries, M. B. Jones, and S. Collins.
- NSF-DATANET grants #0830944 and #1430508 to W. Michener, M. B. Jones, D. Vieglais, S. Allard and P. Cruse
- NSF DIBBS grant #1443062 to T. Habermann and M. B. Jones
- NSF-PLR grant #1546024 to M. B. Jones, S. Baker-Yeboah, J. Dozier, M. Schildhauer, and A. Budden
- NSF-PLR grant #2042102 to M. B. Jones, A. Budden, J. Dozier, and M. Schildhauer
Additional support was provided for working group collaboration by the National Center for Ecological Analysis and Synthesis, a Center funded by the University of California, Santa Barbara, and the State of California.
About
An R package to handle data packages
Topics
Resources
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors10
Uh oh!
There was an error while loading.Please reload this page.


