Learn R Programming

dataone (version 2.2.2)

getPackage: Download a data package from a member node.

Description

Given a valid identifier, download a file containing all of the package members of the corresponding DataONE data package.

Usage

getPackage(x, ...)

# S4 method for MNode getPackage( x, identifier, format = "application/bagit-097", dirPath = NULL, unzip = FALSE )

Arguments

x

A MNode instance representing a DataONE Member Node repository.

...

(not yet used)

identifier

The identifier of the package to retrieve. The identifier can be for the resource map, metadata file, data file, or any other package member.

format

The format to send the package in.

dirPath

The directory path to save the package to.

unzip

(logical) If the dirPath is specified, the package can also be unzipped automatically (unzip=TRUE).

Value

The location of the package file downloaded from the member node.

Details

The default data package file format is a Bagit file (https://tools.ietf.org/html/draft-kunze-bagit-09). The downloaded package file is compressed using the ZIP format and will be located in an R session temporary file. Other packaging formats can be requested if they have been implemented by the requested member node.

See Also

MNode class description.

Examples

Run this code
# NOT RUN {
cn <- CNode()
mn <- getMNode(cn, "urn:node:KNB")
packageFileName <- getPackage(mn, id="resourceMap_Blandy.76.2")
# }

Run the code above in your browser using DataLab