Learn R Programming

dvn (version 0.3.5)

dvMetadata: Retrieve metadata

Description

Retrieve metadata for a dataverse record, using its object ID.

Usage

dvMetadata(objectid, format.type = NULL, include = NULL, exclude = NULL, dv = getOption('dvn'), browser = FALSE, ...)

Arguments

objectid
Either a character string containing the id for a dataverse study (a handle) or an object of class “dvStudyAtom”. This could be returned from dvUserStudies (or, dvSearch, from the Data Sharing API).
format.type
An optional character string specifying the format of the returned metadata. Available options can be retrieved with dvMetadataFormats. If NULL, “ddi” is used by default.
include
An optional character string specifying what metadata to include in the response.
exclude
An optional character string specifying what metadata to exclude from the response.
dv
An optional character string specifying the Dataverse to query. Default is the Harvard IQSS Dataverse.
browser
A logical specifying whether the query should be executed in a web browser. Default is FALSE.
...
Optionally, additional arguments passed to getURL via dvQuery.

Value

“dvMetadata” containing an XML data structure of metadata for the specified dataverse record. The exact form and contents of this response depend on the format.type and any include/exclude statements.

See Also

dvMetadataFormats dvExtractFileIds dvTermsOfUse

Examples

Run this code
## Not run: 
# # To retrieve all metadata:
# xml <- dvMetadata("hdl:1902.1/17218")
# # To retrieve metdata in Dublin Core format (instead of the default ("ddi"):
# xml <- dvMetadata("hdl:1902.1/17218", format.type="oai_dc")
# 
# # To extract just the study description, without file information:
# xml <- dvMetadata("hdl:1902.1/17218", include="codeBook/stdyDscr")
# # To extract just basic file description(s), without other study details:
# xml <- dvMetadata("hdl:1902.1/17218", include="codeBook/fileDscr")
# # To extract just data summaries for all variables, without other study details:
# xml <- dvMetadata("hdl:1902.1/17218", include="codeBook/dataDscr")
# ## End(Not run)

Run the code above in your browser using DataLab