# NOT RUN {
dpkg <- new("DataPackage")
data <- charToRaw("1,2,3\n4,5,6")
metadata <- charToRaw("EML or other metadata document text goes here\n")
md <- new("DataObject", id="md1", dataobj=metadata, format="text/xml", user="smith",
mnNodeId="urn:node:KNB")
do <- new("DataObject", id="id1", dataobj=data, format="text/csv", user="smith",
mnNodeId="urn:node:KNB")
# Associate the metadata object with the science object. The 'mo' object will be added
# to the package automatically, since it hasn't been added yet.
dpkg <- addMember(dpkg, do, md)
# }
Run the code above in your browser using DataLab