Learn R Programming

datapack (version 1.0.0)

initialize,DataObject-method: Initialize a DataObject

Description

When initializing a DataObject using passed in data, one can either pass in the 'id' param as a 'SystemMetadata' object, or as a 'character' string representing the identifier for an object along with parameters for format, user,and associated member node. If 'data' is not missing, the 'data' param holds the 'raw' data. Otherwise, the 'filename' parameter must be provided, and points at a file containing the bytes of the data.

Usage

"initialize"(.Object, id = as.character(NA), dataobj = NA, format = as.character(NA), user = as.character(NA), mnNodeId = as.character(NA), filename = as.character(NA), seriesId = as.character(NA), mediaType = as.character(NA), suggestedFilename = as.character(NA))

Arguments

.Object
the DataObject instance to be initialized
id
the identifier for the DataObject, unique within its repository. Optionally this can be an existing SystemMetadata object
dataobj
the bytes of the data for this object in 'raw' format, optional if 'filename' is provided
format
the format identifier for the object, e.g."text/csv", "eml://ecoinformatics.org/eml-2.1.1"
user
the identity of the user owning the package, typically in X.509 format
mnNodeId
the node identifier for the repository to which this object belongs.
filename
the filename for the fully qualified path to the data on disk, optional if 'data' is provided
seriesId
A unique string to identifier the latest of multiple revisions of the object.
mediaType
The When specified, indicates the IANA Media Type (aka MIME-Type) of the object. The value should include the media type and subtype (e.g. text/csv).
suggestedFilename
A suggested filename to use when this object is serialized. If not specified, defaults to the basename of the filename parameter.

Details

If filesystem storage is used for the data associated with a DataObject, care must be taken to not modify or remove that file in R or via other facilities while the DataObject exists in the R session. Changes to the object are not detected and will result in unexpected results.

See Also

DataObject-class

Examples

Run this code
data <- charToRaw("1,2,3\n4,5,6\n")
do <- new("DataObject", "id1", dataobj=data, "text/csv", 
  "uid=jones,DC=example,DC=com", "urn:node:KNB")

Run the code above in your browser using DataLab