dvMetadata: Retrieve metadata

Description Usage Arguments Value Author(s) See Also Examples

View source: R/dvMetadata.r

Description

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

Usage

1
2
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

An character string of class “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.

Author(s)

Thomas J. Leeper

See Also

dvMetadataFormats dvExtractFileIds dvTermsOfUse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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)

dvn documentation built on May 29, 2017, 5:53 p.m.