Learn R Programming

DDIwR (version 0.2-0)

getMetadata: Get metadata information from an XML file

Description

This function reads an XML file containing a DDI codebook version 2.5 and returns the variable labels and value labels.

Usage

getMetadata(xmlpath, OS = "windows", saveFile = FALSE, ...)

Arguments

xmlpath

A path to an XML file with a DDI codebook

OS

The target operating system, for the eol - end of line separator

saveFile

Boolean, save an .R file in the same folder

...

Additional arguments for this function (internal uses only)

Value

A list containing two components "varlab" for all variable labels, and "vallab" for all value labels

Details

The argument OS can be either: "windows" (default), or "Windows", "Win", "win", "MacOS", "Darwin", "Apple", "Mac", "mac", "Linux", "linux".

The end of line separator changes only when the target OS is different from the running OS.

For the moment, only DDI version 2.5 (Codebook) is supported, but the next version will include the latest DDI version 3.2 (Lifecycle).