Learn R Programming

dataone (version 2.2.2)

addData,DataPackage,D1Object-method: Add a D1Object containing a data object to a DataPackage

Description

The D1Object do is added to the data package x.

Usage

# S4 method for DataPackage,D1Object
addData(x, do, mo = as.character(NA))

Arguments

x

The "DataPackage" to which the data object should be added.

do

A D1Object to add to the DataPackage

mo

A D1Object (containing metadata describing "do" ) to associate with the data object.

Details

If the optional mo parameter is specified, then it is assumed that this DataObject is a metadata object that describes the data object that is being added. The DataObject specified in the mo parameter will also be added to the DataPackage, if it has not already been added. Then the addData function will add a relationship to the resource map that indicates that the metadata object describes the science object, using CiTO, the Citation Typing Ontology, documents and isDocumentedBy relationships.

Examples

Run this code
# NOT RUN {
library(dataone)
library(datapack)
library(uuid)
dp <- new("DataPackage")
d1c <- D1Client("STAGING", "urn:node:mnStageUCSB2")
# Create metadata object that describes science data
newId <- sprintf("urn:uuid:%s", UUIDgenerate())
csvfile <- system.file("extdata/sample.csv", package="dataone")
sciObj <- new("DataObject", id=newId, format="text/csv",filename=csvfile)
dp <- addData(dp, do = sciObj)
# }

Run the code above in your browser using DataLab